[PATCH 4/8]drivers:tmp.c Fix warning: variable 'rc' set but not used

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Justin P. Mattock
Date: Monday, June 14, 2010 - 1:26 pm

Im getting this warning when compiling:
 CC      drivers/char/tpm/tpm.o
drivers/char/tpm/tpm.c: In function 'tpm_gen_interrupt':
drivers/char/tpm/tpm.c:508:10: warning: variable 'rc' set but not used

The below patch gets rid of the warning,
but I'm not sure if it's the best solution.

 Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>

---
 drivers/char/tpm/tpm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 05ad4a1..3d685dc 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -514,6 +514,8 @@ void tpm_gen_interrupt(struct tpm_chip *chip)
 
 	rc = transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE,
 			"attempting to determine the timeouts");
+	if (!rc)
+		rc = 0;
 }
 EXPORT_SYMBOL_GPL(tpm_gen_interrupt);
 
-- 
1.7.1.rc1.21.gf3bd6

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/8] Fix gcc 4.6.0 set but not used warning messages. , Justin P. Mattock, (Mon Jun 14, 1:26 pm)
[PATCH 1/8]reiserfs:stree.c Fix variable set but not used., Justin P. Mattock, (Mon Jun 14, 1:26 pm)
[PATCH 2/8]bluetooth/hci_ldisc.c Fix warning: variable 'tt ..., Justin P. Mattock, (Mon Jun 14, 1:26 pm)
[PATCH 3/8]char/hpet.c Fix variable 'hpet' set but not used, Justin P. Mattock, (Mon Jun 14, 1:26 pm)
[PATCH 4/8]drivers:tmp.c Fix warning: variable 'rc' set bu ..., Justin P. Mattock, (Mon Jun 14, 1:26 pm)
[PATCH 5/8]drm:drm_gem Fix warning: variable 'dev' set bu ..., Justin P. Mattock, (Mon Jun 14, 1:26 pm)
[PATCH 6/8]i2c:i2c_core Fix warning: variable 'dummy' set ..., Justin P. Mattock, (Mon Jun 14, 1:26 pm)
[PATCH 7/8]ieee1394/sdp2 Fix warning: variable 'unit_chara ..., Justin P. Mattock, (Mon Jun 14, 1:26 pm)
[PATCH 8/8]tuners:tuner-simple Fix warning: variable 'tun' ..., Justin P. Mattock, (Mon Jun 14, 1:26 pm)
Re: [PATCH 6/8]i2c:i2c_core Fix warning: variable 'dummy' ..., Justin P. Mattock, (Mon Jun 14, 2:06 pm)
Re: [PATCH 1/8]reiserfs:stree.c Fix variable set but not used., Justin P. Mattock, (Mon Jun 14, 2:09 pm)
Re: [PATCH 1/8]reiserfs:stree.c Fix variable set but not used., Justin P. Mattock, (Mon Jun 14, 2:21 pm)
[PATCH] ieee1394: sbp2: remove unused code, Stefan Richter, (Mon Jun 14, 2:44 pm)
Re: [PATCH] ieee1394: sbp2: remove unused code, Justin P. Mattock, (Mon Jun 14, 3:35 pm)
[No subject], Stefan Richter, (Mon Jun 14, 4:22 pm)
Re:, Justin P. Mattock, (Mon Jun 14, 4:58 pm)
[PATCH] ieee1394: remove unused variables, Stefan Richter, (Mon Jun 14, 5:00 pm)
Re: [PATCH] ieee1394: sbp2: remove unused code, Stefan Richter, (Mon Jun 14, 5:05 pm)
Re: (no subject), Stefan Richter, (Mon Jun 14, 5:08 pm)
Re: [PATCH] ieee1394: sbp2: remove unused code, Justin P. Mattock, (Mon Jun 14, 6:59 pm)
Re: [PATCH 4/8]drivers:tmp.c Fix warning: variable 'rc' se ..., Justin P. Mattock, (Mon Jun 14, 7:12 pm)
Re: [PATCH 4/8]drivers:tmp.c Fix warning: variable 'rc' se ..., Justin P. Mattock, (Mon Jun 14, 8:56 pm)
Re: [PATCH 8/8]tuners:tuner-simple Fix warning: variable ' ..., Mauro Carvalho Chehab, (Mon Jun 14, 10:16 pm)
Re: [PATCH 8/8]tuners:tuner-simple Fix warning: variable ' ..., Justin P. Mattock, (Mon Jun 14, 10:37 pm)
Re: [PATCH 8/8]tuners:tuner-simple Fix warning: variable ' ..., Justin P. Mattock, (Mon Jun 14, 10:50 pm)
Re: [PATCH 4/8]drivers:tmp.c Fix warning: variable 'rc' se ..., Justin P. Mattock, (Mon Jun 14, 10:58 pm)
Re: [PATCH 4/8]drivers:tmp.c Fix warning: variable 'rc' se ..., Justin P. Mattock, (Tue Jun 15, 12:27 am)
Re: [PATCH 4/8]drivers:tmp.c Fix warning: variable 'rc' se ..., Justin P. Mattock, (Tue Jun 15, 1:30 am)
Re: [PATCH 4/8]drivers:tmp.c Fix warning: variable 'rc' se ..., Justin P. Mattock, (Tue Jun 15, 2:41 am)
Re: [PATCH 6/8]i2c:i2c_core Fix warning: variable 'dummy' ..., Justin P. Mattock, (Tue Jun 15, 9:51 am)
Re: [PATCH 7/8]ieee1394/sdp2 Fix warning: variable 'unit_c ..., Justin P. Mattock, (Tue Jun 15, 9:52 am)
Re: [PATCH 4/8]drivers:tmp.c Fix warning: variable 'rc' se ..., Justin P. Mattock, (Tue Jun 15, 12:36 pm)