All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] drivers/edac/edac_module.c: remove unnecessary test on unsigned value
@ 2014-06-09 19:20 Fabian Frederick
  2014-06-10 18:27 ` Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Fabian Frederick @ 2014-06-09 19:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: Fabian Frederick, Doug Thompson, Borislav Petkov

unsigned long value is never < 0

Cc: Doug Thompson <dougthompson@xmission.com>
Cc: Borislav Petkov <bp@alien8.de>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/edac/edac_module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/edac/edac_module.c b/drivers/edac/edac_module.c
index a66941f..e6d1691 100644
--- a/drivers/edac/edac_module.c
+++ b/drivers/edac/edac_module.c
@@ -28,7 +28,7 @@ static int edac_set_debug_level(const char *buf, struct kernel_param *kp)
 	if (ret)
 		return ret;
 
-	if (val < 0 || val > 4)
+	if (val > 4)
 		return -EINVAL;
 
 	return param_set_int(buf, kp);
-- 
1.8.4.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] drivers/edac/edac_module.c: remove unnecessary test on unsigned value
  2014-06-09 19:20 [PATCH 1/1] drivers/edac/edac_module.c: remove unnecessary test on unsigned value Fabian Frederick
@ 2014-06-10 18:27 ` Borislav Petkov
  2014-07-17 12:26   ` Andrey Utkin
  0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2014-06-10 18:27 UTC (permalink / raw)
  To: Fabian Frederick; +Cc: linux-kernel, Doug Thompson

On Mon, Jun 09, 2014 at 09:20:18PM +0200, Fabian Frederick wrote:
> unsigned long value is never < 0
> 
> Cc: Doug Thompson <dougthompson@xmission.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  drivers/edac/edac_module.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/edac/edac_module.c b/drivers/edac/edac_module.c
> index a66941f..e6d1691 100644
> --- a/drivers/edac/edac_module.c
> +++ b/drivers/edac/edac_module.c
> @@ -28,7 +28,7 @@ static int edac_set_debug_level(const char *buf, struct kernel_param *kp)
>  	if (ret)
>  		return ret;
>  
> -	if (val < 0 || val > 4)
> +	if (val > 4)
>  		return -EINVAL;

Ok, so I don't know how you caught this but FWIW, we have those W= build
switches which trigger it too (which is a good thing that we have them
:-))

$ make W=1 drivers/edac/edac_module.o

...

drivers/edac/edac_module.c: In function ‘edac_set_debug_level’:
drivers/edac/edac_module.c:31:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if (val < 0 || val > 4)

Applied, thanks.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] drivers/edac/edac_module.c: remove unnecessary test on unsigned value
  2014-06-10 18:27 ` Borislav Petkov
@ 2014-07-17 12:26   ` Andrey Utkin
  2014-07-17 12:50     ` Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Utkin @ 2014-07-17 12:26 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Fabian Frederick, linux-kernel, Doug Thompson

2014-06-10 21:27 GMT+03:00 Borislav Petkov <bp@alien8.de>:
> On Mon, Jun 09, 2014 at 09:20:18PM +0200, Fabian Frederick wrote:
>> unsigned long value is never < 0
>>
>> Cc: Doug Thompson <dougthompson@xmission.com>
>> Cc: Borislav Petkov <bp@alien8.de>
>> Signed-off-by: Fabian Frederick <fabf@skynet.be>
>> ---
>>  drivers/edac/edac_module.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/edac/edac_module.c b/drivers/edac/edac_module.c
>> index a66941f..e6d1691 100644
>> --- a/drivers/edac/edac_module.c
>> +++ b/drivers/edac/edac_module.c
>> @@ -28,7 +28,7 @@ static int edac_set_debug_level(const char *buf, struct kernel_param *kp)
>>       if (ret)
>>               return ret;
>>
>> -     if (val < 0 || val > 4)
>> +     if (val > 4)
>>               return -EINVAL;
>
> Ok, so I don't know how you caught this but FWIW, we have those W= build
> switches which trigger it too (which is a good thing that we have them
> :-))
>
> $ make W=1 drivers/edac/edac_module.o
>
> ...
>
> drivers/edac/edac_module.c: In function 'edac_set_debug_level':
> drivers/edac/edac_module.c:31:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
>   if (val < 0 || val > 4)
>
> Applied, thanks.

This hasn't got into none of v3.16-rc5 release, repos "linux-stable"
and "torvalds/linux".
See https://bugzilla.kernel.org/show_bug.cgi?id=80431

-- 
Andrey Utkin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] drivers/edac/edac_module.c: remove unnecessary test on unsigned value
  2014-07-17 12:26   ` Andrey Utkin
@ 2014-07-17 12:50     ` Borislav Petkov
  0 siblings, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2014-07-17 12:50 UTC (permalink / raw)
  To: Andrey Utkin; +Cc: Fabian Frederick, linux-kernel, Doug Thompson

On Thu, Jul 17, 2014 at 03:26:26PM +0300, Andrey Utkin wrote:
> This hasn't got into none of v3.16-rc5 release, repos "linux-stable"
> and "torvalds/linux".
> See https://bugzilla.kernel.org/show_bug.cgi?id=80431

It is queued for 3.17 and it won't get into stable because it doesn't
fit stable rules.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-17 12:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-09 19:20 [PATCH 1/1] drivers/edac/edac_module.c: remove unnecessary test on unsigned value Fabian Frederick
2014-06-10 18:27 ` Borislav Petkov
2014-07-17 12:26   ` Andrey Utkin
2014-07-17 12:50     ` Borislav Petkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.