mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Neil Armstrong <narmstrong@baylibre.com>
Cc: kbuild-all@01.org, Felipe Balbi <balbi@ti.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: [PATCH] usb: gadget: fix bugon.cocci warnings
Date: Sat, 17 Oct 2015 00:33:28 +0800	[thread overview]
Message-ID: <20151016163328.GA36536@lkp-nex05> (raw)
In-Reply-To: <56210FB1.4030507@baylibre.com>

drivers/usb/gadget/udc/cadence_hsudc.c:1303:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG.
Please make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h)

 Use BUG_ON instead of a if condition followed by BUG.

Semantic patch information:
 This makes an effort to find cases where BUG() follows an if
 condition on an expression and replaces the if condition and BUG()
 with a BUG_ON having the conditional expression of the if statement
 as argument.

Generated by: scripts/coccinelle/misc/bugon.cocci

CC: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

Please take the patch only if it's a positive warning. Thanks!

 cadence_hsudc.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/usb/gadget/udc/cadence_hsudc.c
+++ b/drivers/usb/gadget/udc/cadence_hsudc.c
@@ -1299,8 +1299,7 @@ static void hsudc_ep_work(struct work_st
 
 	hsudc_ep->cur = hsudc_req;
 
-	if (!hsudc_req)
-		BUG();
+	BUG_ON(!hsudc_req);
 
 	spin_unlock(&hsudc_ep->s);
 

  parent reply	other threads:[~2015-10-16 16:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-16 16:33 [RFC PATCH] usb: gadget: Introduce Cadence USB2 UDC Driver kbuild test robot
2015-10-16 14:54 ` Neil Armstrong
2015-10-16 16:33   ` [PATCH] usb: gadget: fix platform_no_drv_owner.cocci warnings kbuild test robot
2015-10-16 16:33   ` kbuild test robot [this message]
2015-10-16 16:46   ` [RFC PATCH] usb: gadget: Introduce Cadence USB2 UDC Driver kbuild test robot
2015-11-16 16:11   ` Felipe Balbi
2016-05-24 14:16     ` Neil Armstrong
2016-05-24 14:34       ` Felipe Balbi
2016-05-24 15:35       ` Laurent Pinchart

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=20151016163328.GA36536@lkp-nex05 \
    --to=lkp@intel.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@01.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=narmstrong@baylibre.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®