From patchwork Wed Apr 18 20:05:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Liu X-Patchwork-Id: 10348881 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B1A74601D7 for ; Wed, 18 Apr 2018 20:05:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A281A2882A for ; Wed, 18 Apr 2018 20:05:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9734828846; Wed, 18 Apr 2018 20:05:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17FD22882A for ; Wed, 18 Apr 2018 20:05:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752322AbeDRUFg (ORCPT ); Wed, 18 Apr 2018 16:05:36 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:34536 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752306AbeDRUFf (ORCPT ); Wed, 18 Apr 2018 16:05:35 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3IK5YSQ010185 for ; Wed, 18 Apr 2018 15:05:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524081934; bh=W+x1HxhiFcbMALRK5e5m29AXSUpFRPk1F9xdfYvLSd0=; h=From:To:Subject:Date:In-Reply-To:References; b=eD5aaxZ3I1/yCwUTLFwpSUyY+MrEjAwVbWgJ9lIDWmlPun8J621j88rU4b/sOdMoN o+8b7xnPl2i8S0kZY1mXGX66GBNLXicL2RODtr1rTxEpGqzZtXrj4KTNmlxQqLAbFv Pd+EZEIWBP79B0YGZli5qt31d12lOhuOHnXzKosc= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3IK5Y7h019054 for ; Wed, 18 Apr 2018 15:05:34 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 18 Apr 2018 15:05:34 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 18 Apr 2018 15:05:34 -0500 Received: from uda0271908.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3IK5Ypm029304 for ; Wed, 18 Apr 2018 15:05:34 -0500 From: Bin Liu To: Subject: [PATCH 2/3] usb: musb: gadget: fix to_musb_ep() to not return NULL Date: Wed, 18 Apr 2018 15:05:33 -0500 Message-ID: <1524081934-3235-2-git-send-email-b-liu@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1524081934-3235-1-git-send-email-b-liu@ti.com> References: <1524081934-3235-1-git-send-email-b-liu@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP UDC core ensures the usb_ep parameter passed in is not NULL, so checking if (ep != NULL) is pointless. Convert to_musb_ep() to a simple macro to not directly return NULL to avoid warnings from code static analysis tools. Signed-off-by: Bin Liu --- drivers/usb/musb/musb_gadget.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/usb/musb/musb_gadget.h b/drivers/usb/musb/musb_gadget.h index 466877b471ef..aaae24bb3c10 100644 --- a/drivers/usb/musb/musb_gadget.h +++ b/drivers/usb/musb/musb_gadget.h @@ -96,10 +96,7 @@ struct musb_ep { u8 hb_mult; }; -static inline struct musb_ep *to_musb_ep(struct usb_ep *ep) -{ - return ep ? container_of(ep, struct musb_ep, end_point) : NULL; -} +#define to_musb_ep(ep) (container_of(ep, struct musb_ep, end_point)) static inline struct musb_request *next_request(struct musb_ep *ep) {