Skip to contentSkip to conversation

ataflop: Mark expected switch fall-through

PATCH Applied Gustavo A. R. Silva 2 participants 2 messages Jul 29, 2019 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ataflop: Mark expected switch fall-through

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: m68k):

drivers/block/ataflop.c: In function ‘fd_locked_ioctl’:
drivers/block/ataflop.c:1728:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
set_capacity(floppy->disk, MAX_DISK_SIZE * 2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/ataflop.c:1729:2: note: here
case FDFMTEND:
^~~~

---
 drivers/block/ataflop.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/ataflop.c +1 -0
index 85f20e371f2f..bd7d3bb8b890 100644
@@ -1726,6 +1726,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode,
 		/* MSch: invalidate default_params */
 		default_params[drive].blocks  = 0;
 		set_capacity(floppy->disk, MAX_DISK_SIZE * 2);
+		/* Fall through */
 	case FDFMTEND:
 	case FDFLUSH:
 		/* invalidate the buffer track to force a reread */
Signature · 1 line
2.22.0
maintainer Applied
#1 lore raw
Quoted 11 lines · Gustavo A. R. Silva

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: m68k):

drivers/block/ataflop.c: In function ‘fd_locked_ioctl’:
drivers/block/ataflop.c:1728:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

    set_capacity(floppy->disk, MAX_DISK_SIZE * 2);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/ataflop.c:1729:2: note: here
   case FDFMTEND:
   ^~~~

Applied, thanks.

Signature · 1 line
Jens Axboe