RE: question about

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for your good catch. We needn't this checking at here. Now I format this patch.

Best Regards
Haojian

-----Original Message-----
From: Dan Carpenter [mailto:error27@xxxxxxxxx] 
Sent: 2010年5月28日 7:46 PM
To: Haojian Zhuang
Cc: kernel-janitors@xxxxxxxxxxxxxxx
Subject: question about

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

Attachment: 0001-leds-remove-redundant-checking.patch
Description: 0001-leds-remove-redundant-checking.patch


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux