All of lore.kernel.org
 help / color / mirror / Atom feed
From: kishore.p@techveda.org
To: eric@anholt.net, stefan.wahren@i2se.com, gregkh@linuxfoundation.org
Cc: linux-arm-kernel@lists.infradead.org,
	linux-rpi-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
	karthik@techveda.org, shrikant.maurya@techveda.org,
	Kishore KP <kishore.p@techveda.org>,
	Suniel Mahesh <sunil.m@techveda.org>
Subject: [PATCH] staging: vc04_services: Prefer BUG_ON instead of if condition followed by BUG.
Date: Sat, 23 Dec 2017 20:36:00 +0530	[thread overview]
Message-ID: <1514041560-28001-1-git-send-email-kishore.p@techveda.org> (raw)

From: Kishore KP <kishore.p@techveda.org>

Use BUG_ON instead of if condition followed by BUG.
Pointed out by Coccinelle.

Signed-off-by: Kishore KP <kishore.p@techveda.org>
Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
---
Note:
- Patch was compile tested and built(ARCH=arm) on linux-next
  (latest).
- No build issues reported.
---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index 315b49c..7116f61 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -224,8 +224,7 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state)
 
 	platform_state   = (struct vchiq_2835_state *)state->platform_state;
 
-	if (!platform_state->inited)
-		BUG();
+	BUG_ON(!platform_state->inited);
 
 	return &platform_state->arm_state;
 }
-- 
1.9.1

WARNING: multiple messages have this Message-ID (diff)
From: kishore.p@techveda.org (kishore.p at techveda.org)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] staging: vc04_services: Prefer BUG_ON instead of if condition followed by BUG.
Date: Sat, 23 Dec 2017 20:36:00 +0530	[thread overview]
Message-ID: <1514041560-28001-1-git-send-email-kishore.p@techveda.org> (raw)

From: Kishore KP <kishore.p@techveda.org>

Use BUG_ON instead of if condition followed by BUG.
Pointed out by Coccinelle.

Signed-off-by: Kishore KP <kishore.p@techveda.org>
Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
---
Note:
- Patch was compile tested and built(ARCH=arm) on linux-next
  (latest).
- No build issues reported.
---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index 315b49c..7116f61 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -224,8 +224,7 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state)
 
 	platform_state   = (struct vchiq_2835_state *)state->platform_state;
 
-	if (!platform_state->inited)
-		BUG();
+	BUG_ON(!platform_state->inited);
 
 	return &platform_state->arm_state;
 }
-- 
1.9.1

             reply	other threads:[~2017-12-23 15:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-23 15:06 kishore.p [this message]
2017-12-23 15:06 ` [PATCH] staging: vc04_services: Prefer BUG_ON instead of if condition followed by BUG kishore.p at techveda.org
2017-12-23 16:04 ` Stefan Wahren
2017-12-23 16:04   ` Stefan Wahren
2017-12-24 14:03   ` [PATCH v2] staging: vc04_services: Prefer WARN_ON_ONCE " kishore.p
2017-12-24 14:03     ` kishore.p at techveda.org

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=1514041560-28001-1-git-send-email-kishore.p@techveda.org \
    --to=kishore.p@techveda.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=eric@anholt.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=karthik@techveda.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=shrikant.maurya@techveda.org \
    --cc=stefan.wahren@i2se.com \
    --cc=sunil.m@techveda.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.