public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Fabian Frederick <fabf@skynet.be>
Cc: linux-kernel@vger.kernel.org, Doug Thompson <dougthompson@xmission.com>
Subject: Re: [PATCH 1/1] drivers/edac/edac_module.c: remove unnecessary test on unsigned value
Date: Tue, 10 Jun 2014 20:27:19 +0200	[thread overview]
Message-ID: <20140610182719.GA28752@pd.tnic> (raw)
In-Reply-To: <1402341618-10674-1-git-send-email-fabf@skynet.be>

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.
--

  reply	other threads:[~2014-06-10 18:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2014-07-17 12:26   ` Andrey Utkin
2014-07-17 12:50     ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140610182719.GA28752@pd.tnic \
    --to=bp@alien8.de \
    --cc=dougthompson@xmission.com \
    --cc=fabf@skynet.be \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox