Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Gustavo A. R. Silva and committed by
Jonathan Cameron
c65a0d84 5c93f3ce

+2 -2
+2 -2
drivers/iio/dac/dpot-dac.c
··· 74 74 case IIO_VAL_INT: 75 75 /* 76 76 * Convert integer scale to fractional scale by 77 - * setting the denominator (val2) to one... 77 + * setting the denominator (val2) to one, and... 78 78 */ 79 79 *val2 = 1; 80 80 ret = IIO_VAL_FRACTIONAL; 81 - /* ...and fall through. */ 81 + /* fall through */ 82 82 case IIO_VAL_FRACTIONAL: 83 83 *val *= regulator_get_voltage(dac->vref) / 1000; 84 84 *val2 *= dac->max_ohms;