Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 22ed1a1c authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Jonathan Cameron
Browse files

iio: as3935: improve error reporting in as3935_event_work



gcc warns about a potentially uninitialized variable use
in as3935_event_work:

drivers/iio/proximity/as3935.c: In function ‘as3935_event_work’:
drivers/iio/proximity/as3935.c:231:6: error: ‘val’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

This case specifically happens when spi_w8r8() fails with a
negative return code. We check all other users of this function
except this one.

As the error is rather unlikely to happen after the device
has already been initialized, this just adds a dev_warn().
Another warning already exists in the same function, but is
missing a trailing '\n' character, so I'm fixing that too.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarMatt Ranostay <mranostay@gmail.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent aea7b1dc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment