Skip to content

Commit 322b38c

Browse files
drm/nouveau/nvkm: mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch aims to suppress 29 missing-break-in-switch false positives. Addresses-Coverity-ID: 1456891 ("Missing break in switch") Addresses-Coverity-ID: 1324063 ("Missing break in switch") Addresses-Coverity-ID: 1324063 ("Missing break in switch") Addresses-Coverity-ID: 141432 ("Missing break in switch") Addresses-Coverity-ID: 141433 ("Missing break in switch") Addresses-Coverity-ID: 141434 ("Missing break in switch") Addresses-Coverity-ID: 141435 ("Missing break in switch") Addresses-Coverity-ID: 141436 ("Missing break in switch") Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
1 parent a01bcfd commit 322b38c

10 files changed

Lines changed: 28 additions & 0 deletions

File tree

‎drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.c‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,38 +23,55 @@ void pack_hdmi_infoframe(struct packed_hdmi_infoframe *packed_frame,
2323
*/
2424
case 17:
2525
subpack1_high = (raw_frame[16] << 16);
26+
/* fall through */
2627
case 16:
2728
subpack1_high |= (raw_frame[15] << 8);
29+
/* fall through */
2830
case 15:
2931
subpack1_high |= raw_frame[14];
32+
/* fall through */
3033
case 14:
3134
subpack1_low = (raw_frame[13] << 24);
35+
/* fall through */
3236
case 13:
3337
subpack1_low |= (raw_frame[12] << 16);
38+
/* fall through */
3439
case 12:
3540
subpack1_low |= (raw_frame[11] << 8);
41+
/* fall through */
3642
case 11:
3743
subpack1_low |= raw_frame[10];
44+
/* fall through */
3845
case 10:
3946
subpack0_high = (raw_frame[9] << 16);
47+
/* fall through */
4048
case 9:
4149
subpack0_high |= (raw_frame[8] << 8);
50+
/* fall through */
4251
case 8:
4352
subpack0_high |= raw_frame[7];
53+
/* fall through */
4454
case 7:
4555
subpack0_low = (raw_frame[6] << 24);
56+
/* fall through */
4657
case 6:
4758
subpack0_low |= (raw_frame[5] << 16);
59+
/* fall through */
4860
case 5:
4961
subpack0_low |= (raw_frame[4] << 8);
62+
/* fall through */
5063
case 4:
5164
subpack0_low |= raw_frame[3];
65+
/* fall through */
5266
case 3:
5367
header = (raw_frame[2] << 16);
68+
/* fall through */
5469
case 2:
5570
header |= (raw_frame[1] << 8);
71+
/* fall through */
5672
case 1:
5773
header |= raw_frame[0];
74+
/* fall through */
5875
case 0:
5976
break;
6077
}

‎drivers/gpu/drm/nouveau/nvkm/engine/dma/usernv04.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ nv04_dmaobj_new(struct nvkm_dma *dma, const struct nvkm_oclass *oclass,
122122
break;
123123
case NV_MEM_ACCESS_WO:
124124
dmaobj->flags0 |= 0x00008000;
125+
/* fall through */
125126
case NV_MEM_ACCESS_RW:
126127
dmaobj->flags2 |= 0x00000002;
127128
break;

‎drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ nv04_fifo_swmthd(struct nvkm_device *device, u32 chid, u32 addr, u32 data)
117117
switch (mthd) {
118118
case 0x0000 ... 0x0000: /* subchannel's engine -> software */
119119
nvkm_wr32(device, 0x003280, (engine &= ~mask));
120+
/* fall through */
120121
case 0x0180 ... 0x01fc: /* handle -> instance */
121122
data = nvkm_rd32(device, 0x003258) & 0x0000ffff;
123+
/* fall through */
122124
case 0x0100 ... 0x017c:
123125
case 0x0200 ... 0x1ffc: /* pass method down to sw */
124126
if (!(engine & mask) && sw)

‎drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv40.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ nv40_fifo_init(struct nvkm_fifo *base)
8181
case 0x49:
8282
case 0x4b:
8383
nvkm_wr32(device, 0x002230, 0x00000001);
84+
/* fall through */
8485
case 0x40:
8586
case 0x41:
8687
case 0x42:

‎drivers/gpu/drm/nouveau/nvkm/subdev/bios/perf.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ nvbios_perfEp(struct nvkm_bios *bios, int idx,
135135
break;
136136
case 0x30:
137137
info->script = nvbios_rd16(bios, perf + 0x02);
138+
/* fall through */
138139
case 0x35:
139140
info->fanspeed = nvbios_rd08(bios, perf + 0x06);
140141
info->voltage = nvbios_rd08(bios, perf + 0x07);

‎drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ pll_map(struct nvkm_bios *bios)
134134
device->chipset == 0xaa ||
135135
device->chipset == 0xac)
136136
return g84_pll_mapping;
137+
/* fall through */
137138
default:
138139
return NULL;
139140
}

‎drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ nvkm_cstate_valid(struct nvkm_clk *clk, struct nvkm_cstate *cstate,
9090
case NVKM_CLK_BOOST_NONE:
9191
if (clk->base_khz && freq > clk->base_khz)
9292
return false;
93+
/* fall through */
9394
case NVKM_CLK_BOOST_BIOS:
9495
if (clk->boost_khz && freq > clk->boost_khz)
9596
return false;

‎drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ mcp77_clk_prog(struct nvkm_clk *base)
363363
switch (clk->vsrc) {
364364
case nv_clk_src_cclk:
365365
mast |= 0x00400000;
366+
/* fall through */
366367
default:
367368
nvkm_wr32(device, 0x4600, clk->vdiv);
368369
}

‎drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,13 @@ nv40_ram_prog(struct nvkm_ram *base)
131131
nvkm_mask(device, 0x00402c, 0xc0771100, ram->ctrl);
132132
nvkm_wr32(device, 0x004048, ram->coef);
133133
nvkm_wr32(device, 0x004030, ram->coef);
134+
/* fall through */
134135
case 0x43:
135136
case 0x49:
136137
case 0x4b:
137138
nvkm_mask(device, 0x004038, 0xc0771100, ram->ctrl);
138139
nvkm_wr32(device, 0x00403c, ram->coef);
140+
/* fall through */
139141
default:
140142
nvkm_mask(device, 0x004020, 0xc0771100, ram->ctrl);
141143
nvkm_wr32(device, 0x004024, ram->coef);

‎drivers/gpu/drm/nouveau/nvkm/subdev/mxm/nv50.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ mxm_dcb_sanitise_entry(struct nvkm_bios *bios, void *data, int idx, u16 pdcb)
159159
break;
160160
case 0x0e: /* eDP, falls through to DPint */
161161
ctx.outp[1] |= 0x00010000;
162+
/* fall through */
162163
case 0x07: /* DP internal, wtf is this?? HP8670w */
163164
ctx.outp[1] |= 0x00000004; /* use_power_scripts? */
164165
type = DCB_CONNECTOR_eDP;

0 commit comments

Comments
 (0)