Commit 70171ed6 authored by Aashish Sharma's avatar Aashish Sharma Committed by Jonathan Cameron

iio:proximity:sx9324: Check ret value of device_property_read_u32_array()

0-day reports:

drivers/iio/proximity/sx9324.c:868:3: warning: Value stored
to 'ret' is never read [clang-analyzer-deadcode.DeadStores]

Put an if condition to break out of switch if ret is non-zero.
Signed-off-by: default avatarAashish Sharma <shraash@google.com>
Fixes: a8ee3b32 ("iio:proximity:sx9324: Add dt_binding support")
Reported-by: default avatarkernel test robot <lkp@intel.com>
[swboyd@chromium.org: Reword commit subject, add fixes tag]
Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
Reviewed-by: default avatarGwendal Grignou <gwendal@chromium.org>
Link: https://lore.kernel.org/r/20220613232224.2466278-1-swboyd@chromium.org
Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent bf745142
...@@ -885,6 +885,9 @@ sx9324_get_default_reg(struct device *dev, int idx, ...@@ -885,6 +885,9 @@ sx9324_get_default_reg(struct device *dev, int idx,
break; break;
ret = device_property_read_u32_array(dev, prop, pin_defs, ret = device_property_read_u32_array(dev, prop, pin_defs,
ARRAY_SIZE(pin_defs)); ARRAY_SIZE(pin_defs));
if (ret)
break;
for (pin = 0; pin < SX9324_NUM_PINS; pin++) for (pin = 0; pin < SX9324_NUM_PINS; pin++)
raw |= (pin_defs[pin] << (2 * pin)) & raw |= (pin_defs[pin] << (2 * pin)) &
SX9324_REG_AFE_PH0_PIN_MASK(pin); SX9324_REG_AFE_PH0_PIN_MASK(pin);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment