public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: question about
Date: Fri, 28 May 2010 11:46:08 +0000	[thread overview]
Message-ID: <20100528114608.GX22515@bicker> (raw)

Hi,

I was going through some Smatch stuff and it complains about something
in drivers/leds/leds-88pm860x.c  Could you take a look at it?  I'm not
sure what was intended there.

drivers/leds/leds-88pm860x.c +228 __check_device(6) warn: unsigned 'p->flags' is never less than zero.
   222  static int __check_device(struct pm860x_led_pdata *pdata, char *name)
   223  {
   224          struct pm860x_led_pdata *p = pdata;
   225          int ret = -EINVAL;
   226
   227          while (p && p->id) {
   228                  if ((p->id != PM8606_ID_LED) || (p->flags < 0))
                                                         ^^^^^^^^^^^^

	p->flags is an unsigned int so this condition is never true.

   229                          break;
   230
   231                  if (!strncmp(name, pm860x_led_name[p->flags],
   232                          MFD_NAME_SIZE)) {
   233                          ret = (int)p->flags;
   234                          break;
   235                  }
   236                  p++;
   237          }
   238          return ret;
   239  }

regards,
dan carpenter

             reply	other threads:[~2010-05-28 11:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-28 11:46 Dan Carpenter [this message]
2010-05-28 13:42 ` question about Haojian Zhuang

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=20100528114608.GX22515@bicker \
    --to=error27@gmail.com \
    --cc=kernel-janitors@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