diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-03-02 10:06:40 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-04-15 08:51:41 +0100 |
commit | 0e236e0a1d06320c23bfa755d3e2a059f48029b0 (patch) | |
tree | 6865aedb118b45b90580523f4e5f75bccd04a765 /drivers/staging | |
parent | 40e986c99624c5306c0d18fd9011a55440c5f61a (diff) | |
download | lwn-0e236e0a1d06320c23bfa755d3e2a059f48029b0.tar.gz lwn-0e236e0a1d06320c23bfa755d3e2a059f48029b0.zip |
media: staging: media: av7110: 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 'drivers/staging')
-rw-r--r-- | drivers/staging/media/av7110/av7110.c | 6 | ||||
-rw-r--r-- | drivers/staging/media/av7110/av7110_hw.c | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c index df81a9b744c2..a5a431c14ea7 100644 --- a/drivers/staging/media/av7110/av7110.c +++ b/drivers/staging/media/av7110/av7110.c @@ -1106,9 +1106,11 @@ static int dvb_get_stc(struct dmx_demux *demux, unsigned int num, struct av7110 *av7110; /* pointer casting paranoia... */ - BUG_ON(!demux); + if (WARN_ON(!demux)) + return -EIO; dvbdemux = demux->priv; - BUG_ON(!dvbdemux); + if (WARN_ON(!dvbdemux)) + return -EIO; av7110 = dvbdemux->priv; dprintk(4, "%p\n", av7110); diff --git a/drivers/staging/media/av7110/av7110_hw.c b/drivers/staging/media/av7110/av7110_hw.c index 93ca31e38ddd..a0be37717259 100644 --- a/drivers/staging/media/av7110/av7110_hw.c +++ b/drivers/staging/media/av7110/av7110_hw.c @@ -1007,7 +1007,8 @@ static int OSDSetBlock(struct av7110 *av7110, int x0, int y0, if (av7110->bmp_state == BMP_LOADING) { /* possible if syscall is repeated by -ERESTARTSYS and if firmware cannot abort */ - BUG_ON (FW_VERSION(av7110->arm_app) >= 0x261e); + if (WARN_ON(FW_VERSION(av7110->arm_app) >= 0x261e)) + return -EIO; rc = WaitUntilBmpLoaded(av7110); if (rc) return rc; |