All of lore.kernel.org
 help / color / mirror / Atom feed
* [rtc-linux] [PATCH 1/3] rtc: sunxi: fix signedness issues
@ 2015-11-19 10:50 ` LABBE Corentin
  0 siblings, 0 replies; 27+ messages in thread
From: LABBE Corentin @ 2015-11-19 10:50 UTC (permalink / raw)
  To: alexandre.belloni, a.zummo, linux-arm-kernel, maxime.ripard, wens
  Cc: LABBE Corentin, linux-kernel, rtc-linux

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>
---
 drivers/rtc/rtc-sunxi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-sunxi.c b/drivers/rtc/rtc-sunxi.c
index 52543ae..b4f35ac 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)
 	return IRQ_NONE;
 }
 
-static void sunxi_rtc_setaie(int to, struct sunxi_rtc_dev *chip)
+static void sunxi_rtc_setaie(unsigned int to, struct sunxi_rtc_dev *chip)
 {
 	u32 alrm_val = 0;
 	u32 alrm_irq_val = 0;
@@ -343,7 +343,7 @@ static int sunxi_rtc_settime(struct device *dev, struct rtc_time *rtc_tm)
 	struct sunxi_rtc_dev *chip = dev_get_drvdata(dev);
 	u32 date = 0;
 	u32 time = 0;
-	int year;
+	unsigned int year;
 
 	/*
 	 * 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)
 
 	year = rtc_tm->tm_year + 1900;
 	if (year < chip->data_year->min || year > chip->data_year->max) {
-		dev_err(dev, "rtc only supports year in range %d - %d\n",
-				chip->data_year->min, chip->data_year->max);
+		dev_err(dev, "rtc only supports year in range %u - %u\n",
+			chip->data_year->min, chip->data_year->max);
 		return -EINVAL;
 	}
 
-- 
2.4.10

-- 
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

end of thread, other threads:[~2015-11-30 19:05 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-19 10:50 [rtc-linux] [PATCH 1/3] rtc: sunxi: fix signedness issues LABBE Corentin
2015-11-19 10:50 ` LABBE Corentin
2015-11-19 10:50 ` LABBE Corentin
2015-11-19 10:50 ` [rtc-linux] [PATCH 2/3] rtc: sunxi: constify the data_year_param structure LABBE Corentin
2015-11-19 10:50   ` LABBE Corentin
2015-11-19 10:50   ` LABBE Corentin
2015-11-23  7:18   ` [rtc-linux] " Chen-Yu Tsai
2015-11-23  7:18     ` Chen-Yu Tsai
2015-11-23  7:18     ` Chen-Yu Tsai
2015-11-30 19:04   ` [rtc-linux] " Alexandre Belloni
2015-11-30 19:04     ` Alexandre Belloni
2015-11-30 19:04     ` Alexandre Belloni
2015-11-19 10:50 ` [rtc-linux] [PATCH 3/3] rtc: sunxi: use of_device_get_match_data LABBE Corentin
2015-11-19 10:50   ` LABBE Corentin
2015-11-19 10:50   ` LABBE Corentin
2015-11-23  7:18   ` [rtc-linux] " Chen-Yu Tsai
2015-11-23  7:18     ` Chen-Yu Tsai
2015-11-23  7:18     ` Chen-Yu Tsai
2015-11-30 19:05   ` [rtc-linux] " Alexandre Belloni
2015-11-30 19:05     ` Alexandre Belloni
2015-11-30 19:05     ` Alexandre Belloni
2015-11-23  7:18 ` [rtc-linux] Re: [PATCH 1/3] rtc: sunxi: fix signedness issues Chen-Yu Tsai
2015-11-23  7:18   ` Chen-Yu Tsai
2015-11-23  7:18   ` Chen-Yu Tsai
2015-11-30 19:04 ` [rtc-linux] " Alexandre Belloni
2015-11-30 19:04   ` Alexandre Belloni
2015-11-30 19:04   ` Alexandre Belloni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.