Static analysis with CoverityScan is throwing warnings that specific
case statements are missing breaks. Rather than adding breaks, add
return -EINVAL to the specific case statements to clarify the
error return paths. Fix also saves 50 bytes.
Before:
text data bss dec hex filename
21418 4936 128 26482 6772 drivers/iio/adc/ina2xx-adc.o
After:
dec hex filename
21370 4936 128 26434 6742 drivers/iio/adc/ina2xx-adc.o
(gcc 8.2, x86-64)
Detected by CoverityScan, CID#
1462408 ("Missing break in switch")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Stefan BrĂ¼ns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
*val2 = chip->shunt_resistor_uohm;
return IIO_VAL_FRACTIONAL;
}
+ return -EINVAL;
case IIO_CHAN_INFO_HARDWAREGAIN:
switch (chan->address) {
*val = chip->range_vbus == 32 ? 1 : 2;
return IIO_VAL_INT;
}
+ return -EINVAL;
}
return -EINVAL;