All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] USB: drop irq-flags initialisations
@ 2021-05-19  9:33 Johan Hovold
  2021-05-19  9:33 ` [PATCH 1/3] USB: cdnsp: " Johan Hovold
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Johan Hovold @ 2021-05-19  9:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Johan Hovold

This series drops the remaining redundant irq-flags initialisations from
the USB subsystem, which all happened to be in gadget-related code.

Johan


Johan Hovold (3):
  USB: cdnsp: drop irq-flags initialisations
  USB: dwc2: drop irq-flags initialisations
  USB: gadget: drop irq-flags initialisations

 drivers/usb/cdns3/cdnsp-gadget.c      |  4 ++--
 drivers/usb/dwc2/gadget.c             | 12 ++++++------
 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 +-
 5 files changed, 14 insertions(+), 14 deletions(-)

-- 
2.26.3


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] USB: cdnsp: drop irq-flags initialisations
  2021-05-19  9:33 [PATCH 0/3] USB: drop irq-flags initialisations Johan Hovold
@ 2021-05-19  9:33 ` Johan Hovold
  2021-06-03  6:17   ` Felipe Balbi
  2021-05-19  9:33 ` [PATCH 2/3] USB: dwc2: " Johan Hovold
  2021-05-19  9:33 ` [PATCH 3/3] USB: gadget: " Johan Hovold
  2 siblings, 1 reply; 7+ messages in thread
From: Johan Hovold @ 2021-05-19  9:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Johan Hovold, Pawel Laszczak

There's no need to initialise irq-flags variables before saving the
interrupt state.

Cc: Pawel Laszczak <pawell@cadence.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 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);
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] USB: dwc2: drop irq-flags initialisations
  2021-05-19  9:33 [PATCH 0/3] USB: drop irq-flags initialisations Johan Hovold
  2021-05-19  9:33 ` [PATCH 1/3] USB: cdnsp: " Johan Hovold
@ 2021-05-19  9:33 ` Johan Hovold
  2021-06-03  6:18   ` Felipe Balbi
  2021-05-19  9:33 ` [PATCH 3/3] USB: gadget: " Johan Hovold
  2 siblings, 1 reply; 7+ messages in thread
From: Johan Hovold @ 2021-05-19  9:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, Johan Hovold, Minas Harutyunyan

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 <hminas@synopsys.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 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);
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] USB: gadget: drop irq-flags initialisations
  2021-05-19  9:33 [PATCH 0/3] USB: drop irq-flags initialisations Johan Hovold
  2021-05-19  9:33 ` [PATCH 1/3] USB: cdnsp: " Johan Hovold
  2021-05-19  9:33 ` [PATCH 2/3] USB: dwc2: " Johan Hovold
@ 2021-05-19  9:33 ` Johan Hovold
  2021-06-03  6:19   ` Felipe Balbi
  2 siblings, 1 reply; 7+ messages in thread
From: Johan Hovold @ 2021-05-19  9:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, Johan Hovold, Li Yang, Felipe Balbi

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 <leoyang.li@nxp.com>
Cc: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 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;
 
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] USB: cdnsp: drop irq-flags initialisations
  2021-05-19  9:33 ` [PATCH 1/3] USB: cdnsp: " Johan Hovold
@ 2021-06-03  6:17   ` Felipe Balbi
  0 siblings, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2021-06-03  6:17 UTC (permalink / raw)
  To: Johan Hovold, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, Johan Hovold, Pawel Laszczak

[-- Attachment #1: Type: text/plain, Size: 296 bytes --]


Hi,

Johan Hovold <johan@kernel.org> writes:
> There's no need to initialise irq-flags variables before saving the
> interrupt state.
>
> Cc: Pawel Laszczak <pawell@cadence.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>

Acked-by: Felipe Balbi <balbi@kernel.org>

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] USB: dwc2: drop irq-flags initialisations
  2021-05-19  9:33 ` [PATCH 2/3] USB: dwc2: " Johan Hovold
@ 2021-06-03  6:18   ` Felipe Balbi
  0 siblings, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2021-06-03  6:18 UTC (permalink / raw)
  To: Johan Hovold, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, Johan Hovold, Minas Harutyunyan

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]

Johan Hovold <johan@kernel.org> writes:

> 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 <hminas@synopsys.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>

Acked-by: Felipe Balbi <balbi@kernel.org>

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] USB: gadget: drop irq-flags initialisations
  2021-05-19  9:33 ` [PATCH 3/3] USB: gadget: " Johan Hovold
@ 2021-06-03  6:19   ` Felipe Balbi
  0 siblings, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2021-06-03  6:19 UTC (permalink / raw)
  To: Johan Hovold, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, Johan Hovold, Li Yang

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]

Johan Hovold <johan@kernel.org> writes:

> 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 <leoyang.li@nxp.com>
> Cc: Felipe Balbi <balbi@kernel.org>
> Signed-off-by: Johan Hovold <johan@kernel.org>

Acked-by: Felipe Balbi <balbi@kernel.org>

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-06-03  6:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19  9:33 [PATCH 0/3] USB: drop irq-flags initialisations Johan Hovold
2021-05-19  9:33 ` [PATCH 1/3] USB: cdnsp: " Johan Hovold
2021-06-03  6:17   ` Felipe Balbi
2021-05-19  9:33 ` [PATCH 2/3] USB: dwc2: " Johan Hovold
2021-06-03  6:18   ` Felipe Balbi
2021-05-19  9:33 ` [PATCH 3/3] USB: gadget: " Johan Hovold
2021-06-03  6:19   ` Felipe Balbi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.