diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-03-02 11:05:58 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-04-15 09:51:21 +0200 |
commit | 40e986c99624c5306c0d18fd9011a55440c5f61a (patch) | |
tree | 23ea5efccec0d5a30cbe8e984a0902060cfb2bb9 /drivers/media/common/saa7146/saa7146_hlp.c | |
parent | media: common: saa7146: drop 'fmt' from struct saa7146_buf (diff) | |
download | linux-40e986c99624c5306c0d18fd9011a55440c5f61a.tar.xz linux-40e986c99624c5306c0d18fd9011a55440c5f61a.zip |
media: common: saa7146: replace BUG_ON by WARN_ON
No need for BUG_ON, WARN_ON is a lot friendlier.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/media/common/saa7146/saa7146_hlp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/common/saa7146/saa7146_hlp.c b/drivers/media/common/saa7146/saa7146_hlp.c index 98c339c33afa..7569d8cdd4d8 100644 --- a/drivers/media/common/saa7146/saa7146_hlp.c +++ b/drivers/media/common/saa7146/saa7146_hlp.c @@ -542,9 +542,10 @@ static int calculate_video_dma_grab_planar(struct saa7146_dev* dev, struct saa71 int height = pix->height; enum v4l2_field field = pix->field; - BUG_ON(0 == buf->pt[0].dma); - BUG_ON(0 == buf->pt[1].dma); - BUG_ON(0 == buf->pt[2].dma); + if (WARN_ON(!buf->pt[0].dma) || + WARN_ON(!buf->pt[1].dma) || + WARN_ON(!buf->pt[2].dma)) + return -1; DEB_CAP("[size=%dx%d,fields=%s]\n", width, height, v4l2_field_names[field]); |