lkml.org 
[lkml]   [2018]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] mmc: block: propagate correct returned value in mmc_rpmb_ioctl
From
Date

On 2018/5/17 3:20, Mathieu Malaterre wrote:
> In commit 97548575bef3 ("mmc: block: Convert RPMB to a character device") a
> new function `mmc_rpmb_ioctl` was added. The final return is simply
> returning a value of `0` instead of propagating the correct return code.
>
> Discovered during a compilation with W=1, silence the following gcc warning
>
> drivers/mmc/core/block.c:2470:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
>

Good catch! But hey, which gcc are you using now? Mine, gcc-linaro-
6.3.1-2017.05-x86_64_aarch64-linux-gnu, with W=1 doesn't warn about
this. And it's worth backporting to stable.

Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

> Signed-off-by: Mathieu Malaterre <malat@debian.org>
> ---
> drivers/mmc/core/block.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index 9e923cd1d80e..38a7586b00cc 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -2485,7 +2485,7 @@ static long mmc_rpmb_ioctl(struct file *filp, unsigned int cmd,
> break;
> }
>
> - return 0;
> + return ret;
> }
>
> #ifdef CONFIG_COMPAT
>

\
 
 \ /
  Last update: 2018-05-17 04:45    [W:0.058 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site