]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rtc rx4581: change err type from unsigned char to int in get_datetime()
authorTorben Hohn <torbenh@linutronix.de>
Thu, 7 Feb 2013 01:27:49 +0000 (12:27 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Feb 2013 05:47:18 +0000 (16:47 +1100)
in response to these warnings posted by dan.carpenter@oracle.com:

New smatch warnings:
drivers/rtc/rtc-rx4581.c:134 rx4581_get_datetime() warn: unsigned 'err' is never less than zero.

Old smatch warnings:
drivers/rtc/rtc-rx4581.c:175 rx4581_get_datetime() warn: unsigned 'err' is never less than zero.

Signed-off-by: Torben Hohn <torbenh@linutronix.de>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/rtc/rtc-rx4581.c

index 421e08baa17d8b851ab1bccfee0e2e510cc2776c..599ec73ec8869a3304df40da006325e72179bc26 100644 (file)
@@ -103,7 +103,8 @@ static int rx4581_get_datetime(struct device *dev, struct rtc_time *tm)
 {
        struct spi_device *spi = to_spi_device(dev);
        unsigned char date[7];
-       unsigned char data, err;
+       unsigned char data;
+       int err;
 
        /* First we ensure that the "update flag" is not set, we read the
         * time and date then re-read the "update flag". If the update flag