public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* bug report: signedness issue in ds3232_update_alarm()
@ 2010-10-28  8:35 Dan Carpenter
  2010-10-28  8:55 ` Dan Carpenter
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Dan Carpenter @ 2010-10-28  8:35 UTC (permalink / raw)
  To: kernel-janitors

Hi Jack,

This code was added in f46418c5cadf "drivers/rtc/rtc-ds3232.c: add alarm
function".  Smatch complains because bcd2bin() returns an unsigned so
it's never less than zero and the whole block is a no-op.  I'm not sure
what was intended here, could you take a look?

drivers/rtc/rtc-ds3232.c +292 ds3232_update_alarm(13)
	warn: unsigned 'bcd2bin(buf[0])' is never less than zero.
   291
   292          buf[0] = bcd2bin(buf[0]) < 0 || (ds3232->rtc->irq_data & RTC_UF) ?
   293									0x80 : buf[0];
   294          buf[1] = bcd2bin(buf[1]) < 0 || (ds3232->rtc->irq_data & RTC_UF) ?
   295									0x80 : buf[1];
   296          buf[2] = bcd2bin(buf[2]) < 0 || (ds3232->rtc->irq_data & RTC_UF) ?
   297									0x80 : buf[2];
   298          buf[3] = bcd2bin(buf[3]) < 0 || (ds3232->rtc->irq_data & RTC_UF) ?
   299									0x80 : buf[3];
   300

regards,
dan carpenter

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

end of thread, other threads:[~2010-10-28 11:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-28  8:35 bug report: signedness issue in ds3232_update_alarm() Dan Carpenter
2010-10-28  8:55 ` Dan Carpenter
2010-10-28 10:15 ` Lan Chunhe-B25806
2010-10-28 10:58 ` Dan Carpenter
2010-10-28 11:17 ` Lan Chunhe-B25806

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox