linux-stable/drivers/staging
Arnd Bergmann 64bc2d02d7 iio: accel: sca3000_core: avoid potentially uninitialized variable
The newly added __sca3000_get_base_freq function handles all valid
modes of the SCA3000_REG_ADDR_MODE register, but gcc notices
that any other value (i.e. 0x00) causes the base_freq variable to
not get initialized:

drivers/staging/iio/accel/sca3000_core.c: In function 'sca3000_write_raw':
drivers/staging/iio/accel/sca3000_core.c:527:23: error: 'base_freq' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This adds explicit error handling for unexpected register values,
to ensure this cannot happen.

Fixes: e0f3fc9b47 ("iio: accel: sca3000_core: implemented IIO_CHAN_INFO_SAMP_FREQ")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Ico Doornekamp <ico@pruts.nl>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-10-23 22:18:45 +01:00
..
android staging: ion: Align cases with switch 2016-09-25 12:37:14 +02:00
board
clocking-wizard
comedi staging: comedi: Use vma_pages function on vma object instead of explicit computation 2016-09-20 14:01:21 +02:00
dgnc staging: dgnc: Fix comment alignment 2016-09-25 19:27:04 +02:00
emxx_udc staging: emxx_udc: add braces to if-else block 2016-09-16 10:10:34 +02:00
fbtft Staging: fbtft: Use !x instead of x == NULL. 2016-09-18 12:38:27 +02:00
fsl-mc Staging: fsl-mc: Use !x instead of x == NULL. 2016-09-20 13:52:51 +02:00
fwserial staging: fwserial: fix checkpatch permission warnings 2016-09-13 15:44:46 +02:00
gdm724x staging: gdm724x: Remove unnecessary blank line 2016-09-16 10:10:34 +02:00
goldfish
greybus staging: greybus: Use setup_timer function 2016-09-23 19:00:43 +02:00
gs_fpgaboot staging: gs_fpgaboot: Remove FSF address from GPL notice 2016-09-16 10:10:34 +02:00
i4l staging: i4l: act2000: Move assignment out of if statement 2016-09-20 13:46:32 +02:00
iio iio: accel: sca3000_core: avoid potentially uninitialized variable 2016-10-23 22:18:45 +01:00
ks7010 staging: ks7010: ks_wlan_net: Remove return statement from void function 2016-09-25 12:37:14 +02:00
lustre staging: lustre: ldlm: Fix extern variable declaration 2016-09-25 12:42:35 +02:00
media staging: media: cxd2099: replace printk with dev_info 2016-09-20 13:59:45 +02:00
most staging: most: aim-cdev: make syscall write accept buffers of arbitrary size 2016-09-23 19:00:44 +02:00
mt29f_spinand
netlogic Staging: netlogic: Remove unused function 2016-09-16 10:10:34 +02:00
nvec
octeon Staging: octeon: Add missing of_node_put after calling of_parse_phandle. 2016-09-20 13:51:24 +02:00
octeon-usb staging: octeon-usb: Remove unnecessary assignment 2016-09-22 11:54:48 +02:00
olpc_dcon Revert "staging: olpc_dcon: Replace a bit shift by a use of BIT." 2016-09-18 13:09:50 +02:00
rtl8188eu staging: rtl8188eu: core: rtw_security: Remove return statement from void function 2016-09-25 12:42:35 +02:00
rtl8192e staging: rtl8192e: Insert blank line after function declaration 2016-09-20 13:36:57 +02:00
rtl8192u staging: rtl8192u: remove unused functions in r8192U_core.c 2016-09-23 19:00:44 +02:00
rtl8712 Staging: rtl8712: rtl871x_cmd: Use !x instead of x == NULL. 2016-09-20 13:38:00 +02:00
rts5208 staging: rts5208: fix style warnings in xd.c 2016-09-25 12:40:30 +02:00
skein
slicoss staging: slicoss: Move NULL test closer to assignment 2016-09-22 11:54:48 +02:00
sm750fb staging: sm750fb: Remove unnecessary parentheses 2016-09-22 11:54:48 +02:00
speakup Staging: speakup: kobjects: Add space around the operator. 2016-09-22 12:01:14 +02:00
unisys staging: unisys: include: remove unused ULTRA_CHANNELCLI_STRING 2016-09-21 12:06:20 +02:00
vme drivers: staging: vme: convert to octal notation for permission bits 2016-09-17 23:36:53 +02:00
vt6655 Staging: vt6655: baseband: Remove unnecessary space after a cast 2016-09-20 13:59:46 +02:00
vt6656
wilc1000 staging: wilc1000: Merge assignment with return 2016-09-20 13:32:28 +02:00
wlan-ng staging: wlan-ng: fix block comments style errors 2016-09-25 19:54:45 +02:00
xgifb staging: xgifb: Remove unused variable and if statement 2016-09-22 11:54:47 +02:00
Kconfig Merge branch 'greybus' into staging-testing 2016-09-19 19:34:33 +02:00
Makefile Merge branch 'greybus' into staging-testing 2016-09-19 19:34:33 +02:00