[PATCH linux dev-5.3 5/7] fsi: aspeed: Avoid copying read data twice

Joel Stanley joel at jms.id.au
Fri Oct 25 12:03:49 AEDT 2019


Signed-off-by: Joel Stanley <joel at jms.id.au>
---
 drivers/fsi/fsi-master-aspeed.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c
index 58b090e2cf46..c98b1bf179a8 100644
--- a/drivers/fsi/fsi-master-aspeed.c
+++ b/drivers/fsi/fsi-master-aspeed.c
@@ -303,20 +303,17 @@ static int aspeed_master_read(struct fsi_master *master, int link,
 {
 	struct fsi_master_aspeed *aspeed = to_fsi_master_aspeed(master);
 	int ret;
-	u32 data;
 
 	if (id != 0)
 		return -EINVAL;
 
 	addr += link * FSI_HUB_LINK_SIZE;
-	ret = opb_read(aspeed->base, fsi_base + addr, size, &data);
+	ret = opb_read(aspeed->base, fsi_base + addr, size, val);
 
 	ret = check_errors(aspeed, ret);
 	if (ret)
 		return ret;
 
-	memcpy(val, &data, size);
-
 	return 0;
 }
 
-- 
2.23.0



More information about the openbmc mailing list