From patchwork Sat Jun 2 19:37:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10444979 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 590246028E for ; Sat, 2 Jun 2018 19:37:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 476C1289FA for ; Sat, 2 Jun 2018 19:37:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BE0928AB8; Sat, 2 Jun 2018 19:37:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78AB8289FA for ; Sat, 2 Jun 2018 19:37:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751818AbeFBThq (ORCPT ); Sat, 2 Jun 2018 15:37:46 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:39184 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751814AbeFBThp (ORCPT ); Sat, 2 Jun 2018 15:37:45 -0400 Received: by mail-lf0-f65.google.com with SMTP id t134-v6so19491360lff.6 for ; Sat, 02 Jun 2018 12:37:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=6EUXHZq9UA9UCQOJ9wErog9J98Vd8YO5z3ygZ1WNF8M=; b=kK2qERIJVy/Fej43YRMssLRPCfzqJgLQ39kw5c8WXAdjrjHIR3vc/tenkT1wFSg71M FoDp84n6h2qLoweHr0Zq95c8QNEDOX2J0D+f2dMB8nR9twhqchS7goStE7JVi5o/a23m 47Nyx3ywg35Dz3DPuuldni6XVmQkOPp5VSPyGV+E1FTINVtQBaXWSKz20EsAqSOkTEUf u7ysAq+jGSW+w/4JnG0m7TDMpNI+7+XJeLSTONOL/CEy7uVUsEBBGCWVRgETD1+am4k0 ZzVc5nEm9JQDSL19h1pF8mxHMJiMdy30HhAT/3NhSzh2XGi4gyq/DZpPVHuhXf+41fzi nAxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=6EUXHZq9UA9UCQOJ9wErog9J98Vd8YO5z3ygZ1WNF8M=; b=Y9HhLGoZha/C2yxvf1dn7bE2iJ3bfT5x2ceBgH4jze0ZbD9EZgktOdvU7o0uU3BDjs LelZrfsh+XbJMngBo9EjG6kl5tgYbAjYvzzdxO32Kz1urI6zJh5RAjMbObs0uRBrGx6Y SL5GB1MyZNZSc3qYl1lHVOG1ip3GAucO90SAHS6UGH9zaosGh7M5ZQRNkr2mzOlyT7Dn GwlX+EcAhGcOJ9SDh3dMPqBMniRHmdPV+JzsuZpFOSA0m5R0PheS70qrIVxEawxe61BT ICBTyKznLuysWcyNaG8rF1Ae9s/T4bl6qrsSaXys9B14t5AmM2Or4RpdCDx3h2a2mpAy kCfQ== X-Gm-Message-State: ALKqPwfPnI6K1H1oPyLDZSvr4YAXDTjLK9swuN3wHe87uUWuLv+YYzlY 2Gt9pW9hMrj7XM5T+F2v5A9CmLgI1Mc= X-Google-Smtp-Source: ADUXVKIuJsI0N+owmOOZqNJMUQnMzfvrEMftyAtjWfnclUM+ReJyTQjDGWAR3z6iYGaaF75ei9MEQg== X-Received: by 2002:a2e:42d2:: with SMTP id h79-v6mr11910491ljf.26.1527968263704; Sat, 02 Jun 2018 12:37:43 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.80.175]) by smtp.gmail.com with ESMTPSA id 23-v6sm9445709lfw.64.2018.06.02.12.37.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Jun 2018 12:37:42 -0700 (PDT) Subject: [PATCH 1/3] sh_eth: make sh_eth_soft_swap() work on ARM From: Sergei Shtylyov To: netdev@vger.kernel.org, "David S. Miller" Cc: linux-renesas-soc@vger.kernel.org References: <9027499a-0e19-7721-a17f-26e86885da3f@cogentembedded.com> Organization: Cogent Embedded Message-ID: Date: Sat, 2 Jun 2018 22:37:42 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <9027499a-0e19-7721-a17f-26e86885da3f@cogentembedded.com> Content-Language: en-MW Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Browsing thru the driver disassembly, I noticed that ARM gcc generated no code whatsoever for sh_eth_soft_swap() while building a little-endian kernel -- apparently __LITTLE_ENDIAN__ was not being #define'd, however it got implicitly #define'd when building with the SH gcc (I could only find the explicit #define __LITTLE_ENDIAN that was #include'd when building a little-endian kernel). Luckily, the Ether controller only doing big- endian DMA is encountered on the early SH771x SoCs only and all ARM SoCs implement EDMR.DE and thus set 'sh_eth_cpu_data::hw_swap'. But anyway, we need to fix the #ifdef inside sh_eth_soft_swap() to something that would work on all architectures... Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven --- drivers/net/ethernet/renesas/sh_eth.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: net-next/drivers/net/ethernet/renesas/sh_eth.h =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.h +++ net-next/drivers/net/ethernet/renesas/sh_eth.h @@ -562,7 +562,7 @@ struct sh_eth_private { static inline void sh_eth_soft_swap(char *src, int len) { -#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN u32 *p = (u32 *)src; u32 *maxp; maxp = p + ((len + sizeof(u32) - 1) / sizeof(u32));