sensor: lis2dh: Fix gcc8 compiler warning
We get the following warning with sdk-ng: drivers/sensor/lis2dh/lis2dh.c:210:38: error: bitwise comparison always evaluates to false [-Werror=tautological-compare] if ((value & LIS2DH_LP_EN_BIT_MASK) == 1 && ... ^~ The test needs to be: (value & LIS2DH_LP_EN_BIT_MASK) == LIS2DH_LP_EN_BIT_MASK Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
62704a52ed
commit
8de6778e90
1 changed files with 2 additions and 1 deletions
|
@ -207,7 +207,8 @@ static int lis2dh_acc_odr_set(struct device *dev, u16_t freq)
|
|||
}
|
||||
|
||||
/* adjust odr index for LP enabled mode, see table above */
|
||||
if ((value & LIS2DH_LP_EN_BIT_MASK) == 1 && (odr == LIS2DH_ODR_9 + 1)) {
|
||||
if (((value & LIS2DH_LP_EN_BIT_MASK) == LIS2DH_LP_EN_BIT_MASK) &&
|
||||
(odr == LIS2DH_ODR_9 + 1)) {
|
||||
odr--;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue