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:
Tao Huang
2019-10-15 18:01:36 +08:00
parent 8959d2a951
commit 6664bfef49

View File

@@ -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;