forked from luck/tmp_suning_uos_patched
iio: dpot-dac: mark expected switch fall-through with text GCC expects.
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case, I replaced "...and fall through." with the specific string "fall through", which is what GCC is expecting to find thus supressing this false positive. As Peter has observed this breaks the nice English flow, which is less than ideal, but short of teaching GCC to read English, there isn't a lot that we can do about it. Addresses-Coverity-ID: 1462408 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
5c93f3ce98
commit
c65a0d84ee
|
@ -74,11 +74,11 @@ static int dpot_dac_read_raw(struct iio_dev *indio_dev,
|
||||||
case IIO_VAL_INT:
|
case IIO_VAL_INT:
|
||||||
/*
|
/*
|
||||||
* Convert integer scale to fractional scale by
|
* Convert integer scale to fractional scale by
|
||||||
* setting the denominator (val2) to one...
|
* setting the denominator (val2) to one, and...
|
||||||
*/
|
*/
|
||||||
*val2 = 1;
|
*val2 = 1;
|
||||||
ret = IIO_VAL_FRACTIONAL;
|
ret = IIO_VAL_FRACTIONAL;
|
||||||
/* ...and fall through. */
|
/* fall through */
|
||||||
case IIO_VAL_FRACTIONAL:
|
case IIO_VAL_FRACTIONAL:
|
||||||
*val *= regulator_get_voltage(dac->vref) / 1000;
|
*val *= regulator_get_voltage(dac->vref) / 1000;
|
||||||
*val2 *= dac->max_ohms;
|
*val2 *= dac->max_ohms;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user