aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLABBE Corentin <clabbe.montjoie@gmail.com>2015-11-19 05:50:08 -0500
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2016-01-11 14:19:56 -0500
commitf8947feb2c0196dafa7683f557eb8dddfb1ae167 (patch)
tree0d4c298450ccf52b02ad1b11b7436d1767462f0c
parent3fc2c14acaf925768db37cf439c628bfa71dff09 (diff)
rtc: sunxi: fix signedness issues
The variable year must be set as unsigned since it is used with sunxi_rtc_data_year{.min|.max} and as parameter of is_leap_year() which wait for unsigned int. Only tm_year is not unsigned, but it is long. This patch fix also the format of printing of min/max. (must use %u since they are unsigned) The parameter to of sunxi_rtc_setaie() must be set to uint since callers give always uint data. Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
-rw-r--r--drivers/rtc/rtc-sunxi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-sunxi.c b/drivers/rtc/rtc-sunxi.c
index 52543ae37c98..b4f35acc1e12 100644
--- a/drivers/rtc/rtc-sunxi.c
+++ b/drivers/rtc/rtc-sunxi.c
@@ -175,7 +175,7 @@ static irqreturn_t sunxi_rtc_alarmirq(int irq, void *id)
175 return IRQ_NONE; 175 return IRQ_NONE;
176} 176}
177 177
178static void sunxi_rtc_setaie(int to, struct sunxi_rtc_dev *chip) 178static void sunxi_rtc_setaie(unsigned int to, struct sunxi_rtc_dev *chip)
179{ 179{
180 u32 alrm_val = 0; 180 u32 alrm_val = 0;
181 u32 alrm_irq_val = 0; 181 u32 alrm_irq_val = 0;
@@ -343,7 +343,7 @@ static int sunxi_rtc_settime(struct device *dev, struct rtc_time *rtc_tm)
343 struct sunxi_rtc_dev *chip = dev_get_drvdata(dev); 343 struct sunxi_rtc_dev *chip = dev_get_drvdata(dev);
344 u32 date = 0; 344 u32 date = 0;
345 u32 time = 0; 345 u32 time = 0;
346 int year; 346 unsigned int year;
347 347
348 /* 348 /*
349 * the input rtc_tm->tm_year is the offset relative to 1900. We use 349 * the input rtc_tm->tm_year is the offset relative to 1900. We use
@@ -353,8 +353,8 @@ static int sunxi_rtc_settime(struct device *dev, struct rtc_time *rtc_tm)
353 353
354 year = rtc_tm->tm_year + 1900; 354 year = rtc_tm->tm_year + 1900;
355 if (year < chip->data_year->min || year > chip->data_year->max) { 355 if (year < chip->data_year->min || year > chip->data_year->max) {
356 dev_err(dev, "rtc only supports year in range %d - %d\n", 356 dev_err(dev, "rtc only supports year in range %u - %u\n",
357 chip->data_year->min, chip->data_year->max); 357 chip->data_year->min, chip->data_year->max);
358 return -EINVAL; 358 return -EINVAL;
359 } 359 }
360 360