linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rene Herman <rene.herman@keyaccess.nl>
To: David Howells <dhowells@redhat.com>
Cc: bjorn.helgaas@hp.com, rene.herman@gmail.com, len.brown@intel.com,
	linux-acpi@vger.kernel.org
Subject: Re: [PATCH] Fix pnpacpi_parse_irq_option()'s test against PNP_IRQ_NR
Date: Fri, 27 Jun 2008 14:53:05 +0200	[thread overview]
Message-ID: <4864E2B1.3040308@keyaccess.nl> (raw)
In-Reply-To: <20080627123316.8122.15241.stgit@warthog.procyon.org.uk>

On 27-06-08 14:33, David Howells wrote:

> Fix the test pnpacpi_parse_irq_option() makes against PNP_IRQ_NR by sticking
> p->interrupt[i] into an unsigned int and then using it in the three places
> that want it.

Pedantically, a simple unadorned int would be better it seems. The 
#define is an int, __set_bit(_) takes an int and an int is printed.

> This gets rid of the warning:
> 
> drivers/pnp/pnpacpi/rsparser.c:500: warning: comparison is always true due to limited range of data type
> 
> Signed-off-by: David Howells <dhowells@redhat.com>
> ---
> 
>  drivers/pnp/pnpacpi/rsparser.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> 
> diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
> index d2abc87..b0d89eb 100644
> --- a/drivers/pnp/pnpacpi/rsparser.c
> +++ b/drivers/pnp/pnpacpi/rsparser.c
> @@ -497,12 +497,13 @@ static __init void pnpacpi_parse_irq_option(struct pnp_dev *dev,
>  	bitmap_zero(map.bits, PNP_IRQ_NR);
>  	for (i = 0; i < p->interrupt_count; i++) {
>  		if (p->interrupts[i]) {
> -			if (p->interrupts[i] < PNP_IRQ_NR)
> -				__set_bit(p->interrupts[i], map.bits);
> +			unsigned irq = p->interrupts[i];
> +			if (irq  < PNP_IRQ_NR)

Hyper-pedantically, this adds one space too many :-)

> +				__set_bit(irq, map.bits);
>  			else
>  				dev_err(&dev->dev, "ignoring IRQ %d option "
>  					"(too large for %d entry bitmap)\n",
> -					p->interrupts[i], PNP_IRQ_NR);
> +					irq, PNP_IRQ_NR);
>  		}
>  	}
>  

Rene.

  reply	other threads:[~2008-06-27 12:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-27 12:33 [PATCH] Fix pnpacpi_parse_irq_option()'s test against PNP_IRQ_NR David Howells
2008-06-27 12:53 ` Rene Herman [this message]
2008-06-27 13:16 ` David Howells
2008-06-27 13:38   ` Rene Herman
2008-06-27 14:54   ` David Howells
2008-06-27 15:14     ` Bjorn Helgaas
2008-06-27 15:26     ` Rene Herman
2008-06-27 15:38       ` Rene Herman

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=4864E2B1.3040308@keyaccess.nl \
    --to=rene.herman@keyaccess.nl \
    --cc=bjorn.helgaas@hp.com \
    --cc=dhowells@redhat.com \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rene.herman@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).