mirror of
https://github.com/armbian/linux-cix.git
synced 2026-01-06 12:30:45 -08:00
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
...
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -122,6 +122,7 @@ nv04_dmaobj_new(struct nvkm_dma *dma, const struct nvkm_oclass *oclass,
|
||||
break;
|
||||
case NV_MEM_ACCESS_WO:
|
||||
dmaobj->flags0 |= 0x00008000;
|
||||
/* fall through */
|
||||
case NV_MEM_ACCESS_RW:
|
||||
dmaobj->flags2 |= 0x00000002;
|
||||
break;
|
||||
|
||||
@@ -117,8 +117,10 @@ nv04_fifo_swmthd(struct nvkm_device *device, u32 chid, u32 addr, u32 data)
|
||||
switch (mthd) {
|
||||
case 0x0000 ... 0x0000: /* subchannel's engine -> software */
|
||||
nvkm_wr32(device, 0x003280, (engine &= ~mask));
|
||||
/* fall through */
|
||||
case 0x0180 ... 0x01fc: /* handle -> instance */
|
||||
data = nvkm_rd32(device, 0x003258) & 0x0000ffff;
|
||||
/* fall through */
|
||||
case 0x0100 ... 0x017c:
|
||||
case 0x0200 ... 0x1ffc: /* pass method down to sw */
|
||||
if (!(engine & mask) && sw)
|
||||
|
||||
@@ -81,6 +81,7 @@ nv40_fifo_init(struct nvkm_fifo *base)
|
||||
case 0x49:
|
||||
case 0x4b:
|
||||
nvkm_wr32(device, 0x002230, 0x00000001);
|
||||
/* fall through */
|
||||
case 0x40:
|
||||
case 0x41:
|
||||
case 0x42:
|
||||
|
||||
@@ -135,6 +135,7 @@ nvbios_perfEp(struct nvkm_bios *bios, int idx,
|
||||
break;
|
||||
case 0x30:
|
||||
info->script = nvbios_rd16(bios, perf + 0x02);
|
||||
/* fall through */
|
||||
case 0x35:
|
||||
info->fanspeed = nvbios_rd08(bios, perf + 0x06);
|
||||
info->voltage = nvbios_rd08(bios, perf + 0x07);
|
||||
|
||||
@@ -134,6 +134,7 @@ pll_map(struct nvkm_bios *bios)
|
||||
device->chipset == 0xaa ||
|
||||
device->chipset == 0xac)
|
||||
return g84_pll_mapping;
|
||||
/* fall through */
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ nvkm_cstate_valid(struct nvkm_clk *clk, struct nvkm_cstate *cstate,
|
||||
case NVKM_CLK_BOOST_NONE:
|
||||
if (clk->base_khz && freq > clk->base_khz)
|
||||
return false;
|
||||
/* fall through */
|
||||
case NVKM_CLK_BOOST_BIOS:
|
||||
if (clk->boost_khz && freq > clk->boost_khz)
|
||||
return false;
|
||||
|
||||
@@ -363,6 +363,7 @@ mcp77_clk_prog(struct nvkm_clk *base)
|
||||
switch (clk->vsrc) {
|
||||
case nv_clk_src_cclk:
|
||||
mast |= 0x00400000;
|
||||
/* fall through */
|
||||
default:
|
||||
nvkm_wr32(device, 0x4600, clk->vdiv);
|
||||
}
|
||||
|
||||
@@ -131,11 +131,13 @@ nv40_ram_prog(struct nvkm_ram *base)
|
||||
nvkm_mask(device, 0x00402c, 0xc0771100, ram->ctrl);
|
||||
nvkm_wr32(device, 0x004048, ram->coef);
|
||||
nvkm_wr32(device, 0x004030, ram->coef);
|
||||
/* fall through */
|
||||
case 0x43:
|
||||
case 0x49:
|
||||
case 0x4b:
|
||||
nvkm_mask(device, 0x004038, 0xc0771100, ram->ctrl);
|
||||
nvkm_wr32(device, 0x00403c, ram->coef);
|
||||
/* fall through */
|
||||
default:
|
||||
nvkm_mask(device, 0x004020, 0xc0771100, ram->ctrl);
|
||||
nvkm_wr32(device, 0x004024, ram->coef);
|
||||
|
||||
@@ -159,6 +159,7 @@ mxm_dcb_sanitise_entry(struct nvkm_bios *bios, void *data, int idx, u16 pdcb)
|
||||
break;
|
||||
case 0x0e: /* eDP, falls through to DPint */
|
||||
ctx.outp[1] |= 0x00010000;
|
||||
/* fall through */
|
||||
case 0x07: /* DP internal, wtf is this?? HP8670w */
|
||||
ctx.outp[1] |= 0x00000004; /* use_power_scripts? */
|
||||
type = DCB_CONNECTOR_eDP;
|
||||
|
||||
@@ -259,9 +259,11 @@ static unsigned int jmb38x_ms_write_data(struct jmb38x_ms_host *host,
|
||||
case 3:
|
||||
host->io_word[0] |= buf[off + 2] << 16;
|
||||
host->io_pos++;
|
||||
/* fall through */
|
||||
case 2:
|
||||
host->io_word[0] |= buf[off + 1] << 8;
|
||||
host->io_pos++;
|
||||
/* fall through */
|
||||
case 1:
|
||||
host->io_word[0] |= buf[off];
|
||||
host->io_pos++;
|
||||
|
||||
@@ -166,9 +166,11 @@ static unsigned int tifm_ms_write_data(struct tifm_ms *host,
|
||||
case 3:
|
||||
host->io_word |= buf[off + 2] << 16;
|
||||
host->io_pos++;
|
||||
/* fall through */
|
||||
case 2:
|
||||
host->io_word |= buf[off + 1] << 8;
|
||||
host->io_pos++;
|
||||
/* fall through */
|
||||
case 1:
|
||||
host->io_word |= buf[off];
|
||||
host->io_pos++;
|
||||
|
||||
@@ -2147,6 +2147,7 @@ static int pn533_transceive(struct nfc_dev *nfc_dev,
|
||||
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
default:
|
||||
/* jumbo frame ? */
|
||||
if (skb->len > PN533_CMD_DATAEXCH_DATA_MAXLEN) {
|
||||
@@ -2273,6 +2274,7 @@ static void pn533_wq_mi_recv(struct work_struct *work)
|
||||
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
default:
|
||||
skb_put_u8(skb, 1); /*TG*/
|
||||
|
||||
|
||||
@@ -400,6 +400,7 @@ static int st21nfca_tm_event_send_data(struct nfc_hci_dev *hdev,
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
@@ -619,6 +620,7 @@ static void st21nfca_im_recv_dep_res_cb(void *context, struct sk_buff *skb,
|
||||
switch (ST21NFCA_NFC_DEP_PFB_TYPE(dep_res->pfb)) {
|
||||
case ST21NFCA_NFC_DEP_PFB_ACK_NACK_PDU:
|
||||
pr_err("Received a ACK/NACK PDU\n");
|
||||
/* fall through */
|
||||
case ST21NFCA_NFC_DEP_PFB_I_PDU:
|
||||
info->dep_info.curr_nfc_dep_pni =
|
||||
ST21NFCA_NFC_DEP_PFB_PNI(dep_res->pfb + 1);
|
||||
|
||||
@@ -4920,24 +4920,30 @@ ahc_fini_scbdata(struct ahc_softc *ahc)
|
||||
}
|
||||
ahc_dma_tag_destroy(ahc, scb_data->sg_dmat);
|
||||
}
|
||||
/* fall through */
|
||||
case 6:
|
||||
ahc_dmamap_unload(ahc, scb_data->sense_dmat,
|
||||
scb_data->sense_dmamap);
|
||||
/* fall through */
|
||||
case 5:
|
||||
ahc_dmamem_free(ahc, scb_data->sense_dmat, scb_data->sense,
|
||||
scb_data->sense_dmamap);
|
||||
ahc_dmamap_destroy(ahc, scb_data->sense_dmat,
|
||||
scb_data->sense_dmamap);
|
||||
/* fall through */
|
||||
case 4:
|
||||
ahc_dma_tag_destroy(ahc, scb_data->sense_dmat);
|
||||
/* fall through */
|
||||
case 3:
|
||||
ahc_dmamap_unload(ahc, scb_data->hscb_dmat,
|
||||
scb_data->hscb_dmamap);
|
||||
/* fall through */
|
||||
case 2:
|
||||
ahc_dmamem_free(ahc, scb_data->hscb_dmat, scb_data->hscbs,
|
||||
scb_data->hscb_dmamap);
|
||||
ahc_dmamap_destroy(ahc, scb_data->hscb_dmat,
|
||||
scb_data->hscb_dmamap);
|
||||
/* fall through */
|
||||
case 1:
|
||||
ahc_dma_tag_destroy(ahc, scb_data->hscb_dmat);
|
||||
break;
|
||||
@@ -6002,8 +6008,8 @@ ahc_search_qinfifo(struct ahc_softc *ahc, int target, char channel,
|
||||
if ((scb->flags & SCB_ACTIVE) == 0)
|
||||
printk("Inactive SCB in Waiting List\n");
|
||||
ahc_done(ahc, scb);
|
||||
/* FALLTHROUGH */
|
||||
}
|
||||
/* fall through */
|
||||
case SEARCH_REMOVE:
|
||||
next = ahc_rem_wscb(ahc, next, prev);
|
||||
break;
|
||||
@@ -7008,8 +7014,8 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, uint8_t *dconsts)
|
||||
}
|
||||
address -= address_offset;
|
||||
fmt3_ins->address = address;
|
||||
/* FALLTHROUGH */
|
||||
}
|
||||
/* fall through */
|
||||
case AIC_OP_OR:
|
||||
case AIC_OP_AND:
|
||||
case AIC_OP_XOR:
|
||||
@@ -7035,7 +7041,7 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, uint8_t *dconsts)
|
||||
fmt1_ins->opcode = AIC_OP_AND;
|
||||
fmt1_ins->immediate = 0xff;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
/* fall through */
|
||||
case AIC_OP_ROL:
|
||||
if ((ahc->features & AHC_ULTRA2) != 0) {
|
||||
int i, count;
|
||||
|
||||
@@ -679,6 +679,7 @@ int beiscsi_set_param(struct iscsi_cls_conn *cls_conn,
|
||||
case ISCSI_PARAM_MAX_XMIT_DLENGTH:
|
||||
if (conn->max_xmit_dlength > 65536)
|
||||
conn->max_xmit_dlength = 65536;
|
||||
/* fall through */
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user