From patchwork Fri Oct 5 08:33:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 148156 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp166839lji; Fri, 5 Oct 2018 01:33:30 -0700 (PDT) X-Google-Smtp-Source: ACcGV60k1AMPjhzJIYHlI86MVlxODK2X/fAMaBqS+K3ejwDlaRLR1nS6IaDuXo39PP41Fr8qFQpv X-Received: by 2002:a62:adc:: with SMTP id 89-v6mr10822556pfk.56.1538728410531; Fri, 05 Oct 2018 01:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538728410; cv=none; d=google.com; s=arc-20160816; b=ZrDkKG7f4ZqP/rogjL6rmIczyJr7tA8kbwAB4WjREVIrUc8quoQ1PBQPDqRpVIAOIG ClEeiHW09J2TDoSWjmtdvSX88zuSCzOOS/JVOuX8tsQRy/0ST/IaEcKYKDMzi5odYkxQ 7Qdh0ogaKMrciPe/4k3ZH6WsktBhIyrZ9Kuw3J3SNafOSWsmRnJZmLDeB0TTrkXntlrO xsxYIrzM8bhrNdrzQRZ8DxYP3LwZgoqfPE2TSZqPKL0PCWfn2XWFYSjMgYo2FAR8UsNk U1c/tS7uLrJeRgqhFwvKq20Hd5x3MBrV94zfV2bNrX15Vp9852BwnV0itFqsXFb2w4TL U2LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=gJ85Fg73m4e6Gm/M1YhW+rfQgmuK06Ldyp1FksSka04=; b=bQocI2bBHoSzHQiXnwf5iI/ibVJdcDImOqr3qjmxNeQR1jUuNFOxmkpCD3RR/E+284 luRA7IwYJVDn9G2B7dKpiSmeoXLHSnB15/vUM9btN/EyAkhDktAnF3kugKfLjSlsuTQD sUcP8i2mV/HnY0k5lN2fYcCRj0SMmdOZ9Vpb6etqGQc/5u3MZlJf2fzz06dCuAq6cHoR fjFiFbiIQA4T5clBRUdMSaEVH0EM6T8KT45fXKsyEP11Z5Pbc0EQBllZTk5BmkggjUdy bkYuCET0TMo8nlLtc2kcdwK25wlOtDZrLe4XqptDHW4Og4tMb196MMctNi2mdt7AtMip 0D5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j189-v6si6744941pgd.476.2018.10.05.01.33.30; Fri, 05 Oct 2018 01:33:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728606AbeJEPbH (ORCPT + 32 others); Fri, 5 Oct 2018 11:31:07 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:53573 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727750AbeJEPbG (ORCPT ); Fri, 5 Oct 2018 11:31:06 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MsJXG-1fsc7G2Jli-00thjs; Fri, 05 Oct 2018 10:33:20 +0200 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MsJXG-1fsc7G2Jli-00thjs; Fri, 05 Oct 2018 10:33:20 +0200 From: Arnd Bergmann To: Andrew Morton Cc: linux-renesas-soc@vger.kernel.org, Kieran Bingham , stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, yamada.masahiro@socionext.com, Arnd Bergmann Subject: [PATCH] kbuild: fix kernel/bounds.c 'W=1' warning Date: Fri, 5 Oct 2018 10:33:13 +0200 Message-Id: <20181005083313.2088252-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180921142234.16882-1-kieran.bingham+renesas@ideasonboard.com> References: <20180921142234.16882-1-kieran.bingham+renesas@ideasonboard.com> X-Provags-ID: V03:K1:eSd4N3smMHCfUFjJFljqXtcK91JFZmx2RfcWSHInkLBfiD7xq5v P264HkIKnrVNh4BWEkE4PHYs5stZrJXLRICxtqFL7AJFD2ujiEQP10LG6VEdC84Ln2wpkFk X2iUIHAtxlCSHa323jMrdRQCzq+/aWTnS4B9qZnByyeVl6d9IaDE0lstRH5Dj6LESTrcqsf jQR8Gh9qBSnr5Uk7DCr0g== X-UI-Out-Filterresults: notjunk:1; V01:K0:d/K1V4pDUnc=:3Rl49oCLPskCTsCWUhET/Y eKsqj02irIOQNE4RjLVw5XKTNDCgGbKFNv/pPce0wfisGvej37ZCs6DjKg32JaIExL+yCk0g9 XLLZ910t60mpQ5R53uA1VNps1m/hkid1CgwdHIbK/Uc1wUHtumV1q0pxPwDgNt1AA8si/wae1 g/Ob+SWFE2ENq0+/ap94w9Xg9InfHyaQ84sFND8Xzy1mGrB2cup+MGIDgVpQi+QD7HKjRfq6f EcxFBccXtNxRQ9HzIwoG6fc9qDox7eYd68B1DbNuxqL6pp4nAGbDUZR5baDG7I0vJDGOiAVKH uqUrOtC4tRdcxP0m4U+lnBKRcGwic0WRSfPJKlqcMPFjcOi4hHgjthqS5+3qM9ghA8Y8bVix2 TBFUSD9TdW0yNngeKAEeCdVBbVi6Pft7DyoDQOK8FHia0Kpe72gjTCdEyVouGEohqhLJQ954T GFQZQOxGrgxMBXhLDhuHvcaLg7iMOK+CeHSY4XZ74Ypj713I6S9hRQ2oGmG4hI8ngqbMDhuak KkkYgEtBYzoRNsbCdkae44tkvPVu2bQLH92vSJiHbJAZMwTUbCSTLxE5ECFwS2I9LRBQtO6N1 LDdQQ6GD2SD5OcXrEfBkYDVKOsXOu+n9vgKPvtg/+JVmxupt4xHVAdpT0uvyxAE/LU1sPE9ii YCV98HLq+QLSkArfZgNaQ/Yz5HCyITcx/ldvlUBXy2CLtdXz0moAa+1qmHwuYL0x22p0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Building any configuration with 'make W=1' produces a warning: kernel/bounds.c:16:6: warnign: no previous prototype for 'foo' [-Wmissing-prototypes] When also passing -Werror, this prevents us from building any other files. Nobody ever calls the function, but we can't make it 'static' either since we want the compiler output. Calling it 'main' instead however avoids the warning, because gcc does not insist on having a declaration for main. Reported-by: Kieran Bingham Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann --- I have run into this problem several times before, and thought I had sent a fix at some point. Looking in the archives, I came across the suggested fix from Kieran, so I'm following up on that here. --- kernel/bounds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.18.0 Reviewed-by: Kieran Bingham diff --git a/kernel/bounds.c b/kernel/bounds.c index c373e887c066..9795d75b09b2 100644 --- a/kernel/bounds.c +++ b/kernel/bounds.c @@ -13,7 +13,7 @@ #include #include -void foo(void) +int main(void) { /* The enum constants to put into include/generated/bounds.h */ DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS); @@ -23,4 +23,6 @@ void foo(void) #endif DEFINE(SPINLOCK_SIZE, sizeof(spinlock_t)); /* End of constants */ + + return 0; }