From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932718AbbJPQjA (ORCPT ); Fri, 16 Oct 2015 12:39:00 -0400 Received: from mga01.intel.com ([192.55.52.88]:55589 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932123AbbJPQi6 (ORCPT ); Fri, 16 Oct 2015 12:38:58 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,689,1437462000"; d="scan'208";a="582265691" Date: Sat, 17 Oct 2015 00:33:28 +0800 From: kbuild test robot To: Neil Armstrong Cc: kbuild-all@01.org, Felipe Balbi , Greg Kroah-Hartman , Laurent Pinchart , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH] usb: gadget: fix bugon.cocci warnings Message-ID: <20151016163328.GA36536@lkp-nex05> References: <201510170010.4OuWvpKK%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56210FB1.4030507@baylibre.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Fengguang Wu --- 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);