mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
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 <huangtao@rock-chips.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user