Commit 350fcdb8 authored by Dan Carpenter's avatar Dan Carpenter Committed by Kalle Valo

rsi: remove unecessary PTR_ALIGN()s

The issue here is that we allocate "data" and then set
"data = PTR_ALIGN(data, 8);" and then we free the aligned pointer
instead of the original pointer.

kmalloc() pointers are already ARCH_SLAB_MINALIGN aligned which is 8 or
more on everything except certain Xtensa variants.  We decided that if
the Xtensa people ever notice a bug here then we'll tell them the bug is
on their side.  ;)
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 4fd6c476
...@@ -660,8 +660,6 @@ static int rsi_sdio_master_reg_read(struct rsi_hw *adapter, u32 addr, ...@@ -660,8 +660,6 @@ static int rsi_sdio_master_reg_read(struct rsi_hw *adapter, u32 addr,
if (!data) if (!data)
return -ENOMEM; return -ENOMEM;
data = PTR_ALIGN(data, 8);
ms_addr = (addr >> 16); ms_addr = (addr >> 16);
status = rsi_sdio_master_access_msword(adapter, ms_addr); status = rsi_sdio_master_access_msword(adapter, ms_addr);
if (status < 0) { if (status < 0) {
...@@ -724,8 +722,6 @@ static int rsi_sdio_master_reg_write(struct rsi_hw *adapter, ...@@ -724,8 +722,6 @@ static int rsi_sdio_master_reg_write(struct rsi_hw *adapter,
if (!data_aligned) if (!data_aligned)
return -ENOMEM; return -ENOMEM;
data_aligned = PTR_ALIGN(data_aligned, 8);
if (size == 2) { if (size == 2) {
*data_aligned = ((data << 16) | (data & 0xFFFF)); *data_aligned = ((data << 16) | (data & 0xFFFF));
} else if (size == 1) { } else if (size == 1) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment