Skip to contentSkip to conversation

/dev/mem: Mark expected switch fall-through

PATCH New Gustavo A. R. Silva 1 participant 1 message Jul 2, 2018 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 /dev/mem: Mark expected switch fall-through

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

---
 drivers/char/mem.c | 1 +
 1 file changed, 1 insertion(+)
drivers/char/mem.c +1 -0
index ffeb60d..4b00d6a 100644
@@ -765,6 +765,7 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
 	switch (orig) {
 	case SEEK_CUR:
 		offset += file->f_pos;
+		/* fall through */
 	case SEEK_SET:
 		/* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */
 		if ((unsigned long long)offset >= -MAX_ERRNO) {
Signature · 1 line
2.7.4