From patchwork Wed May 19 09:33:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 442989 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC6A3C433ED for ; Wed, 19 May 2021 09:33:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE031613B6 for ; Wed, 19 May 2021 09:33:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345593AbhESJem (ORCPT ); Wed, 19 May 2021 05:34:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:51602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345517AbhESJek (ORCPT ); Wed, 19 May 2021 05:34:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8EC39613B6; Wed, 19 May 2021 09:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621416801; bh=G2bnh5nE7hbat+QYz2Xh6rd4kVjoC2IxjGFfgdqYVVE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CX4Jh/C4SOqNtMp/Aa2Naavlg0W1EbXl5QRxrsq4g5GM4Dch2iBhaFEdJ1OFQbHjB bMOyQD4BBUknEGUVTXZNtkQBkBPZEqzuIMIZP9HPh2rLrtykFgkKyQhXTzAopUoueM 5jNwNV3G3mxGyMMCQOIkX3u431O0Z+FNheUYG188rxtjvOyyoEJ4ebhDOpwIlOt2Dl 5+we6MNxrkC+LlUPJKr6ocoTz4vMf9vYOyr2GccQfm1JNIPv8W/lfCJ39z6Zz5aZ9Z QqhwbvI+VGopHG3ARM4HGBacdt/wCC0PqqUgriJ3dv5ZHMZFsxcmIaHzgnDmXGH11M FyrL0EeP3g+uA== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1ljIZs-0002pS-Uc; Wed, 19 May 2021 11:33:20 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Pawel Laszczak Subject: [PATCH 1/3] USB: cdnsp: drop irq-flags initialisations Date: Wed, 19 May 2021 11:33:01 +0200 Message-Id: <20210519093303.10789-2-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210519093303.10789-1-johan@kernel.org> References: <20210519093303.10789-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org There's no need to initialise irq-flags variables before saving the interrupt state. Cc: Pawel Laszczak Signed-off-by: Johan Hovold Acked-by: Felipe Balbi --- drivers/usb/cdns3/cdnsp-gadget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/cdns3/cdnsp-gadget.c b/drivers/usb/cdns3/cdnsp-gadget.c index 56707b6b0f57..4fddc78f732f 100644 --- a/drivers/usb/cdns3/cdnsp-gadget.c +++ b/drivers/usb/cdns3/cdnsp-gadget.c @@ -1151,7 +1151,7 @@ static int cdnsp_gadget_ep_set_halt(struct usb_ep *ep, int value) struct cdnsp_ep *pep = to_cdnsp_ep(ep); struct cdnsp_device *pdev = pep->pdev; struct cdnsp_request *preq; - unsigned long flags = 0; + unsigned long flags; int ret; spin_lock_irqsave(&pdev->lock, flags); @@ -1176,7 +1176,7 @@ static int cdnsp_gadget_ep_set_wedge(struct usb_ep *ep) { struct cdnsp_ep *pep = to_cdnsp_ep(ep); struct cdnsp_device *pdev = pep->pdev; - unsigned long flags = 0; + unsigned long flags; int ret; spin_lock_irqsave(&pdev->lock, flags); From patchwork Wed May 19 09:33:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 443776 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD6BDC433B4 for ; Wed, 19 May 2021 09:33:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9CDA2613AF for ; Wed, 19 May 2021 09:33:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345679AbhESJep (ORCPT ); Wed, 19 May 2021 05:34:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:51608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345520AbhESJek (ORCPT ); Wed, 19 May 2021 05:34:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9195F613AC; Wed, 19 May 2021 09:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621416801; bh=+z50DH6y5nk22AVu8oFQ8KsCNGoWbe85hVbd+LyXB+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ODb6tP/t7Jvc+menfbfq/p4DYqo40r51CsJNcBJ69RnTNqxtwCwCwuJyjR9wi8oJG qW70w+CllhxvyE4HAIY2eXjfKQO+0KN+cxA+Xh/rxzmsOF5gZfaVvsq31tbrdu/8rC 37J/CkLHboPMawkf9I9yizwweaoWcW8tprgecgJtY5V61tRjQjozCNvgg7oICevox5 7vTfiHW75cZDYMu1NJ31M1YGvpXn6NHh6tm3/oPjbjC+SJZsmf3mXLSmJMVvMyoU3K 6njG3XPkZqV2aF1XenkxkQ0REyEh69TxH2SB75jYdwQCG+DdaCqVaF8r1oTA7I7GVT 6UGHuxJYpT4zw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1ljIZt-0002pU-0t; Wed, 19 May 2021 11:33:21 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Minas Harutyunyan Subject: [PATCH 2/3] USB: dwc2: drop irq-flags initialisations Date: Wed, 19 May 2021 11:33:02 +0200 Message-Id: <20210519093303.10789-3-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210519093303.10789-1-johan@kernel.org> References: <20210519093303.10789-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org There's no need to initialise irq-flags variables before saving the interrupt state. While at it drop two redundant return-value initialisations from two of the functions that got it wrong. Cc: Minas Harutyunyan Signed-off-by: Johan Hovold Acked-by: Felipe Balbi --- drivers/usb/dwc2/gadget.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 184964174dc0..b16fb3611a86 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -1496,8 +1496,8 @@ static int dwc2_hsotg_ep_queue_lock(struct usb_ep *ep, struct usb_request *req, { struct dwc2_hsotg_ep *hs_ep = our_ep(ep); struct dwc2_hsotg *hs = hs_ep->parent; - unsigned long flags = 0; - int ret = 0; + unsigned long flags; + int ret; spin_lock_irqsave(&hs->lock, flags); ret = dwc2_hsotg_ep_queue(ep, req, gfp_flags); @@ -4374,8 +4374,8 @@ static int dwc2_hsotg_ep_sethalt_lock(struct usb_ep *ep, int value) { struct dwc2_hsotg_ep *hs_ep = our_ep(ep); struct dwc2_hsotg *hs = hs_ep->parent; - unsigned long flags = 0; - int ret = 0; + unsigned long flags; + int ret; spin_lock_irqsave(&hs->lock, flags); ret = dwc2_hsotg_ep_sethalt(ep, value, false); @@ -4505,7 +4505,7 @@ static int dwc2_hsotg_udc_start(struct usb_gadget *gadget, static int dwc2_hsotg_udc_stop(struct usb_gadget *gadget) { struct dwc2_hsotg *hsotg = to_hsotg(gadget); - unsigned long flags = 0; + unsigned long flags; int ep; if (!hsotg) @@ -4577,7 +4577,7 @@ static int dwc2_hsotg_set_selfpowered(struct usb_gadget *gadget, static int dwc2_hsotg_pullup(struct usb_gadget *gadget, int is_on) { struct dwc2_hsotg *hsotg = to_hsotg(gadget); - unsigned long flags = 0; + unsigned long flags; dev_dbg(hsotg->dev, "%s: is_on: %d op_state: %d\n", __func__, is_on, hsotg->op_state); From patchwork Wed May 19 09:33:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 443777 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A00AAC433B4 for ; Wed, 19 May 2021 09:33:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C6CA613AF for ; Wed, 19 May 2021 09:33:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345630AbhESJen (ORCPT ); Wed, 19 May 2021 05:34:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:51612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345530AbhESJek (ORCPT ); Wed, 19 May 2021 05:34:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9441F613BA; Wed, 19 May 2021 09:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621416801; bh=w0kH4aEv0kclW6uE2UePjrSnaKIliZMimvw9Tin9myo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fGTXN3gCzzjxlfX1yt4cyWNue2oBy5pZLJun6le07y1rPqG6cONuuzrK6nugDZi+3 /jQ1ToWbqFkeWDTzPCUH0LHE/u+ucDqitBJ0yNVeio2xbwMAT36w8oOI0L9Vk8ERjI 3K8gcx9EdWMDPqLiu6RAjtiwop/jbh3763iIf7b61ivgs0rrcVMhYCu5VvQI08X4rq kGAASzwQI5FG94YsDZQ/idAaqRBuT9N+2O4dfGpvwan8IBlEDCW2J5Ce2PqNOEieCU pdBJJB8W/jU2u788+MpKthddSMOd6KQLRyC5eqG5tkBlGUex61uVjRTuq/P5hC9DOh rjIg5XDNV+0BQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1ljIZt-0002pX-3M; Wed, 19 May 2021 11:33:21 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Li Yang , Felipe Balbi Subject: [PATCH 3/3] USB: gadget: drop irq-flags initialisations Date: Wed, 19 May 2021 11:33:03 +0200 Message-Id: <20210519093303.10789-4-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210519093303.10789-1-johan@kernel.org> References: <20210519093303.10789-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org There's no need to initialise irq-flags variables before saving the interrupt state. Drop the redundant initialisations from drivers that got this wrong. Cc: Li Yang Cc: Felipe Balbi Signed-off-by: Johan Hovold Acked-by: Felipe Balbi --- drivers/usb/gadget/udc/fsl_udc_core.c | 8 ++++---- drivers/usb/gadget/udc/mv_u3d_core.c | 2 +- drivers/usb/gadget/udc/mv_udc_core.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c index ad6ff9c4188e..2b357b3f64c0 100644 --- a/drivers/usb/gadget/udc/fsl_udc_core.c +++ b/drivers/usb/gadget/udc/fsl_udc_core.c @@ -547,7 +547,7 @@ static int fsl_ep_enable(struct usb_ep *_ep, unsigned short max = 0; unsigned char mult = 0, zlt; int retval = -EINVAL; - unsigned long flags = 0; + unsigned long flags; ep = container_of(_ep, struct fsl_ep, ep); @@ -631,7 +631,7 @@ static int fsl_ep_disable(struct usb_ep *_ep) { struct fsl_udc *udc = NULL; struct fsl_ep *ep = NULL; - unsigned long flags = 0; + unsigned long flags; u32 epctrl; int ep_num; @@ -1001,7 +1001,7 @@ out: epctrl = fsl_readl(&dr_regs->endptctrl[ep_num]); static int fsl_ep_set_halt(struct usb_ep *_ep, int value) { struct fsl_ep *ep = NULL; - unsigned long flags = 0; + unsigned long flags; int status = -EOPNOTSUPP; /* operation not supported */ unsigned char ep_dir = 0, ep_num = 0; struct fsl_udc *udc = NULL; @@ -1938,7 +1938,7 @@ static int fsl_udc_start(struct usb_gadget *g, struct usb_gadget_driver *driver) { int retval = 0; - unsigned long flags = 0; + unsigned long flags; /* lock is needed but whether should use this lock or another */ spin_lock_irqsave(&udc_controller->lock, flags); diff --git a/drivers/usb/gadget/udc/mv_u3d_core.c b/drivers/usb/gadget/udc/mv_u3d_core.c index 5486f5a70868..ce3d7a3eb7e3 100644 --- a/drivers/usb/gadget/udc/mv_u3d_core.c +++ b/drivers/usb/gadget/udc/mv_u3d_core.c @@ -941,7 +941,7 @@ mv_u3d_ep_set_stall(struct mv_u3d *u3d, u8 ep_num, u8 direction, int stall) static int mv_u3d_ep_set_halt_wedge(struct usb_ep *_ep, int halt, int wedge) { struct mv_u3d_ep *ep; - unsigned long flags = 0; + unsigned long flags; int status = 0; struct mv_u3d *u3d; diff --git a/drivers/usb/gadget/udc/mv_udc_core.c b/drivers/usb/gadget/udc/mv_udc_core.c index 0fb4ef464321..7f24ce400b59 100644 --- a/drivers/usb/gadget/udc/mv_udc_core.c +++ b/drivers/usb/gadget/udc/mv_udc_core.c @@ -888,7 +888,7 @@ static int ep_is_stall(struct mv_udc *udc, u8 ep_num, u8 direction) static int mv_ep_set_halt_wedge(struct usb_ep *_ep, int halt, int wedge) { struct mv_ep *ep; - unsigned long flags = 0; + unsigned long flags; int status = 0; struct mv_udc *udc;