All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 09/56] drivers/rtc/rv3029.c: fix GCC 4.6 build warnings
Date: Sat,  5 Nov 2011 02:55:13 +0100	[thread overview]
Message-ID: <1320458160-23136-10-git-send-email-wd@denx.de> (raw)
In-Reply-To: <1320458160-23136-1-git-send-email-wd@denx.de>

Fix:
rv3029.c: In function 'rtc_set':
rv3029.c:98:6: warning: variable 'ret' set but not used
[-Wunused-but-set-variable]
rv3029.c: In function 'set_eere_bit':
rv3029.c:131:6: warning: variable 'ret' set but not used
[-Wunused-but-set-variable]
rv3029.c: In function 'wait_eebusy':
rv3029.c:149:9: warning: variable 'ret' set but not used
[-Wunused-but-set-variable]
rv3029.c: In function 'rtc_reset':
rv3029.c:165:6: warning: variable 'ret' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 drivers/rtc/rv3029.c |   27 +++++++++++----------------
 1 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/drivers/rtc/rv3029.c b/drivers/rtc/rv3029.c
index e012168..8033695 100644
--- a/drivers/rtc/rv3029.c
+++ b/drivers/rtc/rv3029.c
@@ -84,12 +84,10 @@ int rtc_get( struct rtc_time *tmp )
 	tmp->tm_yday = 0;
 	tmp->tm_isdst = 0;
 
-#ifdef RTC_DEBUG
-	printf( "Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
+	debug( "Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
 		tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
 		tmp->tm_hour, tmp->tm_min, tmp->tm_sec );
 
-#endif
 	return 0;
 }
 
