Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp119614lqo; Thu, 9 May 2024 14:42:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWtFjYg35N3kYHo19DkU3sK18ITazW6Ls1ksgBERMHwj+53pwJihQMKa54yHIMp8UhzQTGkmPINuZXTeBJOBN7e+E1pyf312wVXzlDsmA== X-Google-Smtp-Source: AGHT+IHnFsFqvgWuR1U/pbtyEhMCXk8M0SPgKkf857Cz1KTXM9kFz3J0CoJnrbFUv1IoCkKY/cn6 X-Received: by 2002:a05:6870:2153:b0:23e:111:cf21 with SMTP id 586e51a60fabf-24172a7dd70mr1047817fac.13.1715290943394; Thu, 09 May 2024 14:42:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715290943; cv=pass; d=google.com; s=arc-20160816; b=e8xgCG69u+gLu19R6SbZmxaQ08FHFgjGWrJ6BITZLS7k3VXwf5qucl9jwE6LbC6l1Y Qx+mPtv7TJLOVqIHMWhN73WfBZXNt23+wXVJT75pVXkmJoqKS3H5Hc0Tl5luKrIWOaRB jHX9lyZmu+79BKFm0hXvvNJMoGUFQ+TLE9yO26ucy8kGKRngZUBfJpA3kOEAzroK2b/j fHrjgcUExIpJIfjpiq/+GVSgpKPHQPklT7FZLIKTcN/A/7/2PRCgw4tpLogyfbfCDw/s VPTwZznD00f3bflgVx8he7ZY39CzTO+qTBDAz+71THKRNIp9gRF4WPvQOxQ5+HHD3ChE sVLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=mWiEw6OZOjWrMlF7JIfpMQ4VjNqi64jS5UnPYz95OZ8=; fh=1YlDE1FhbPL5arQDPqt3rtreLtBLw1wp2rCmAR8Uj9Q=; b=qbRokDVBrMRTemymUHcpxv61YNRmCAC/KL13HPSJgaswMdjxE/5OIrhPy3k7itme5L f5OSDfajx/JbafPaqiBMFB3O3lugNa7vL4TPcyMlSqEHK2fnGmKbUW5A3ER2f6LPT+f2 UUVwjKOzS/qbzYt3Aumzq8CdUQEXuDK7cw3EOoeZK9vgnX1QvKU/XG4zdzNA+YKvw9lM bkRXKuIri8yJ/z6G0aWatWbfpqWUxf3/gi1GWOZjx79NrojAayQsrrzH5YWXAzYNYusI 2m98ZAgqDoEVajuERBZZCLuOB+6rA0iiP/2MZIslGVzm6i1sVXhaiXdQAvVHkIAfrF6u HhYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@toblux-com.20230601.gappssmtp.com header.s=20230601 header.b=eTVqphzn; arc=pass (i=1 dkim=pass dkdomain=toblux-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-175005-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175005-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-792bf277e6asi249335485a.50.2024.05.09.14.42.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 14:42:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175005-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@toblux-com.20230601.gappssmtp.com header.s=20230601 header.b=eTVqphzn; arc=pass (i=1 dkim=pass dkdomain=toblux-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-175005-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175005-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 205D61C21C90 for ; Thu, 9 May 2024 21:42:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D7F39128835; Thu, 9 May 2024 21:42:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toblux-com.20230601.gappssmtp.com header.i=@toblux-com.20230601.gappssmtp.com header.b="eTVqphzn" Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49BB085264 for ; Thu, 9 May 2024 21:42:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715290933; cv=none; b=APdez6dlGzOEXbeYZpmosF1e0D7ASqwS6XgsvZ+lXKch014u04Zu07C6XAVr9LL7mt8M81SpjbBZzuUFYxn3ri8V7VGHMuXmNLBGUIFhhUps2MQoj0iZajHkMDFyJgeayphfmCToQZyEf2AOWyHFUT488zSy43R6Mtg/owes8lA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715290933; c=relaxed/simple; bh=wP+7wj0GQxTLjS1RBn+5MHXwXji8frVrT0a+yqSGftI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=j6HeQkGeMqiVttMja5U9JJsY7lU3+LteCqzmxVXZgYJxBfeRsgYgpNOI/SfxnXpsTu/2fnlVTmoexjko+vsdib5oZPju/FGfxAUdqP8zSvP2cyjP+YfQ1jSAuuea6/FubhuCMI7FJfDsdkH2JUYEZh+r+VmrZWnSM4xPeZfX//k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toblux.com; spf=none smtp.mailfrom=toblux.com; dkim=pass (2048-bit key) header.d=toblux-com.20230601.gappssmtp.com header.i=@toblux-com.20230601.gappssmtp.com header.b=eTVqphzn; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toblux.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=toblux.com Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a59a352bbd9so241514966b.1 for ; Thu, 09 May 2024 14:42:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toblux-com.20230601.gappssmtp.com; s=20230601; t=1715290929; x=1715895729; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mWiEw6OZOjWrMlF7JIfpMQ4VjNqi64jS5UnPYz95OZ8=; b=eTVqphznEInDiS0VczP2VH9UF64/BJfL7J8XhAWxO57KqR8nM9Y+bdEcdMyBeRLpGO FqEih12Qf+pWy1tJ2TEspOFyl9IxqiNMAFJzzLNsNizHu4HFP9edfEJH1+1/RrYTe2al HGveGpWjcynEkH5L1g2f71izsxYZPr/dSUcxfmiTma3KYoaZqKmxyNeh926LdoF3xVoD nFTI124ZrMkDlYKeq1MMFQK8bw1ihoIbXkdCd3xQw9GPp2UoVapytDiYmFCe+dTetnF8 JAbu9x4GGg4+cLPMWElH6S1V/ob93h1wuOwzdyTq4PDR7ZGKg7yMvgdnCZY9PB42FWPJ KXvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715290929; x=1715895729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mWiEw6OZOjWrMlF7JIfpMQ4VjNqi64jS5UnPYz95OZ8=; b=NcVLRDup3thOTNA9jShSE/MFGj6mkoizmXwob+FmwNXSATpaVom3DvA8NReAJagx3f VWXquMt6dO2M0htFIQkc/WKL4ArhDhLYIyGLC368r2gR3DG8xcPtv5uxsDJDpF4vQazH lMuZ3HKQ8N1cFPoeswhT7NMDipWrX6MOShlhEN2E/FrUlEH5JSSxwZ7RdCx9Yax4ojXB 10nGPaafmVakj+0u3bPCiJdVMeBNXXuGXpkvTOl6n/eiPAqLFAUhCTT8rZ2vOzFjgY4c tE2j0u1t4VWBm8EwWX0wFJRfT4Zhlx6UFyJ2bszalkcqkCpILDB9sZt6Z4L2a9+SGaOo rxKw== X-Forwarded-Encrypted: i=1; AJvYcCUq40TGPzjtpJauxTC0wV4zUicH64Dx8NXn4q5Qg5CopUd6Mn91gSHO2re9LuebPfAjjFC9OTysC7UZvAbubiGfePbXBYWmri+WUzGV X-Gm-Message-State: AOJu0YyOBtJa1LW1rM0LL6T737kyDiest/IzmzFHZK9BFoR6DeaYQ9eV hk0GM/d1k1C3suvpBW75FaNPUc60jdKuMTRQul4hnQaqV/NCCkVQk4YZxUEY3pg= X-Received: by 2002:a17:906:5613:b0:a59:ccc3:544 with SMTP id a640c23a62f3a-a5a1155b4f4mr356392966b.2.1715290929531; Thu, 09 May 2024 14:42:09 -0700 (PDT) Received: from fedora.fritz.box (aftr-62-216-208-100.dynamic.mnet-online.de. [62.216.208.100]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a17b01598sm116496666b.178.2024.05.09.14.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 14:42:09 -0700 (PDT) From: Thorsten Blum To: arnd@arndb.de Cc: davem@davemloft.net, edumazet@google.com, gerg@linux-m68k.org, glaubitz@physik.fu-berlin.de, kuba@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, nico@fluxnic.net, pabeni@redhat.com, thorsten.blum@toblux.com, andrew@lunn.ch Subject: [PATCH v2] net: smc91x: Fix m68k kernel compilation for ColdFire CPU Date: Thu, 9 May 2024 23:37:45 +0200 Message-ID: <20240509213743.175221-3-thorsten.blum@toblux.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <2ef3df08-ffc7-4925-82bf-0813c8b0b439@app.fastmail.com> References: <2ef3df08-ffc7-4925-82bf-0813c8b0b439@app.fastmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compiling the m68k kernel with support for the ColdFire CPU family fails with the following error: In file included from drivers/net/ethernet/smsc/smc91x.c:80: drivers/net/ethernet/smsc/smc91x.c: In function ‘smc_reset’: drivers/net/ethernet/smsc/smc91x.h:160:40: error: implicit declaration of function ‘_swapw’; did you mean ‘swap’? [-Werror=implicit-function-declaration] 160 | #define SMC_outw(lp, v, a, r) writew(_swapw(v), (a) + (r)) | ^~~~~~ drivers/net/ethernet/smsc/smc91x.h:904:25: note: in expansion of macro ‘SMC_outw’ 904 | SMC_outw(lp, x, ioaddr, BANK_SELECT); \ | ^~~~~~~~ drivers/net/ethernet/smsc/smc91x.c:250:9: note: in expansion of macro ‘SMC_SELECT_BANK’ 250 | SMC_SELECT_BANK(lp, 2); | ^~~~~~~~~~~~~~~ cc1: some warnings being treated as errors The function _swapw() was removed in commit d97cf70af097 ("m68k: use asm-generic/io.h for non-MMU io access functions"), but is still used in drivers/net/ethernet/smsc/smc91x.h. Use ioread16be() and iowrite16be() to resolve the error. Signed-off-by: Thorsten Blum --- Changes in v2: - Use ioread16be() and iowrite16be() directly instead of re-adding _swapw() as suggested by Arnd Bergmann and Andrew Lunn --- drivers/net/ethernet/smsc/smc91x.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h index 46eee747c699..45ef5ac0788a 100644 --- a/drivers/net/ethernet/smsc/smc91x.h +++ b/drivers/net/ethernet/smsc/smc91x.h @@ -156,8 +156,8 @@ static inline void mcf_outsw(void *a, unsigned char *p, int l) writew(*wp++, a); } -#define SMC_inw(a, r) _swapw(readw((a) + (r))) -#define SMC_outw(lp, v, a, r) writew(_swapw(v), (a) + (r)) +#define SMC_inw(a, r) ioread16be((a) + (r)) +#define SMC_outw(lp, v, a, r) iowrite16be(v, (a) + (r)) #define SMC_insw(a, r, p, l) mcf_insw(a + r, p, l) #define SMC_outsw(a, r, p, l) mcf_outsw(a + r, p, l) -- 2.45.0