From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966089AbbBCFgK (ORCPT ); Tue, 3 Feb 2015 00:36:10 -0500 Received: from ozlabs.org ([103.22.144.67]:49889 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966055AbbBCFgE (ORCPT ); Tue, 3 Feb 2015 00:36:04 -0500 From: David Gibson To: benh@kernel.crashing.org, mpe@ellerman.id.au, paulus@samba.org, agraf@suse.de Cc: aik@ozlabs.ru, mdroth@us.ibm.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, David Gibson , Shawn Guo , Sascha Hauer Subject: [PATCH 3/5] powerpc: Remove arch specific byteswappers from the MXC MMC driver Date: Tue, 3 Feb 2015 16:36:23 +1100 Message-Id: <1422941785-22557-4-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422941785-22557-1-git-send-email-david@gibson.dropbear.id.au> References: <1422941785-22557-1-git-send-email-david@gibson.dropbear.id.au> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the MXC MMUC driver is used on a Freescale MPC512x machine, it contains some additional byteswapping code (I'm assuming this is a workaround for a hardware defect). This uses the ppc specific st_le32() function, but there's no reason not to use the generic swab32() function instead. gcc is capable of generating the efficient ppc byte-reversing load/store instructions without the arch-specific helper. This patch, therefore, switches to the generic byteswap routine. Cc: Shawn Guo Cc: Sascha Hauer Signed-off-by: David Gibson --- drivers/mmc/host/mxcmmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index 5316d9b..317d709 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c @@ -281,7 +281,7 @@ static inline void buffer_swap32(u32 *buf, int len) int i; for (i = 0; i < ((len + 3) / 4); i++) { - st_le32(buf, *buf); + *buf = swab32(*buf); buf++; } } -- 2.1.0