Skip to content

Commit 615c545

Browse files
deborahbrouwermchehab
authored andcommitted
media: bttv: replace BUG with WARN_ON
Both BUG and BUG_ON are replaced with WARN_ON wherever they would still be present after the vb2 conversion. WARN_ON is sufficient in these cases. Signed-off-by: Deborah Brouwer <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent d1846d7 commit 615c545

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

drivers/media/pci/bt8xx/bttv-driver.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,8 +1111,8 @@ set_tvnorm(struct bttv *btv, unsigned int norm)
11111111
const struct bttv_tvnorm *tvnorm;
11121112
v4l2_std_id id;
11131113

1114-
BUG_ON(norm >= BTTV_TVNORMS);
1115-
BUG_ON(btv->tvnorm >= BTTV_TVNORMS);
1114+
WARN_ON(norm >= BTTV_TVNORMS);
1115+
WARN_ON(btv->tvnorm >= BTTV_TVNORMS);
11161116

11171117
tvnorm = &bttv_tvnorms[norm];
11181118

@@ -1910,8 +1910,8 @@ limit_scaled_size_lock (struct bttv_fh * fh,
19101910
__s32 max_height;
19111911
int rc;
19121912

1913-
BUG_ON((int) width_mask >= 0 ||
1914-
width_bias >= (unsigned int) -width_mask);
1913+
WARN_ON((int)width_mask >= 0 ||
1914+
width_bias >= (unsigned int)(-width_mask));
19151915

19161916
/* Make sure tvnorm, vbi_end and the current cropping parameters
19171917
remain consistent until we're done. */
@@ -2026,7 +2026,7 @@ static int bttv_resource(struct bttv_fh *fh)
20262026
res = RESOURCE_VBI;
20272027
break;
20282028
default:
2029-
BUG();
2029+
WARN_ON(1);
20302030
}
20312031
return res;
20322032
}

drivers/media/pci/bt8xx/bttv-risc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ bttv_risc_packed(struct bttv *btv, struct btcx_riscmem *risc,
106106

107107
/* save pointer to jmp instruction address */
108108
risc->jmp = rp;
109-
BUG_ON((risc->jmp - risc->cpu + 2) * sizeof(*risc->cpu) > risc->size);
109+
WARN_ON((risc->jmp - risc->cpu + 2) * sizeof(*risc->cpu) > risc->size);
110110
return 0;
111111
}
112112

@@ -227,7 +227,7 @@ bttv_risc_planar(struct bttv *btv, struct btcx_riscmem *risc,
227227

228228
/* save pointer to jmp instruction address */
229229
risc->jmp = rp;
230-
BUG_ON((risc->jmp - risc->cpu + 2) * sizeof(*risc->cpu) > risc->size);
230+
WARN_ON((risc->jmp - risc->cpu + 2) * sizeof(*risc->cpu) > risc->size);
231231
return 0;
232232
}
233233

@@ -646,7 +646,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
646646
bpf,bpl,0,0,buf->vb.height >> 1);
647647
break;
648648
default:
649-
BUG();
649+
WARN_ON(1);
650650
}
651651
}
652652

@@ -737,7 +737,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
737737
0);
738738
break;
739739
default:
740-
BUG();
740+
WARN_ON(1);
741741
}
742742
}
743743

drivers/media/pci/bt8xx/bttv-vbi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static int try_fmt(struct v4l2_vbi_format *f, const struct bttv_tvnorm *tvnorm,
250250
if (min_start > max_start)
251251
return -EBUSY;
252252

253-
BUG_ON(max_start >= max_end);
253+
WARN_ON(max_start >= max_end);
254254

255255
f->sampling_rate = tvnorm->Fsc;
256256
f->samples_per_line = VBI_BPL;
@@ -430,8 +430,8 @@ void bttv_vbi_fmt_reset(struct bttv_vbi_fmt *f, unsigned int norm)
430430
real_count = ((tvnorm->cropcap.defrect.top >> 1)
431431
- tvnorm->vbistart[0]);
432432

433-
BUG_ON(real_samples_per_line > VBI_BPL);
434-
BUG_ON(real_count > VBI_DEFLINES);
433+
WARN_ON(real_samples_per_line > VBI_BPL);
434+
WARN_ON(real_count > VBI_DEFLINES);
435435

436436
f->tvnorm = tvnorm;
437437

0 commit comments

Comments
 (0)