Skip to contentSkip to conversation

Revert "usb: dwc2: host: Setting qtd to NULL after freeing it"

PATCH In review Guenter Roeck 3 participants 3 messages May 29, 2019 – May 30, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "usb: dwc2: host: Setting qtd to NULL after freeing it"

This reverts commit b0d659022e5c96ee5c4bd62d22d3da2d66de306b.

The reverted commit does nothing but adding two unnecessary lines of code. It sets a local variable to NULL in two functions, but that variable is not used anywhere in the rest of those functions. This is just confusing, so let's remove it.

Cc Vardan Mikayelyan <[email protected]>
Cc John Youn <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Felipe Balbi <[email protected]>
---
 drivers/usb/dwc2/hcd.c | 1 -
 drivers/usb/dwc2/hcd.h | 1 -
 2 files changed, 2 deletions(-)
drivers/usb/dwc2/hcd.c +0 -1
index b50ec3714fd8..bca64b0d4d15 100644
@@ -4676,7 +4676,6 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
 	spin_unlock_irqrestore(&hsotg->lock, flags);
 	urb->hcpriv = NULL;
 	kfree(qtd);
-	qtd = NULL;
 fail1:
 	if (qh_allocated) {
 		struct dwc2_qtd *qtd2, *qtd2_tmp;
drivers/usb/dwc2/hcd.h +0 -1
index c089ffa1f0a8..f6bc48432b04 100644
@@ -574,7 +574,6 @@ static inline void dwc2_hcd_qtd_unlink_and_free(struct dwc2_hsotg *hsotg,
 {
 	list_del(&qtd->qtd_list_entry);
 	kfree(qtd);
-	qtd = NULL;
 }
 
 /* Descriptor DMA support functions */
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 13 lines · Guenter Roeck

This reverts commit b0d659022e5c96ee5c4bd62d22d3da2d66de306b.

The reverted commit does nothing but adding two unnecessary lines of code. It sets a local variable to NULL in two functions, but that variable is not used anywhere in the rest of those functions. This is just confusing, so let's remove it.

Cc Vardan Mikayelyan <[email protected]>
Cc John Youn <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Felipe Balbi <[email protected]>
Quoted 4 lines
---
 drivers/usb/dwc2/hcd.c | 1 -
 drivers/usb/dwc2/hcd.h | 1 -
 2 files changed, 2 deletions(-)
Acked-by on v1 1/1
#2 lore raw
In reply to Guenter Roeck
Quoted 7 lines · Guenter Roeck

This reverts commit b0d659022e5c96ee5c4bd62d22d3da2d66de306b.

The reverted commit does nothing but adding two unnecessary lines of code. It sets a local variable to NULL in two functions, but that variable is not used anywhere in the rest of those functions. This is just confusing, so let's remove it.

Quoted 5 lines
Cc Vardan Mikayelyan <[email protected]>
Cc John Youn <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Felipe Balbi <[email protected]>
Quoted 30 lines
---
  drivers/usb/dwc2/hcd.c | 1 -
  drivers/usb/dwc2/hcd.h | 1 -
  2 files changed, 2 deletions(-)
drivers/usb/dwc2/hcd.c +0 -1
index b50ec3714fd8..bca64b0d4d15 100644
@@ -4676,7 +4676,6 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
  	spin_unlock_irqrestore(&hsotg->lock, flags);
  	urb->hcpriv = NULL;
  	kfree(qtd);
-	qtd = NULL;
  fail1:
  	if (qh_allocated) {
  		struct dwc2_qtd *qtd2, *qtd2_tmp;
drivers/usb/dwc2/hcd.h +0 -1
index c089ffa1f0a8..f6bc48432b04 100644
@@ -574,7 +574,6 @@ static inline void dwc2_hcd_qtd_unlink_and_free(struct dwc2_hsotg *hsotg,
  {
  	list_del(&qtd->qtd_list_entry);
  	kfree(qtd);
-	qtd = NULL;
  }
 
  /* Descriptor DMA support functions */