@@ -97,11 +95,10 @@ int rtc_set( struct rtc_time *tmp )
 {
 	int	ret;
 	unsigned char buf[RTC_RV3029_PAGE_LEN];
-#ifdef RTC_DEBUG
-	printf( "Set DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
+
+	debug( "Set DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
 		tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
 		tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
-#endif
 
 	if (tmp->tm_year < 2000) {
 		printf("RTC: year %d < 2000 not possible\n", tmp->tm_year);
@@ -122,16 +119,15 @@ int rtc_set( struct rtc_time *tmp )
 
 	/* give the RTC some time to update */
 	udelay(1000);
-	return 0;
+	return ret;
 }
 
 /* sets EERE-Bit  (automatic EEPROM refresh) */
 static void set_eere_bit(int state)
 {
-	int ret;
 	unsigned char reg_ctrl1;
 
-	ret = i2c_read(CONFIG_SYS_I2C_RTC_ADDR, RTC_RV3029_CTRL1, 1,
+	(void)i2c_read(CONFIG_SYS_I2C_RTC_ADDR, RTC_RV3029_CTRL1, 1,
 			&reg_ctrl1, 1);
 
 	if (state)
@@ -139,18 +135,18 @@ static void set_eere_bit(int state)
 	else
 		reg_ctrl1 &= (~RTC_RV3029_CTRL1_EERE);
 
-	ret = i2c_write(CONFIG_SYS_I2C_RTC_ADDR, RTC_RV3029_CTRL1, 1,
+	(void)i2c_write(CONFIG_SYS_I2C_RTC_ADDR, RTC_RV3029_CTRL1, 1,
 		&reg_ctrl1, 1);
 }
 
 /* waits until EEPROM page is no longer busy (times out after 10ms*loops) */
 static int wait_eebusy(int loops)
 {
-	int i, ret;
+	int i;
 	unsigned char ctrl_status;
 
 	for (i = 0; i < loops; i++) {
-		ret = i2c_read(CONFIG_SYS_I2C_RTC_ADDR, RTC_RV3029_CTRL_STATUS,
+		(void)i2c_read(CONFIG_SYS_I2C_RTC_ADDR, RTC_RV3029_CTRL_STATUS,
 			1, &ctrl_status, 1);
 
 		if ((ctrl_status & RTC_RV3029_CTRLS_EEBUSY) == 0)
@@ -162,11 +158,10 @@ static int wait_eebusy(int loops)
 
 void rtc_reset (void)
 {
-	int	ret;
 	unsigned char buf[RTC_RV3029_PAGE_LEN];
 
 	buf[0] = RTC_RV3029_CTRL_SYS_R;
-	ret = i2c_write(CONFIG_SYS_I2C_RTC_ADDR, RTC_RV3029_CTRL_RESET, 1,
+	(void)i2c_write(CONFIG_SYS_I2C_RTC_ADDR, RTC_RV3029_CTRL_RESET, 1,
 			buf, 1);
 
 #if defined(CONFIG_SYS_RV3029_TCR)
@@ -178,7 +173,7 @@ void rtc_reset (void)
 	set_eere_bit(0);
 	wait_eebusy(100);
 	/* read current trickle charger setting */
-	ret = i2c_read(CONFIG_SYS_I2C_RTC_ADDR, RTC_RV3029_EEPROM_CTRL,
+	(void)i2c_read(CONFIG_SYS_I2C_RTC_ADDR, RTC_RV3029_EEPROM_CTRL,
 			1, buf, 1);
 	/* enable automatic EEPROM refresh again */
 	set_eere_bit(1);
@@ -195,7 +190,7 @@ void rtc_reset (void)
 		 */
 		set_eere_bit(0);
 		wait_eebusy(100);
-		ret = i2c_write(CONFIG_SYS_I2C_RTC_ADDR,
+		(void)i2c_write(CONFIG_SYS_I2C_RTC_ADDR,
 				RTC_RV3029_EEPROM_CTRL, 1, buf, 1);
 		/*
 		 * it is necessary to wait 10ms before EEBUSY-Bit may be read
-- 
1.7.6.4

  parent reply	other threads:[~2011-11-05  1:55 UTC|newest]

Thread overview: 163+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-05  1:55 [U-Boot] [PATCH 00/56] [PPC] Fix GCC 4.6 build warnings Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 01/56] board/mpl/common/flash.c: fix GCC 4.6 build warning Wolfgang Denk
2011-11-07 21:09   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 02/56] arch/powerpc/cpu/mpc5xxx/i2c.c: fix GC 4.6 build warnings Wolfgang Denk
2011-11-07 21:09   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 03/56] arch/powerpc/lib/board.c: make (mostly) checkpatch-clean Wolfgang Denk
2011-11-07 21:09   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 04/56] arch/powerpc/lib/board.c: fix build warning Wolfgang Denk
2011-11-07 21:09   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 05/56] board/tqc/tqm5200/cmd_stk52xx.c: fix GC 4.6 build warnings Wolfgang Denk
2011-11-07 21:10   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 06/56] arch/powerpc/cpu/mpc5xxx/usb_ohci.c: fix GCC " Wolfgang Denk
2011-11-07 21:10   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 07/56] board/mcc200/auto_update.c: fixx " Wolfgang Denk
2011-11-07 21:10   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 08/56] drivers/rtc/ds3231.c: fix " Wolfgang Denk
2011-11-07 21:10   ` Wolfgang Denk
2011-11-05  1:55 ` Wolfgang Denk [this message]
2011-11-07 21:10   ` [U-Boot] [PATCH 09/56] drivers/rtc/rv3029.c: " Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 10/56] drivers/video/videomodes.c: fix GCC 4.6 build warning Wolfgang Denk
2011-11-06 19:44   ` Anatolij Gustschin
2011-11-07 21:10   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 11/56] fs/fat/fat.c: Fix " Wolfgang Denk
2011-11-07 21:11   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 12/56] PM520: add missing enable_interrupts() Wolfgang Denk
2011-11-07 21:11   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 13/56] board/esd/cpci5200/strataflash.c: Fix GCC 4.6 build warning Wolfgang Denk
2011-11-07 21:11   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 14/56] board/esd/pf5200/pf5200.c: " Wolfgang Denk
2011-11-07 21:11   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 15/56] board/tqc/tqm5200/cam5200_flash.c: " Wolfgang Denk
2011-11-07 21:11   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 16/56] drivers/video/cfb_console.c:Fix " Wolfgang Denk
2011-11-06 19:31   ` Anatolij Gustschin
2011-11-07 21:11   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 17/56] mpc8xx/fec.c: Fix GCC 4.6 build warnings Wolfgang Denk
2011-11-07 21:12   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 18/56] drivers/pcmcia/mpc8xx_pcmcia.c: Fix GCC 4.6 build warning Wolfgang Denk
2011-11-07 21:12   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 19/56] board/c2mon/pcmcia.c: " Wolfgang Denk
2011-11-07 21:12   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 20/56] board/icu862/pcmcia.c: " Wolfgang Denk
2011-11-07 21:12   ` Wolfgang Denk
2011-11-07 21:12   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 21/56] board/kup/common/pcmcia.c: Fix GCC 4.6 compiler warnings Wolfgang Denk
2011-11-07 21:12   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 22/56] board/lwmon/pcmcia.c: Fix GCC 4.6 build warnings Wolfgang Denk
2011-11-07 21:12   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 23/56] board/manroland/uc100/pcmcia.c: " Wolfgang Denk
2011-11-07 21:12   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 24/56] board/mbx8xx/pcmcia.c: " Wolfgang Denk
2011-11-07 21:13   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 25/56] board/netta/codec.c: " Wolfgang Denk
2011-11-07 21:13   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 26/56] board/netta/pcmcia.c: " Wolfgang Denk
2011-11-07 21:13   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 27/56] board/r360mpi/pcmcia.c: " Wolfgang Denk
2011-11-07 21:13   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 28/56] mpc8xx/cpu.c: " Wolfgang Denk
2011-11-07 21:13   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 29/56] ICU862: Fix incorrect flash handling Wolfgang Denk
2011-11-07 21:13   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 30/56] board/kup/kup4k/kup4k.c: Fix GCC 4.6 build warning Wolfgang Denk
2011-11-07 21:13   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 31/56] board/eltec/mhpc/flash.c: " Wolfgang Denk
2011-11-07 21:14   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 32/56] mpc8xx/i2c.c: CodungStyle cleanup Wolfgang Denk
2011-11-07 21:14   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 33/56] mpc8xx/i2c.c: replace PRINTD() by debug() Wolfgang Denk
2011-11-07 21:14   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 34/56] board/etx094/flash.c: CodingStyle cleanup Wolfgang Denk
2011-11-07 21:14   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 35/56] board/etx094/flash.c: Fix flash initialization Wolfgang Denk
2011-11-07 21:14   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 36/56] board/genietv/flash.c: CodingStyle cleanup Wolfgang Denk
2011-11-07 21:14   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 37/56] board/genietv/flash.c: Fix flash initialization Wolfgang Denk
2011-11-07 21:14   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 38/56] net/net.c: Fix GCC 4.6 build warning Wolfgang Denk
2011-11-07 21:14   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 39/56] mpc8xx/spi.c: Fix GCC 4.6 build warnings Wolfgang Denk
2011-11-07 21:15   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 40/56] board/mbx8xx/mbx8xx.c: " Wolfgang Denk
2011-11-07 21:15   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 41/56] board/fads/fads.c: Fix GCC 4.6 build warning Wolfgang Denk
2011-11-07 21:15   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 42/56] board/rbc823/flash.c: CodingStyle cleanup Wolfgang Denk
2011-11-07 21:15   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 43/56] board/rbc823/flash.c: Fix flash initalization Wolfgang Denk
2011-11-07 21:15   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 44/56] board/svm_sc8xx/svm_sc8xx.c: Fix GCC 4.6 build warning Wolfgang Denk
2011-11-07 21:15   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 45/56] board/svm_sc8xx/flash.c: CodingStyle cleanup Wolfgang Denk
2011-11-07 21:15   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 46/56] board/svm_sc8xx/flash.c: Fix GCC 4.6 build warning Wolfgang Denk
2011-11-07 21:15   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 47/56] TQM850M: Add missing CONFIG_BOOTDELAY Wolfgang Denk
2011-11-07 21:16   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 48/56] mpc8260/speed.c: Fix GCC 4.6 build warnings Wolfgang Denk
2011-11-07 21:16   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 49/56] board/tqc/tqm8272/tqm8272.c: Fix GCC 4.6 build warning: Wolfgang Denk
2011-11-07 21:16   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 50/56] common/cmd_i2c.c: Fix GCC 4.6 build warning Wolfgang Denk
2011-11-07 21:16   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 51/56] mpc8220/fec.c: " Wolfgang Denk
2011-11-07 21:16   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 52/56] mpc8260/i2c.c: CodingStyle cleanup Wolfgang Denk
2011-11-07 21:17   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 53/56] mpc8260/i2c.c: replace PRINTD() by debug() Wolfgang Denk
2011-11-07 21:17   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 54/56] mpc8220/i2c.c: Fix GCC 4.6 build warning Wolfgang Denk
2011-11-07 21:17   ` Wolfgang Denk
2011-11-05  1:55 ` [U-Boot] [PATCH 55/56] arch/powerpc/lib/bat_rw.c: " Wolfgang Denk
2011-11-07 21:17   ` Wolfgang Denk
2011-11-05  1:56 ` [U-Boot] [PATCH 56/56] board/alaska/flash.c: Fix GCC 4.6 build warnings Wolfgang Denk
2011-11-07 21:17   ` Wolfgang Denk
2011-11-05 15:12 ` [U-Boot] [PATCH 00/22] Fix GCC 4.6 build warnings (Part 2) Wolfgang Denk
2011-11-05 15:12   ` [U-Boot] [PATCH 01/22] drivers/net/pcnet.c: Change debug code to fix build warning Wolfgang Denk
2011-11-07 21:18     ` Wolfgang Denk
2011-11-05 15:12   ` [U-Boot] [PATCH 02/22] board/etin/kvme080/multiverse.c: Fix GCC 4.6 " Wolfgang Denk
2011-11-07 21:18     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 03/22] board/mousse/flash.c: Fix GCC 4.6 buil warnings Wolfgang Denk
2011-11-07 21:18     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 04/22] drivers/net/rtl8169.c: Fix GCC 4.6 build warning Wolfgang Denk
2011-11-07 21:18     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 05/22] board/linkstation/ide.c: Fix GCC 4.6 build warnings Wolfgang Denk
2011-11-06 17:46     ` Guennadi Liakhovetski
2011-11-07 21:47       ` Wolfgang Denk
2011-11-07 21:47     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 06/22] drivers/net/rtl8139.c: " Wolfgang Denk
2011-11-07 21:47     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 07/22] common/cmd_flash.c: " Wolfgang Denk
2011-11-07 21:47     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 08/22] arch/powerpc/cpu/mpc8260/spi.c: " Wolfgang Denk
2011-11-07 21:48     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 09/22] board/cogent/flash.c: Fix GCC 4.6 buiild warning Wolfgang Denk
2011-11-07 21:48     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 10/22] board/gw8260/flash.c: minimal CodingStyle cleanup Wolfgang Denk
2011-11-07 21:48     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 11/22] board/gw8260/flash.c: Fix GCC 4.6 build warning Wolfgang Denk
2011-11-07 21:48     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 12/22] board/ep82xxm/ep82xxm.c: " Wolfgang Denk
2011-11-07 21:48     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 13/22] board/hymod/input.c: " Wolfgang Denk
2011-11-07 21:48     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 14/22] board/ids8247/ids8247.c: " Wolfgang Denk
2011-11-07 21:48     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 15/22] board/rpxsuper/flash.c: minimal CodingStyle cleanup Wolfgang Denk
2011-11-07 21:48     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 16/22] board/rpxsuper/flash.c: Fix GCC 4.6 build warning Wolfgang Denk
2011-11-07 21:48     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 17/22] board/sacsng/sacsng.c: CodingStyle cleanup Wolfgang Denk
2011-11-07 21:49     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 18/22] board/sacsng/sacsng.c: Fix GCC 4.6 build warning Wolfgang Denk
2011-11-07 21:49     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 19/22] board/freescale/mpc8266ads/mpc8266ads.c: CodingStyle cleanup Wolfgang Denk
2011-11-07 21:49     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 20/22] board/freescale/mpc8266ads/mpc8266ads.c: Fix GCC 4.6 build warning Wolfgang Denk
2011-11-07 21:49     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 21/22] board/funkwerk/vovpn-gw/vovpn-gw.c: " Wolfgang Denk
2011-11-07 21:49     ` Wolfgang Denk
2011-11-05 15:13   ` [U-Boot] [PATCH 22/22] board/siemens/SCM/scm.c: " Wolfgang Denk
2011-11-07 21:50     ` Wolfgang Denk

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=1320458160-23136-10-git-send-email-wd@denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 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.