From 6664bfef490ae5645bd0f470adbdcbcdb9f016a2 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 15 Oct 2019 18:01:36 +0800 Subject: [PATCH] input: sensors: mc3230: fix gcc warning drivers/input/sensors/accel/mc3230.c: In function 'sensor_report_value': drivers/input/sensors/accel/mc3230.c:602:4: warning: 'result' may be used uninitialized in this function [-Wmaybe-uninitialized] x = mc3230_convert_to_int(buffer[0]) * g_value; ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/input/sensors/accel/mc3230.c:521:6: note: 'result' was declared here int result; ^~~~~~ Change-Id: I817bbd56a2a194388bde705cbfa350f8d33b6efa Signed-off-by: Tao Huang --- drivers/input/sensors/accel/mc3230.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/sensors/accel/mc3230.c b/drivers/input/sensors/accel/mc3230.c index 0a0fed4ee67c..fdd4a1fcfa62 100644 --- a/drivers/input/sensors/accel/mc3230.c +++ b/drivers/input/sensors/accel/mc3230.c @@ -518,7 +518,7 @@ static int mc3230_start(struct i2c_client *client, char rate) static inline int mc3230_convert_to_int(s16 value) { - int result; + int result = 0; if ((mc32x0_type == IS_MC3230) || (mc32x0_type == IS_MC2234)) { result = value * 192;