From: Dan Carpenter <error27@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: bug report: signedness issue in ds3232_update_alarm()
Date: Thu, 28 Oct 2010 08:55:22 +0000 [thread overview]
Message-ID: <20101028085522.GA6062@bicker> (raw)
In-Reply-To: <20101028083503.GZ6062@bicker>
Jack's email <jack.lan@freescale.com> is dead. B25806, could you take
a look?
regards,
dan carpenter
On Thu, Oct 28, 2010 at 10:35:03AM +0200, Dan Carpenter wrote:
> 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
next prev parent reply other threads:[~2010-10-28 8:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-28 8:35 bug report: signedness issue in ds3232_update_alarm() Dan Carpenter
2010-10-28 8:55 ` Dan Carpenter [this message]
2010-10-28 10:15 ` Lan Chunhe-B25806
2010-10-28 10:58 ` Dan Carpenter
2010-10-28 11:17 ` Lan Chunhe-B25806
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=20101028085522.GA6062@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