brcmfmac: pcie: Replace brcmf_pcie_copy_mem_todev with memcpy_toio
stable inclusion from stable-v5.10.110 commit 1cbcf93a93e5e4c19f89d9c01ae4c707efc6d301 bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=1cbcf93a93e5e4c19f89d9c01ae4c707efc6d301 -------------------------------- commit 9466987f upstream. 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: 9e37f045 ("brcmfmac: Adding PCIe bus layer support.") Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Reviewed-by: NArend van Spriel <arend.vanspriel@broadcom.com> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: NHector Martin <marcan@marcan.st> Signed-off-by: NKalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220131160713.245637-6-marcan@marcan.stSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NYu Liao <liaoyu15@huawei.com> Reviewed-by: NWei Li <liwei391@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录