Commit 615c5450 authored by Deborah Brouwer's avatar Deborah Brouwer Committed by Mauro Carvalho Chehab

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: default avatarDeborah Brouwer <deborah.brouwer@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent d1846d72
...@@ -1111,8 +1111,8 @@ set_tvnorm(struct bttv *btv, unsigned int norm) ...@@ -1111,8 +1111,8 @@ set_tvnorm(struct bttv *btv, unsigned int norm)
const struct bttv_tvnorm *tvnorm; const struct bttv_tvnorm *tvnorm;
v4l2_std_id id; v4l2_std_id id;
BUG_ON(norm >= BTTV_TVNORMS); WARN_ON(norm >= BTTV_TVNORMS);
BUG_ON(btv->tvnorm >= BTTV_TVNORMS); WARN_ON(btv->tvnorm >= BTTV_TVNORMS);
tvnorm = &bttv_tvnorms[norm]; tvnorm = &bttv_tvnorms[norm];
...@@ -1910,8 +1910,8 @@ limit_scaled_size_lock (struct bttv_fh * fh, ...@@ -1910,8 +1910,8 @@ limit_scaled_size_lock (struct bttv_fh * fh,
__s32 max_height; __s32 max_height;
int rc; int rc;
BUG_ON((int) width_mask >= 0 || WARN_ON((int)width_mask >= 0 ||
width_bias >= (unsigned int) -width_mask); width_bias >= (unsigned int)(-width_mask));
/* Make sure tvnorm, vbi_end and the current cropping parameters /* Make sure tvnorm, vbi_end and the current cropping parameters
remain consistent until we're done. */ remain consistent until we're done. */
...@@ -2026,7 +2026,7 @@ static int bttv_resource(struct bttv_fh *fh) ...@@ -2026,7 +2026,7 @@ static int bttv_resource(struct bttv_fh *fh)
res = RESOURCE_VBI; res = RESOURCE_VBI;
break; break;
default: default:
BUG(); WARN_ON(1);
} }
return res; return res;
} }
......
...@@ -106,7 +106,7 @@ bttv_risc_packed(struct bttv *btv, struct btcx_riscmem *risc, ...@@ -106,7 +106,7 @@ bttv_risc_packed(struct bttv *btv, struct btcx_riscmem *risc,
/* save pointer to jmp instruction address */ /* save pointer to jmp instruction address */
risc->jmp = rp; risc->jmp = rp;
BUG_ON((risc->jmp - risc->cpu + 2) * sizeof(*risc->cpu) > risc->size); WARN_ON((risc->jmp - risc->cpu + 2) * sizeof(*risc->cpu) > risc->size);
return 0; return 0;
} }
...@@ -227,7 +227,7 @@ bttv_risc_planar(struct bttv *btv, struct btcx_riscmem *risc, ...@@ -227,7 +227,7 @@ bttv_risc_planar(struct bttv *btv, struct btcx_riscmem *risc,
/* save pointer to jmp instruction address */ /* save pointer to jmp instruction address */
risc->jmp = rp; risc->jmp = rp;
BUG_ON((risc->jmp - risc->cpu + 2) * sizeof(*risc->cpu) > risc->size); WARN_ON((risc->jmp - risc->cpu + 2) * sizeof(*risc->cpu) > risc->size);
return 0; return 0;
} }
...@@ -646,7 +646,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf) ...@@ -646,7 +646,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
bpf,bpl,0,0,buf->vb.height >> 1); bpf,bpl,0,0,buf->vb.height >> 1);
break; break;
default: default:
BUG(); WARN_ON(1);
} }
} }
...@@ -737,7 +737,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf) ...@@ -737,7 +737,7 @@ bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf)
0); 0);
break; break;
default: default:
BUG(); WARN_ON(1);
} }
} }
......
...@@ -250,7 +250,7 @@ static int try_fmt(struct v4l2_vbi_format *f, const struct bttv_tvnorm *tvnorm, ...@@ -250,7 +250,7 @@ static int try_fmt(struct v4l2_vbi_format *f, const struct bttv_tvnorm *tvnorm,
if (min_start > max_start) if (min_start > max_start)
return -EBUSY; return -EBUSY;
BUG_ON(max_start >= max_end); WARN_ON(max_start >= max_end);
f->sampling_rate = tvnorm->Fsc; f->sampling_rate = tvnorm->Fsc;
f->samples_per_line = VBI_BPL; f->samples_per_line = VBI_BPL;
...@@ -430,8 +430,8 @@ void bttv_vbi_fmt_reset(struct bttv_vbi_fmt *f, unsigned int norm) ...@@ -430,8 +430,8 @@ void bttv_vbi_fmt_reset(struct bttv_vbi_fmt *f, unsigned int norm)
real_count = ((tvnorm->cropcap.defrect.top >> 1) real_count = ((tvnorm->cropcap.defrect.top >> 1)
- tvnorm->vbistart[0]); - tvnorm->vbistart[0]);
BUG_ON(real_samples_per_line > VBI_BPL); WARN_ON(real_samples_per_line > VBI_BPL);
BUG_ON(real_count > VBI_DEFLINES); WARN_ON(real_count > VBI_DEFLINES);
f->tvnorm = tvnorm; f->tvnorm = tvnorm;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment