From patchwork Thu Nov 19 10:42:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 546385 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 0704C141434 for ; Thu, 19 Nov 2015 21:42:50 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933795AbbKSKmq (ORCPT ); Thu, 19 Nov 2015 05:42:46 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:59497 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932541AbbKSKmo (ORCPT ); Thu, 19 Nov 2015 05:42:44 -0500 Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0LbIy2-1afXv82Pgg-00kvAI; Thu, 19 Nov 2015 11:42:32 +0100 From: Arnd Bergmann To: netdev@vger.kernel.org, David Miller Cc: will.deacon@arm.com, ard.biesheuvel@linaro.org, Grant Grundler Subject: [PATCH] net: tulip: turn compile-time warning into dev_warn() Date: Thu, 19 Nov 2015 11:42:26 +0100 Message-ID: <9720627.53btSdPcQU@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:1zPpqoURCYX+BVMJwM0DX/GaQmwa/nu0Pyz5pbmGiw1GAUAfYfc RSXXPR0CqDxI1F4CCFc6EKBueL4chUO16KBRUe7uoriE6cdP1yT4/BvdYh0RHig0xiSk2Cs NRp9PfwRdUSRNuQkpMmN1eL9/ekgFT2xZy8VDPpkjWCouJPmEtb+7lQrZVBdxymOBoUPAQ5 2Pg9P1wjtqRXtdg3dpDCg== X-UI-Out-Filterresults: notjunk:1; V01:K0:lacB/zigmqg=:YXGAolaV4A5V/wgP9OhXsl RxRWP1ajg6M4kQdV/Li9tUavizIZyZ/Jzi42agqKwOFYKjvYSQ9udiltPm9tb0Y8rzfY7DcUo GExHd9Zhmr5/P/M05BCWILSAn4c6u8Cr0BFrNbpPDEyVepwQumlYy0i4/lBc8qvBWzfa+Icab LONrXDTZjBsUDl8mYvwaEeycp28JKOA+eBcXI9Q7dKd5xXs1UaLEgPZcAdqpdqZiDW3ibo+9d aNsbkJlDVPo6rV4YEGzOJyuJ4jink+q4LGtZutI/AkuGlACGgqDf4k+1dFA0DzJpkW0Uwfu5q yZmIeTXBrqaPByM+hdCzBbXF/lx9R+efceFawFqsF94cAOqpLDX0AbcuqV3PA+G3qAnDBBzLf qf75IoUNAcxp0qjeUVd/6remt6Aq8SLWAs3cLgy+PZ939mzWFC0OyHoep1fFYqKF78CiAakUo NfRnOYF6d1YJeWmRt257hgv7FWzBuhZ8pjTeRPACpQ1qOmPdNvli+LXGYL/giPfCk8ShT1H3i XLRXJq9KrunfD6/pOIGT3KiazrouQlFi9UP2Dk1cs+eYp6Q7UOqm4Dlr2lNIc0LIECyPoRzvF 2rOStgWDYWzHuxzEcTZs15ayCCZG9xT2rob+6E3Dur/wmyFEc07eGMWUDFo5nzDkYKEiAoxgJ G/AbKirRg6r03qkaNNIfWOYy81xRALBMEN8Dd2SFL0i7b/C1s+vaT2n7skp/2ms6jjgmTnWNr zlE0xpiR7li7RnAe Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The tulip driver causes annoying build-time warnings for allmodconfig builds for all recent architectures: dec/tulip/winbond-840.c:910:2: warning: #warning Processor architecture undefined dec/tulip/tulip_core.c:101:2: warning: #warning Processor architecture undefined! This is the last remaining warning for arm64, and I'd like to get rid of it. We don't really know the cache line size, architecturally it would be at least 16 bytes, but all implementations I found have 64 or 128 bytes. Configuring tulip for 32-byte lines as we do on ARM32 seems to be the safe but slow default, and nobody who cares about performance these days would use a tulip chip anyway, so we can just use that. To save the next person the job of trying to find out what this is for and picking a default for their architecture just to kill off the warning, I'm now removing the preprocessor #warning and turning it into a pr_warn or dev_warn that prints the equivalent information when the driver gets loaded. Signed-off-by: Arnd Bergmann Acked-by: Grant Grundler --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ethernet/dec/tulip/tulip_core.c b/drivers/net/ethernet/dec/tulip/tulip_core.c index ed41559bae77..b553409e04ad 100644 --- a/drivers/net/ethernet/dec/tulip/tulip_core.c +++ b/drivers/net/ethernet/dec/tulip/tulip_core.c @@ -98,8 +98,7 @@ static int csr0 = 0x01A00000 | 0x4800; #elif defined(__mips__) static int csr0 = 0x00200000 | 0x4000; #else -#warning Processor architecture undefined! -static int csr0 = 0x00A00000 | 0x4800; +static int csr0; #endif /* Operational parameters that usually are not changed. */ @@ -1982,6 +1981,12 @@ static int __init tulip_init (void) pr_info("%s", version); #endif + if (!csr0) { + pr_warn("tulip: unknown CPU architecture, using default csr0\n"); + /* default to 8 longword cache line alignment */ + csr0 = 0x00A00000 | 0x4800; + } + /* copy module parms into globals */ tulip_rx_copybreak = rx_copybreak; tulip_max_interrupt_work = max_interrupt_work; diff --git a/drivers/net/ethernet/dec/tulip/winbond-840.c b/drivers/net/ethernet/dec/tulip/winbond-840.c index 9beb3d34d4ba..3c0e4d5c5fef 100644 --- a/drivers/net/ethernet/dec/tulip/winbond-840.c +++ b/drivers/net/ethernet/dec/tulip/winbond-840.c @@ -907,7 +907,7 @@ static void init_registers(struct net_device *dev) #elif defined(CONFIG_SPARC) || defined (CONFIG_PARISC) || defined(CONFIG_ARM) i |= 0x4800; #else -#warning Processor architecture undefined + dev_warn(&dev->dev, "unknown CPU architecture, using default csr0 setting\n"); i |= 0x4800; #endif iowrite32(i, ioaddr + PCIBusCfg);