[PATCH] hdaps: Shut up gcc uninitialized variable warnings

From: Borislav Petkov
Date: Thu Nov 24 2011 - 09:00:00 EST


Turn off the following triggered with gcc 4.6.1 on Debian testing:

drivers/platform/x86/hdaps.c: In function âhdaps_temp2_showâ:
drivers/platform/x86/hdaps.c:398:16: warning: âtempâ may be used uninitialized in this function [-Wuninitialized]
drivers/platform/x86/hdaps.c: In function âhdaps_temp1_showâ:
drivers/platform/x86/hdaps.c:385:16: warning: âtempâ may be used uninitialized in this function [-Wuninitialized]

Cc: Frank Seidel <frank@xxxxxxxxxxx>
Cc: Matthew Garrett <mjg@xxxxxxxxxx>
Cc: platform-driver-x86@xxxxxxxxxxxxxxx
Signed-off-by: Borislav Petkov <bp@xxxxxxxxx>
---
drivers/platform/x86/hdaps.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/hdaps.c b/drivers/platform/x86/hdaps.c
index 5a34973..2fdacc2 100644
--- a/drivers/platform/x86/hdaps.c
+++ b/drivers/platform/x86/hdaps.c
@@ -375,7 +375,7 @@ static ssize_t hdaps_variance_show(struct device *dev,
static ssize_t hdaps_temp1_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- u8 temp;
+ u8 uninitialized_var(temp);
int ret;

ret = hdaps_readb_one(HDAPS_PORT_TEMP1, &temp);
@@ -388,7 +388,7 @@ static ssize_t hdaps_temp1_show(struct device *dev,
static ssize_t hdaps_temp2_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- u8 temp;
+ u8 uninitialized_var(temp);
int ret;

ret = hdaps_readb_one(HDAPS_PORT_TEMP2, &temp);
--
1.7.8.rc0.35.gee6df

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/