* [PATCH] mmc: block: propagate correct returned value in mmc_rpmb_ioctl
@ 2018-05-16 19:20 Mathieu Malaterre
2018-05-17 2:45 ` Shawn Lin
2018-05-21 11:36 ` Ulf Hansson
0 siblings, 2 replies; 5+ messages in thread
From: Mathieu Malaterre @ 2018-05-16 19:20 UTC (permalink / raw)
To: Linus Walleij
Cc: Mathieu Malaterre, Ulf Hansson, Adrian Hunter, Shawn Lin,
Wolfram Sang, linux-mmc, linux-kernel
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]
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
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: block: propagate correct returned value in mmc_rpmb_ioctl
2018-05-16 19:20 [PATCH] mmc: block: propagate correct returned value in mmc_rpmb_ioctl Mathieu Malaterre
@ 2018-05-17 2:45 ` Shawn Lin
2018-05-17 6:16 ` Mathieu Malaterre
2018-05-21 11:36 ` Ulf Hansson
1 sibling, 1 reply; 5+ messages in thread
From: Shawn Lin @ 2018-05-17 2:45 UTC (permalink / raw)
To: Mathieu Malaterre, Linus Walleij
Cc: shawn.lin, Ulf Hansson, Adrian Hunter, Wolfram Sang, linux-mmc,
linux-kernel
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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: block: propagate correct returned value in mmc_rpmb_ioctl
2018-05-17 2:45 ` Shawn Lin
@ 2018-05-17 6:16 ` Mathieu Malaterre
2018-05-17 6:24 ` Shawn Lin
0 siblings, 1 reply; 5+ messages in thread
From: Mathieu Malaterre @ 2018-05-17 6:16 UTC (permalink / raw)
To: Shawn Lin
Cc: Linus Walleij, Ulf Hansson, Adrian Hunter, Wolfram Sang, linux-mmc, LKML
On Thu, May 17, 2018 at 4:45 AM, Shawn Lin <shawn.lin@rock-chips.com> wrote:
>
> 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.
$ powerpc-linux-gnu-gcc --version
powerpc-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This is the default powerpc cross compiler on Debian stable (no
change). Config is simply a ppc32 (with some minor customization).
> And it's worth backporting to stable.
I am not familiar with the process, do I need to submit a v2 to add the line:
Cc: <stable@vger.kernel.org> # v4.15+
?
> 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
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: block: propagate correct returned value in mmc_rpmb_ioctl
2018-05-17 6:16 ` Mathieu Malaterre
@ 2018-05-17 6:24 ` Shawn Lin
0 siblings, 0 replies; 5+ messages in thread
From: Shawn Lin @ 2018-05-17 6:24 UTC (permalink / raw)
To: Mathieu Malaterre
Cc: shawn.lin, Linus Walleij, Ulf Hansson, Adrian Hunter,
Wolfram Sang, linux-mmc, LKML
On 2018/5/17 14:16, Mathieu Malaterre wrote:
> On Thu, May 17, 2018 at 4:45 AM, Shawn Lin <shawn.lin@rock-chips.com> wrote:
>>
>> 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.
>
> $ powerpc-linux-gnu-gcc --version
> powerpc-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516
> Copyright (C) 2016 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
Thanks for sharing.
> This is the default powerpc cross compiler on Debian stable (no
> change). Config is simply a ppc32 (with some minor customization).
>
>
>> And it's worth backporting to stable.
>
> I am not familiar with the process, do I need to submit a v2 to add the line:
>
> Cc: <stable@vger.kernel.org> # v4.15+
>
In general Ulf could kindly help with it when applied. :)
> ?
>
>> 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
>>>
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: block: propagate correct returned value in mmc_rpmb_ioctl
2018-05-16 19:20 [PATCH] mmc: block: propagate correct returned value in mmc_rpmb_ioctl Mathieu Malaterre
2018-05-17 2:45 ` Shawn Lin
@ 2018-05-21 11:36 ` Ulf Hansson
1 sibling, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2018-05-21 11:36 UTC (permalink / raw)
To: Mathieu Malaterre
Cc: Linus Walleij, Adrian Hunter, Shawn Lin, Wolfram Sang, linux-mmc,
Linux Kernel Mailing List
On 16 May 2018 at 21:20, Mathieu Malaterre <malat@debian.org> 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]
>
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
Thanks, applied for fixes and by adding a stable tag!
Kind regards
Uffe
> ---
> 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
> --
> 2.11.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-05-21 11:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-16 19:20 [PATCH] mmc: block: propagate correct returned value in mmc_rpmb_ioctl Mathieu Malaterre
2018-05-17 2:45 ` Shawn Lin
2018-05-17 6:16 ` Mathieu Malaterre
2018-05-17 6:24 ` Shawn Lin
2018-05-21 11:36 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).