All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
To: linux-media@vger.kernel.org
Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Subject: [PATCH 04/17] staging: media: av7110: replace BUG_ON by WARN_ON
Date: Thu,  2 Mar 2023 14:03:17 +0100	[thread overview]
Message-ID: <20230302130330.1125172-5-hverkuil-cisco@xs4all.nl> (raw)
In-Reply-To: <20230302130330.1125172-1-hverkuil-cisco@xs4all.nl>

No need for BUG_ON, WARN_ON is a lot friendlier.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
 drivers/staging/media/av7110/av7110.c    | 6 ++++--
 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;
-- 
2.39.1


  parent reply	other threads:[~2023-03-02 13:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02 13:03 [PATCH 00/17] saa7146: convert to vb2 Hans Verkuil
2023-03-02 13:03 ` [PATCH 01/17] media: saa7146: drop 'dev' and 'resources' from struct saa7146_fh Hans Verkuil
2023-03-02 13:03 ` [PATCH 02/17] media: common: saa7146: drop 'fmt' from struct saa7146_buf Hans Verkuil
2023-03-02 13:03 ` [PATCH 03/17] media: common: saa7146: replace BUG_ON by WARN_ON Hans Verkuil
2023-03-02 13:03 ` Hans Verkuil [this message]
2023-03-02 13:03 ` [PATCH 05/17] media: common: saa7146: fix broken V4L2_PIX_FMT_YUV422P support Hans Verkuil
2023-03-02 13:03 ` [PATCH 06/17] media: common: saa7146: use for_each_sg_dma_page Hans Verkuil
2023-03-02 13:03 ` [PATCH 07/17] media: saa7146: convert to vb2 Hans Verkuil
2023-03-02 13:03 ` [PATCH 08/17] media: common: saa7146: fix compliance problems with field handling Hans Verkuil
2023-03-02 13:03 ` [PATCH 09/17] media: common: saa7146: check minimum video format size Hans Verkuil
2023-03-02 13:03 ` [PATCH 10/17] media: common: saa7146: fall back to V4L2_PIX_FMT_BGR24 Hans Verkuil
2023-03-02 13:03 ` [PATCH 11/17] media: common: saa7146: allow S_STD(G_STD) Hans Verkuil
2023-03-02 13:03 ` [PATCH 12/17] media: mxb: update the tvnorms when changing input Hans Verkuil
2023-03-02 13:03 ` [PATCH 13/17] media: common: saa7146: add support for missing .vidioc_try_fmt_vbi_cap Hans Verkuil
2023-03-02 13:03 ` [PATCH 14/17] media: mxb: allow tuner/input/audio ioctls for vbi Hans Verkuil
2023-03-02 13:03 ` [PATCH 15/17] media: common: saa7146: allow AUDIO ioctls for the vbi stream Hans Verkuil
2023-03-02 13:03 ` [PATCH 16/17] media: common: saa7146: drop USERPTR support Hans Verkuil
2023-03-02 13:03 ` [PATCH 17/17] media: pci: saa7146: advertise only those TV standard that are supported Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230302130330.1125172-5-hverkuil-cisco@xs4all.nl \
    --to=hverkuil-cisco@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.