Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4b52b88 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'Wimplicit-fallthrough-5.2-rc1' of...

Merge tag 'Wimplicit-fallthrough-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux

Pull Wimplicit-fallthrough updates from Gustavo A. R. Silva:
 "Mark switch cases where we are expecting to fall through.

  This is part of the ongoing efforts to enable -Wimplicit-fallthrough.

  Most of them have been baking in linux-next for a whole development
  cycle. And with Stephen Rothwell's help, we've had linux-next
  nag-emails going out for newly introduced code that triggers
  -Wimplicit-fallthrough to avoid gaining more of these cases while we
  work to remove the ones that are already present.

  We are getting close to completing this work. Currently, there are
  only 32 of 2311 of these cases left to be addressed in linux-next. I'm
  auditing every case; I take a look into the code and analyze it in
  order to determine if I'm dealing with an actual bug or a false
  positive, as explained here:

      https://lore.kernel.org/lkml/c2fad584-1705-a5f2-d63c-824e9b96cf50@embeddedor.com/

  While working on this, I've found and fixed the several missing
  break/return bugs, some of them introduced more than 5 years ago.

  Once this work is finished, we'll be able to universally enable
  "-Wimplicit-fallthrough" to avoid any of these kinds of bugs from
  entering the kernel again"

* tag 'Wimplicit-fallthrough-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux: (27 commits)
  memstick: mark expected switch fall-throughs
  drm/nouveau/nvkm: mark expected switch fall-throughs
  NFC: st21nfca: Fix fall-through warnings
  NFC: pn533: mark expected switch fall-throughs
  block: Mark expected switch fall-throughs
  ASN.1: mark expected switch fall-through
  lib/cmdline.c: mark expected switch fall-throughs
  lib: zstd: Mark expected switch fall-throughs
  scsi: sym53c8xx_2: sym_nvram: Mark expected switch fall-through
  scsi: sym53c8xx_2: sym_hipd: mark expected switch fall-throughs
  scsi: ppa: mark expected switch fall-through
  scsi: osst: mark expected switch fall-throughs
  scsi: lpfc: lpfc_scsi: Mark expected switch fall-throughs
  scsi: lpfc: lpfc_nvme: Mark expected switch fall-through
  scsi: lpfc: lpfc_nportdisc: Mark expected switch fall-through
  scsi: lpfc: lpfc_hbadisc: Mark expected switch fall-throughs
  scsi: lpfc: lpfc_els: Mark expected switch fall-throughs
  scsi: lpfc: lpfc_ct: Mark expected switch fall-throughs
  scsi: imm: mark expected switch fall-throughs
  scsi: csiostor: csio_wr: mark expected switch fall-through
  ...
parents 2d60d96b ccaa7518
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1778,7 +1778,7 @@ static inline void __drbd_chk_io_error_(struct drbd_device *device,
				_drbd_set_state(_NS(device, disk, D_INCONSISTENT), CS_HARD, NULL);
			break;
		}
		/* NOTE fall through for DRBD_META_IO_ERROR or DRBD_FORCE_DETACH */
		/* fall through - for DRBD_META_IO_ERROR or DRBD_FORCE_DETACH */
	case EP_DETACH:
	case EP_CALL_HELPER:
		/* Remember whether we saw a READ or WRITE error.
+2 −2
Original line number Diff line number Diff line
@@ -3094,7 +3094,7 @@ static int drbd_asb_recover_0p(struct drbd_peer_device *peer_device) __must_hold
			rv =  1;
			break;
		}
		/* Else fall through to one of the other strategies... */
		/* Else fall through - to one of the other strategies... */
	case ASB_DISCARD_OLDER_PRI:
		if (self == 0 && peer == 1) {
			rv = 1;
@@ -3119,7 +3119,7 @@ static int drbd_asb_recover_0p(struct drbd_peer_device *peer_device) __must_hold
		}
		if (after_sb_0p == ASB_DISCARD_ZERO_CHG)
			break;
		/* else: fall through */
		/* else, fall through */
	case ASB_DISCARD_LEAST_CHG:
		if	(ch_self < ch_peer)
			rv = -1;
+1 −1
Original line number Diff line number Diff line
@@ -866,7 +866,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
			} /* else: FIXME can this happen? */
			break;
		}
		/* else, fall through to BARRIER_ACKED */
		/* else, fall through - to BARRIER_ACKED */

	case BARRIER_ACKED:
		/* barrier ack for READ requests does not make sense */
+1 −0
Original line number Diff line number Diff line
@@ -439,6 +439,7 @@ static void card_state_change(struct rsxx_cardinfo *card,
		 * Fall through so the DMA devices can be attached and
		 * the user can attempt to pull off their data.
		 */
		/* fall through */
	case CARD_STATE_GOOD:
		st = rsxx_get_card_size8(card, &card->size8);
		if (st)
+17 −0
Original line number Diff line number Diff line
@@ -23,38 +23,55 @@ void pack_hdmi_infoframe(struct packed_hdmi_infoframe *packed_frame,
		 */
	case 17:
		subpack1_high = (raw_frame[16] << 16);
		/* fall through */
	case 16:
		subpack1_high |= (raw_frame[15] << 8);
		/* fall through */
	case 15:
		subpack1_high |= raw_frame[14];
		/* fall through */
	case 14:
		subpack1_low = (raw_frame[13] << 24);
		/* fall through */
	case 13:
		subpack1_low |= (raw_frame[12] << 16);
		/* fall through */
	case 12:
		subpack1_low |= (raw_frame[11] << 8);
		/* fall through */
	case 11:
		subpack1_low |= raw_frame[10];
		/* fall through */
	case 10:
		subpack0_high = (raw_frame[9] << 16);
		/* fall through */
	case 9:
		subpack0_high |= (raw_frame[8] << 8);
		/* fall through */
	case 8:
		subpack0_high |= raw_frame[7];
		/* fall through */
	case 7:
		subpack0_low = (raw_frame[6] << 24);
		/* fall through */
	case 6:
		subpack0_low |= (raw_frame[5] << 16);
		/* fall through */
	case 5:
		subpack0_low |= (raw_frame[4] << 8);
		/* fall through */
	case 4:
		subpack0_low |= raw_frame[3];
		/* fall through */
	case 3:
		header = (raw_frame[2] << 16);
		/* fall through */
	case 2:
		header |= (raw_frame[1] << 8);
		/* fall through */
	case 1:
		header |= raw_frame[0];
		/* fall through */
	case 0:
		break;
	}
Loading