From patchwork Mon May 21 13:42:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Liu X-Patchwork-Id: 10415377 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 757C460365 for ; Mon, 21 May 2018 13:42:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65B1528900 for ; Mon, 21 May 2018 13:42:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A1D628906; Mon, 21 May 2018 13:42:52 +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 E0F8D28900 for ; Mon, 21 May 2018 13:42:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752740AbeEUNmt (ORCPT ); Mon, 21 May 2018 09:42:49 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:33633 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752522AbeEUNmX (ORCPT ); Mon, 21 May 2018 09:42:23 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w4LDgMpC021710; Mon, 21 May 2018 08:42:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1526910143; bh=HtpQclDQXOALsiW0fgNXzDl0S+W5Vg1/RN5/dbSo0hM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=cZkhSxPn1sXO8D8OJ7X9WaL1o/gPD/+snBw2r9vQ0W5Y4aLxGfqP3jaA5NkEdwu1F 35Rc7nH59ew1MfZlQ6u+sl+PIY2B5o1j32F6hn3aiuBpU/bS0fHrDUEPIwedmvlZxs HEVRMha2NKdl4h+VoGdFk3INUk0S0V9Ch1DUG+Mk= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w4LDgM2W025460; Mon, 21 May 2018 08:42:22 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 21 May 2018 08:42:22 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Mon, 21 May 2018 08:42:22 -0500 Received: from uda0271908.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w4LDgMXl032590; Mon, 21 May 2018 08:42:22 -0500 From: Bin Liu To: Greg Kroah-Hartman CC: , Bin Liu Subject: [PATCH 13/14] usb: musb: gadget: fix to_musb_request() to not return NULL Date: Mon, 21 May 2018 08:42:21 -0500 Message-ID: <1526910142-15862-14-git-send-email-b-liu@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1526910142-15862-1-git-send-email-b-liu@ti.com> References: <1526910142-15862-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 The gadget function drivers should ensure the usb_request parameter passed in is not NULL. UDC core doesn't check if it is NULL, so MUSB driver shouldn't have to check it either. Convert to_musb_request() 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 9c34aca06db6..466877b471ef 100644 --- a/drivers/usb/musb/musb_gadget.h +++ b/drivers/usb/musb/musb_gadget.h @@ -60,10 +60,7 @@ struct musb_request { enum buffer_map_state map_state; }; -static inline struct musb_request *to_musb_request(struct usb_request *req) -{ - return req ? container_of(req, struct musb_request, request) : NULL; -} +#define to_musb_request(r) container_of((r), struct musb_request, request) extern struct usb_request * musb_alloc_request(struct usb_ep *ep, gfp_t gfp_flags);