diff mbox series

xhci: omit mem read just after allocation of trb

Message ID 20220217133549.27961-1-oneukum@suse.com (mailing list archive)
State Accepted
Commit f9aeda81c0e8cfd6c5b21401f6206b2c7584f876
Headers show
Series xhci: omit mem read just after allocation of trb | expand

Commit Message

Oliver Neukum Feb. 17, 2022, 1:35 p.m. UTC
This has been allocated just a few lines earlier with a
zalloc(). The value is known and "|=" is a waste of memory
cycles.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/usb/host/xhci-mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mathias Nyman Feb. 18, 2022, 8:26 a.m. UTC | #1
On 17.2.2022 15.35, Oliver Neukum wrote:
> This has been allocated just a few lines earlier with a
> zalloc(). The value is known and "|=" is a waste of memory
> cycles.
> 
> Signed-off-by: Oliver Neukum <oneukum@suse.com>

Thanks

In case Greg wants to pick this up now directly:
Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>

Otherwise I'll submit it later with other small changes

-Mathias
Greg KH Feb. 24, 2022, 10:19 a.m. UTC | #2
On Fri, Feb 18, 2022 at 10:26:45AM +0200, Mathias Nyman wrote:
> On 17.2.2022 15.35, Oliver Neukum wrote:
> > This has been allocated just a few lines earlier with a
> > zalloc(). The value is known and "|=" is a waste of memory
> > cycles.
> > 
> > Signed-off-by: Oliver Neukum <oneukum@suse.com>
> 
> Thanks
> 
> In case Greg wants to pick this up now directly:
> Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>

Thanks, I'll take it now, it's easy enough to :)
diff mbox series

Patch

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 0e312066c5c6..99a3ce689235 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -57,7 +57,7 @@  static struct xhci_segment *xhci_segment_alloc(struct xhci_hcd *xhci,
 	/* If the cycle state is 0, set the cycle bit to 1 for all the TRBs */
 	if (cycle_state == 0) {
 		for (i = 0; i < TRBS_PER_SEGMENT; i++)
-			seg->trbs[i].link.control |= cpu_to_le32(TRB_CYCLE);
+			seg->trbs[i].link.control = cpu_to_le32(TRB_CYCLE);
 	}
 	seg->dma = dma;
 	seg->next = NULL;