Patchwork [U-Boot,12/12] drivers/rtc/s3c24x0_rtc.c: fix GCC 4.6 warnings

login
register
mail settings
Submitter Anatolij Gustschin
Date Nov. 15, 2011, 11:21 p.m.
Message ID <1321399263-13826-13-git-send-email-agust@denx.de>
Download mbox | patch
Permalink /patch/125893/
State Accepted
Commit f45e91c4457ce81f867d50f6492d374098ce4f07
Headers show

Comments

Anatolij Gustschin - Nov. 15, 2011, 11:21 p.m.
Fix:
s3c24x0_rtc.c: In function 'rtc_get':
s3c24x0_rtc.c:67:53: warning: variable 'a_armed' set but not used
s3c24x0_rtc.c:67:45: warning: variable 'a_year' set but not used
s3c24x0_rtc.c:67:38: warning: variable 'a_mon' set but not used
s3c24x0_rtc.c:67:30: warning: variable 'a_date' set but not used
s3c24x0_rtc.c:67:22: warning: variable 'a_hour' set but not used
s3c24x0_rtc.c:67:15: warning: variable 'a_min' set but not used
s3c24x0_rtc.c:67:8: warning: variable 'a_sec' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 drivers/rtc/s3c24x0_rtc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Wolfgang Denk - Nov. 16, 2011, 8:37 p.m.
Dear Anatolij Gustschin,

In message <1321399263-13826-13-git-send-email-agust@denx.de> you wrote:
> Fix:
> s3c24x0_rtc.c: In function 'rtc_get':
> s3c24x0_rtc.c:67:53: warning: variable 'a_armed' set but not used
> s3c24x0_rtc.c:67:45: warning: variable 'a_year' set but not used
> s3c24x0_rtc.c:67:38: warning: variable 'a_mon' set but not used
> s3c24x0_rtc.c:67:30: warning: variable 'a_date' set but not used
> s3c24x0_rtc.c:67:22: warning: variable 'a_hour' set but not used
> s3c24x0_rtc.c:67:15: warning: variable 'a_min' set but not used
> s3c24x0_rtc.c:67:8: warning: variable 'a_sec' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
>  drivers/rtc/s3c24x0_rtc.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/drivers/rtc/s3c24x0_rtc.c b/drivers/rtc/s3c24x0_rtc.c
index 9667939..c16ff2e 100644
--- a/drivers/rtc/s3c24x0_rtc.c
+++ b/drivers/rtc/s3c24x0_rtc.c
@@ -34,8 +34,7 @@ 
 
 #include <rtc.h>
 #include <asm/io.h>
-
-/*#define	DEBUG*/
+#include <linux/compiler.h>
 
 typedef enum {
 	RTC_ENABLE,
@@ -64,7 +63,8 @@  int rtc_get(struct rtc_time *tmp)
 {
 	struct s3c24x0_rtc *rtc = s3c24x0_get_base_rtc();
 	uchar sec, min, hour, mday, wday, mon, year;
-	uchar a_sec, a_min, a_hour, a_date, a_mon, a_year, a_armed;
+	__maybe_unused uchar a_sec, a_min, a_hour, a_date,
+			     a_mon, a_year, a_armed;
 
 	/* enable access to RTC registers */
 	SetRTC_Access(RTC_ENABLE);