From 3bf2ff6749f0f87d719bf8f67eccecfde742f2b3 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 25 Aug 2017 13:46:29 -0700 Subject: scsi: Suppress gcc 7 fall-through warnings reported with W=1 The conclusion of a recent discussion about the new warnings reported by gcc 7 is that the new warnings reported when building with W=1 should be suppressed. However, gcc 7 still warns about fall-through in switch statements when building with W=1. Suppress these warnings by annotating the SCSI core properly. See also Linus Torvalds, Lots of new warnings with gcc-7.1.1, 11 July 2017 (https://www.mail-archive.com/linux-media@vger.kernel.org/msg115428.html). References: commit bd664f6b3e37 ("disable new gcc-7.1.1 warnings for now") Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Cc: Hannes Reinecke Cc: Johannes Thumshirn Signed-off-by: Martin K. Petersen --- drivers/scsi/scsi_ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/scsi/scsi_ioctl.c') diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index b6bf3f2..0a87549 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c @@ -116,13 +116,15 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd, case NOT_READY: /* This happens if there is no disc in drive */ if (sdev->removable) break; + /* FALLTHROUGH */ case UNIT_ATTENTION: if (sdev->removable) { sdev->changed = 1; result = 0; /* This is no longer considered an error */ break; } - default: /* Fall through for non-removable media */ + /* FALLTHROUGH -- for non-removable media */ + default: sdev_printk(KERN_INFO, sdev, "ioctl_internal_command return code = %x\n", result); -- cgit v1.1