mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
input: sensors: gyro: fix clang warning
drivers/input/sensors/gyro/l3g4200d.c:175:21: warning: address of array 'pdata->orientation' will always evaluate to 'true' [-Wpointer-bool-conversion]
if(pdata && pdata->orientation)
~~ ~~~~~~~^~~~~~~~~~~
drivers/input/sensors/gyro/l3g20d.c:175:21: warning: address of array 'pdata->orientation' will always evaluate to 'true' [-Wpointer-bool-conversion]
if(pdata && pdata->orientation)
~~ ~~~~~~~^~~~~~~~~~~
drivers/input/sensors/gyro/ewtsa.c:386:21: warning: address of array 'pdata->orientation' will always evaluate to 'true' [-Wpointer-bool-conversion]
if(pdata && pdata->orientation)
~~ ~~~~~~~^~~~~~~~~~~
Change-Id: Ic4f9f33ac1654711434a9ab383da02bfade5ab13
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This commit is contained in:
@@ -383,7 +383,7 @@ static int sensor_report_value(struct i2c_client *client)
|
||||
z = (short) (((buffer[4]) << 8) | buffer[5]);
|
||||
|
||||
//printk("%s: x=%d y=%d z=%d \n",__func__, x,y,z);
|
||||
if(pdata && pdata->orientation)
|
||||
if (pdata)
|
||||
{
|
||||
axis.x = (pdata->orientation[0])*x + (pdata->orientation[1])*y + (pdata->orientation[2])*z;
|
||||
axis.y = (pdata->orientation[3])*x + (pdata->orientation[4])*y + (pdata->orientation[5])*z;
|
||||
|
||||
@@ -172,7 +172,7 @@ static int sensor_report_value(struct i2c_client *client)
|
||||
z = (short) (((buffer[5]) << 8) | buffer[4]);
|
||||
|
||||
DBG("%s: x=%d y=%d z=%d \n",__func__, x,y,z);
|
||||
if(pdata && pdata->orientation)
|
||||
if (pdata)
|
||||
{
|
||||
axis.x = (pdata->orientation[0])*x + (pdata->orientation[1])*y + (pdata->orientation[2])*z;
|
||||
axis.y = (pdata->orientation[3])*x + (pdata->orientation[4])*y + (pdata->orientation[5])*z;
|
||||
|
||||
@@ -172,7 +172,7 @@ static int sensor_report_value(struct i2c_client *client)
|
||||
z = (short) (((buffer[5]) << 8) | buffer[4]);
|
||||
|
||||
DBG("%s: x=%d y=%d z=%d \n",__func__, x,y,z);
|
||||
if(pdata && pdata->orientation)
|
||||
if (pdata)
|
||||
{
|
||||
axis.x = (pdata->orientation[0])*x + (pdata->orientation[1])*y + (pdata->orientation[2])*z;
|
||||
axis.y = (pdata->orientation[3])*x + (pdata->orientation[4])*y + (pdata->orientation[5])*z;
|
||||
|
||||
Reference in New Issue
Block a user