Skip to contentSkip to conversation

iio: sca3000: Mark expected switch fall-through

PATCH In review Gustavo A. R. Silva 2 participants 3 messages Jul 3, 2018 – Jul 7, 2018 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: sca3000: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

---
 drivers/iio/accel/sca3000.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/accel/sca3000.c +1 -0
index 4dceb75..209b52a 100644
@@ -797,6 +797,7 @@ static int sca3000_write_raw(struct iio_dev *indio_dev,
 		mutex_lock(&st->lock);
 		ret = sca3000_write_3db_freq(st, val);
 		mutex_unlock(&st->lock);
+		/* fall through */
 	default:
 		return -EINVAL;
 	}
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 4 lines · On Tue, 3 Jul 2018 14:39:34 -0500 "Gustavo A. R. Silva"…

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Looks like a bug to me not an unmarked fall through.

Should be return ret;

Do you want to do the patch?

Thanks,

Jonathan

Quoted 16 lines
---
 drivers/iio/accel/sca3000.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/accel/sca3000.c +1 -0
index 4dceb75..209b52a 100644
@@ -797,6 +797,7 @@ static int sca3000_write_raw(struct iio_dev *indio_dev,
 		mutex_lock(&st->lock);
 		ret = sca3000_write_3db_freq(st, val);
 		mutex_unlock(&st->lock);
+		/* fall through */
 	default:
 		return -EINVAL;
 	}
#2 lore raw

Hi Jonathan,

Quoted 12 lines · Jonathan Cameron
Quoted 4 lines · On Tue, 3 Jul 2018 14:39:34 -0500 "Gustavo A. R. Silva"…

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Looks like a bug to me not an unmarked fall through.

Should be return ret;

I see.

Quoted 2 lines

Do you want to do the patch?

Sure thing. I'll send a patch shortly.

Thanks for the feedback.
--
Gustavo