From: Grant Grundler <grundler@parisc-linux.org>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: kyle@mcmartin.ca, linux-parisc@vger.kernel.org
Subject: Re: [PATCH] parisc: set_time() catch errors
Date: Wed, 3 Dec 2008 01:12:43 -0700 [thread overview]
Message-ID: <20081203081243.GB32121@colo.lackof.org> (raw)
In-Reply-To: <4935C1B4.5030806@gmail.com>
On Wed, Dec 03, 2008 at 12:16:04AM +0100, Roel Kluin wrote:
> set_rtc_time returns negative on error, ret should be signed to catch those
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Reviewed-by: Grant Grundler <grundler@parisc-linux.org>
> ---
> diff --git a/drivers/rtc/rtc-parisc.c b/drivers/rtc/rtc-parisc.c
> index 346d633..c6bfa6f 100644
> --- a/drivers/rtc/rtc-parisc.c
> +++ b/drivers/rtc/rtc-parisc.c
> @@ -34,7 +34,8 @@ static int parisc_get_time(struct device *dev, struct rtc_time *tm)
> static int parisc_set_time(struct device *dev, struct rtc_time *tm)
> {
> struct parisc_rtc *p = dev_get_drvdata(dev);
> - unsigned long flags, ret;
> + unsigned long flags;
> + int ret;
>
> spin_lock_irqsave(&p->lock, flags);
> ret = set_rtc_time(tm);
Use of unsigned is wrong given the later code in parisc_set_time() does:
if (ret < 0)
return -EOPNOTSUPP;
I expected a compiler "out of range"-like warning.
Someone know why no warning was emitted?
Or was one emitted and we've just ignored it?
thanks,
grant
prev parent reply other threads:[~2008-12-03 8:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-02 23:16 [PATCH] parisc: set_time() catch errors Roel Kluin
2008-12-03 8:12 ` Grant Grundler [this message]
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=20081203081243.GB32121@colo.lackof.org \
--to=grundler@parisc-linux.org \
--cc=kyle@mcmartin.ca \
--cc=linux-parisc@vger.kernel.org \
--cc=roel.kluin@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