From: Aashish Sharma shraash@google.com
commit 70171ed6dc53d2f580166d47f5b66cf51a6d0092 upstream.
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: Aashish Sharma shraash@google.com Fixes: a8ee3b32f5da ("iio:proximity:sx9324: Add dt_binding support") Reported-by: kernel test robot lkp@intel.com [swboyd@chromium.org: Reword commit subject, add fixes tag] Signed-off-by: Stephen Boyd swboyd@chromium.org Reviewed-by: Gwendal Grignou gwendal@chromium.org Link: https://lore.kernel.org/r/20220613232224.2466278-1-swboyd@chromium.org Cc: Stable@vger.kernel.org Signed-off-by: Jonathan Cameron Jonathan.Cameron@huawei.com Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- drivers/iio/proximity/sx9324.c | 3 +++ 1 file changed, 3 insertions(+)
--- a/drivers/iio/proximity/sx9324.c +++ b/drivers/iio/proximity/sx9324.c @@ -885,6 +885,9 @@ sx9324_get_default_reg(struct device *de break; ret = device_property_read_u32_array(dev, prop, pin_defs, ARRAY_SIZE(pin_defs)); + if (ret) + break; + for (pin = 0; pin < SX9324_NUM_PINS; pin++) raw |= (pin_defs[pin] << (2 * pin)) & SX9324_REG_AFE_PH0_PIN_MASK(pin);