Skip to content
Commit 57f38844 authored by Tom Hughes's avatar Tom Hughes Committed by Benjamin Cabé
Browse files

drivers: mfd: mfd_adp5585: Fix -Wsometimes-uninitialized warning



When building with clang it warns:

drivers/mfd/mfd_adp5585.c:59:6: error: variable 'reg_int_status' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
        if (ret == 0) {
            ^~~~~~~~
drivers/mfd/mfd_adp5585.c:70:7: note: uninitialized use occurs here
        if ((reg_int_status & ADP5585_INT_GPI)
             ^~~~~~~~~~~~~~    && device_is_ready(data->child.gpio_dev)) {
drivers/mfd/mfd_adp5585.c:59:2: note: remove the 'if' if its condition
is always true
        if (ret == 0) {
        ^~~~~~~~~~~~~~
drivers/mfd/mfd_adp5585.c:54:24: note: initialize the variable
'reg_int_status' to silence this warning
        uint8_t reg_int_status;
                              ^
                               = '\0'

Signed-off-by: default avatarTom Hughes <tomhughes@chromium.org>
parent ff2cf4be
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment