Thread (37 messages) 37 messages, 4 authors, 2022-01-20

Re: [PATCH v3 5/9] brcmfmac: pcie: Replace brcmf_pcie_copy_mem_todev with memcpy_toio

From: Arend van Spriel <arend.vanspriel@broadcom.com>
Date: 2022-01-19 12:36:18
Also in: linux-acpi, linux-devicetree, linux-wireless, lkml

On 1/17/2022 3:29 PM, Hector Martin wrote:
The alignment check was wrong (e.g. & 4 instead of & 3), and the logic
was also inefficient if the length was not a multiple of 4, since it
would needlessly fall back to copying the entire buffer bytewise.

We already have a perfectly good memcpy_toio function, so just call that
instead of rolling our own copy logic here. brcmf_pcie_init_ringbuffers
was already using it anyway.

Fixes: 9e37f045d5e7 ("brcmfmac: Adding PCIe bus layer support.")
Reviewed-by: Linus Walleij <redacted>
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
quoted hunk ↗ jump to hunk
Signed-off-by: Hector Martin <redacted>
---
  .../broadcom/brcm80211/brcmfmac/pcie.c        | 48 ++-----------------
  1 file changed, 4 insertions(+), 44 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
index b1ae6c41013f..c25f48db1f60 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
@@ -12,6 +12,7 @@
  #include <linux/interrupt.h>
  #include <linux/bcma/bcma.h>
  #include <linux/sched.h>
+#include <linux/io.h>
As brcmf_pcie_init_ringbuffers was already using it I suppose this was 
already implicitly included. Still good to make it explicit.
  #include <asm/unaligned.h>
  
  #include <soc.h>

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help