All of lore.kernel.org
 help / color / mirror / Atom feed
* usb: ehci: Cleanup itd/sidt_complete()
@ 2019-02-25 16:41 Greg Kroah-Hartman
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2019-02-25 16:41 UTC (permalink / raw)
  To: Suwan Kim; +Cc: stern, linux-usb

On Tue, Feb 26, 2019 at 12:51:44AM +0900, Suwan Kim wrote:
> This patch makes itd/sitd_complete() use *bus instead of referening
> ehci_to_hcd(ehci)->self. And remove unnecessary "urb = NULL" lines.

That is two different things to do in the same patch, please break this
up into different patches.

And when you do, say _why_ you are making these changes, not just a
description of the change itself.  We can read the patch to see what it
does, but we do not know why you want to do this.

thanks,

greg k-h

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

* usb: ehci: Cleanup itd/sidt_complete()
@ 2019-02-26  3:17 Suwan Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Suwan Kim @ 2019-02-26  3:17 UTC (permalink / raw)
  To: Greg KH; +Cc: stern, linux-usb

On Mon, Feb 25, 2019 at 05:41:45PM +0100, Greg KH wrote:
> On Tue, Feb 26, 2019 at 12:51:44AM +0900, Suwan Kim wrote:
> > This patch makes itd/sitd_complete() use *bus instead of referening
> > ehci_to_hcd(ehci)->self. And remove unnecessary "urb = NULL" lines.
> 
> That is two different things to do in the same patch, please break this
> up into different patches.

Sorry. I will break it up and send separate patches.

> And when you do, say _why_ you are making these changes, not just a
> description of the change itself.  We can read the patch to see what it
> does, but we do not know why you want to do this.
> 
> thanks,
> 
> greg k-h

Ok, you are right. My description is very short. I will rewrite the
description including why i do this and resend v2.

Regards

Suwan Kim

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

* usb: ehci: Cleanup itd/sidt_complete()
@ 2019-02-25 15:51 Suwan Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Suwan Kim @ 2019-02-25 15:51 UTC (permalink / raw)
  To: stern; +Cc: linux-usb, gregkh

This patch makes itd/sitd_complete() use *bus instead of referening
ehci_to_hcd(ehci)->self. And remove unnecessary "urb = NULL" lines.

Signed-off-by: Suwan Kim <suwan.kim027@gmail.com>
---
 drivers/usb/host/ehci-sched.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index da7b00a6110b..418825bd94fd 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1836,6 +1836,7 @@ static bool itd_complete(struct ehci_hcd *ehci, struct ehci_itd *itd)
 	int					urb_index = -1;
 	struct ehci_iso_stream			*stream = itd->stream;
 	bool					retval = false;
+	struct usb_bus			*bus = &ehci_to_hcd(ehci)->self;
 
 	/* for each uframe with a packet */
 	for (uframe = 0; uframe < 8; uframe++) {
@@ -1887,20 +1888,18 @@ static bool itd_complete(struct ehci_hcd *ehci, struct ehci_itd *itd)
 	/* give urb back to the driver; completion often (re)submits */
 	ehci_urb_done(ehci, urb, 0);
 	retval = true;
-	urb = NULL;
 
 	--ehci->isoc_count;
 	disable_periodic(ehci);
 
-	ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;
-	if (ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs == 0) {
+	bus->bandwidth_isoc_reqs--;
+	if (bus->bandwidth_isoc_reqs == 0) {
 		if (ehci->amd_pll_fix == 1)
 			usb_amd_quirk_pll_enable();
 	}
 
 	if (unlikely(list_is_singular(&stream->td_list)))
-		ehci_to_hcd(ehci)->self.bandwidth_allocated
-				-= stream->bandwidth;
+		bus->bandwidth_allocated -= stream->bandwidth;
 
 done:
 	itd->urb = NULL;
@@ -2229,6 +2228,7 @@ static bool sitd_complete(struct ehci_hcd *ehci, struct ehci_sitd *sitd)
 	int					urb_index;
 	struct ehci_iso_stream			*stream = sitd->stream;
 	bool					retval = false;
+	struct usb_bus			*bus = &ehci_to_hcd(ehci)->self;
 
 	urb_index = sitd->index;
 	desc = &urb->iso_frame_desc[urb_index];
@@ -2267,20 +2267,18 @@ static bool sitd_complete(struct ehci_hcd *ehci, struct ehci_sitd *sitd)
 	/* give urb back to the driver; completion often (re)submits */
 	ehci_urb_done(ehci, urb, 0);
 	retval = true;
-	urb = NULL;
 
 	--ehci->isoc_count;
 	disable_periodic(ehci);
 
-	ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;
-	if (ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs == 0) {
+	bus->bandwidth_isoc_reqs--;
+	if (bus->bandwidth_isoc_reqs == 0) {
 		if (ehci->amd_pll_fix == 1)
 			usb_amd_quirk_pll_enable();
 	}
 
 	if (list_is_singular(&stream->td_list))
-		ehci_to_hcd(ehci)->self.bandwidth_allocated
-				-= stream->bandwidth;
+		bus->bandwidth_allocated -= stream->bandwidth;
 
 done:
 	sitd->urb = NULL;

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

end of thread, other threads:[~2019-02-26  3:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-25 16:41 usb: ehci: Cleanup itd/sidt_complete() Greg Kroah-Hartman
  -- strict thread matches above, loose matches on Subject: below --
2019-02-26  3:17 Suwan Kim
2019-02-25 15:51 Suwan Kim

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.