diff mbox series

[net-next] net: wwan: t7xx: Fix return type of t7xx_dl_add_timedout()

Message ID 20220511071907.29120-1-yuehaibing@huawei.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: wwan: t7xx: Fix return type of t7xx_dl_add_timedout() | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 3 maintainers not CCed: linux-mediatek@lists.infradead.org linux-arm-kernel@lists.infradead.org matthias.bgg@gmail.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yue Haibing May 11, 2022, 7:19 a.m. UTC
t7xx_dl_add_timedout() now return int 'ret', but the return type
is bool. Change the return type to int for furthor errcode upstream.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/wwan/t7xx/t7xx_dpmaif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ricardo Martinez May 12, 2022, 12:35 a.m. UTC | #1
On 5/11/2022 12:19 AM, YueHaibing wrote:
> t7xx_dl_add_timedout() now return int 'ret', but the return type
> is bool. Change the return type to int for furthor errcode upstream.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>   drivers/net/wwan/t7xx/t7xx_dpmaif.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wwan/t7xx/t7xx_dpmaif.c b/drivers/net/wwan/t7xx/t7xx_dpmaif.c
> index c8bf6929af51..8ee15af1a1ce 100644
> --- a/drivers/net/wwan/t7xx/t7xx_dpmaif.c
> +++ b/drivers/net/wwan/t7xx/t7xx_dpmaif.c
> @@ -1043,7 +1043,7 @@ unsigned int t7xx_dpmaif_dl_dlq_pit_get_wr_idx(struct dpmaif_hw_info *hw_info,
>   	return value & DPMAIF_DL_RD_WR_IDX_MSK;
>   }
>   
> -static bool t7xx_dl_add_timedout(struct dpmaif_hw_info *hw_info)
> +static int t7xx_dl_add_timedout(struct dpmaif_hw_info *hw_info)
yes, int is the right return type, thanks!
>   {
>   	u32 value;
>   	int ret;
Paolo Abeni May 12, 2022, 8:27 a.m. UTC | #2
On Wed, 2022-05-11 at 17:35 -0700, Martinez, Ricardo wrote:
> On 5/11/2022 12:19 AM, YueHaibing wrote:
> > t7xx_dl_add_timedout() now return int 'ret', but the return type
> > is bool. Change the return type to int for furthor errcode upstream.
> > 
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> > ---
> >   drivers/net/wwan/t7xx/t7xx_dpmaif.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/wwan/t7xx/t7xx_dpmaif.c b/drivers/net/wwan/t7xx/t7xx_dpmaif.c
> > index c8bf6929af51..8ee15af1a1ce 100644
> > --- a/drivers/net/wwan/t7xx/t7xx_dpmaif.c
> > +++ b/drivers/net/wwan/t7xx/t7xx_dpmaif.c
> > @@ -1043,7 +1043,7 @@ unsigned int t7xx_dpmaif_dl_dlq_pit_get_wr_idx(struct dpmaif_hw_info *hw_info,
> >   	return value & DPMAIF_DL_RD_WR_IDX_MSK;
> >   }
> >   
> > -static bool t7xx_dl_add_timedout(struct dpmaif_hw_info *hw_info)
> > +static int t7xx_dl_add_timedout(struct dpmaif_hw_info *hw_info)
> yes, int is the right return type, thanks!
> 

Changing the return type without using the different error code in the
caller is quite useless. Additionally t7xx_dl_add_timedout() (via
ioread32_poll_timeout_atomic()) can produce a single error value
(ETIMEOUT). IMHO this change is not needed.

You may want to remove the 'ret' local variable instead (in the same
function)

Cheers,

Paolo
diff mbox series

Patch

diff --git a/drivers/net/wwan/t7xx/t7xx_dpmaif.c b/drivers/net/wwan/t7xx/t7xx_dpmaif.c
index c8bf6929af51..8ee15af1a1ce 100644
--- a/drivers/net/wwan/t7xx/t7xx_dpmaif.c
+++ b/drivers/net/wwan/t7xx/t7xx_dpmaif.c
@@ -1043,7 +1043,7 @@  unsigned int t7xx_dpmaif_dl_dlq_pit_get_wr_idx(struct dpmaif_hw_info *hw_info,
 	return value & DPMAIF_DL_RD_WR_IDX_MSK;
 }
 
-static bool t7xx_dl_add_timedout(struct dpmaif_hw_info *hw_info)
+static int t7xx_dl_add_timedout(struct dpmaif_hw_info *hw_info)
 {
 	u32 value;
 	int ret;