Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp16900imm; Fri, 21 Sep 2018 08:59:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYfykW96pxKSVeQ1+kmwk4KR85/2V0v+e4fxSGvf60BEnPD9tP4bsBe1YXDI6Zl2ok8FEM4 X-Received: by 2002:a17:902:9307:: with SMTP id bc7-v6mr44502575plb.225.1537545579912; Fri, 21 Sep 2018 08:59:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537545579; cv=none; d=google.com; s=arc-20160816; b=S7ymKX2QNs2DBV9+HED7WesvQrYKSyua+0d1oygbLtQMDwupeM5ASQoMrqGit7TWeb t47wgi9cyr4kTW1HwdXE1WqU/L/tj0eN6qrzb1NO1dPQjlR4aeZ62bc2wSPd4VfaxJm5 UJn8dNYFJBrPoe/qFXeG/NO+1y09ppREcXHhClD2/RXkiiFOoFnY4V3pp6uWDSXLSBEX 6OWQX0xXVVvGqSFQ7W3ThGWuYMJr8Y5obqcXzpG6BeufD2mfc455QKgwJdRIt6mjeJ/5 eTnpLvtf2fGSz6VanZkrziz7vDbTmmdxAWCRcejo7Zzc5M39dS3yPT/3ewzB0AjE80qG XS5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject:reply-to :dkim-signature; bh=x+rWfUdwKlYZknzAWzY0HiIGAB8qhqrwyZJQahsLuB4=; b=hIhv3UajERqCHYCrdBzG/DYGwKVTELD0zD+BTu4HVtYd5Uc00lO+X+5joN0jpBoNVw 6PpNzYFGeuo0ruq+eqxzWKpuAlOB2/mhYIV0t5VJ6T5H5bgs0j4H33+JNo5QSKofd3LX sq4YZVYcVFgu3quNpL45+O6VmgLbn7D0/gmlvfV1wgGKxW5mdb/O/b5OWJ8ncFzhhMpx N+mXFVCjShUCHHjBteKWkQdRaQmFURUM5i5LaueoP4Q6fz2cKL4eeb4sN0RB9zLsYhEc TVPFvgXC47VTxOpIftFhTUCXg/n0IqlkbiJUQC0/HhWYYI2XFjAoiP2hSSKcGywDxRmS KhkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=KmCPIfmQ; 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 k11-v6si27178285pgj.688.2018.09.21.08.59.22; Fri, 21 Sep 2018 08:59:39 -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; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=KmCPIfmQ; 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 S2390381AbeIUVs1 (ORCPT + 99 others); Fri, 21 Sep 2018 17:48:27 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:46060 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728149AbeIUVs1 (ORCPT ); Fri, 21 Sep 2018 17:48:27 -0400 Received: from [192.168.0.23] (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 38C5B1280; Fri, 21 Sep 2018 17:58:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1537545534; bh=bg1ST8GqLxkmDBO4KFvn3FSPpC+3BWO8ba/H7GP95OQ=; h=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From; b=KmCPIfmQhxCjyO6wZ7Ya3p8hZsVOE1v2SLJWDE1W9dlZyWbxAowOQ/myYUTGYMzYJ 1mzji8vfqmwJmYRysU/lGmfDgJ6TEAy0GNEdnf1Is3qr6h51jFfccssLzBQWYSLe+5 G6XyDd3DjJLR+XIwA8rjr8QhMxVyhdJO4jdrS2bM= Reply-To: kieran.bingham+renesas@ideasonboard.com Subject: Re: [PATCH] kernel/bounds: Provide prototype for foo To: Greg Kroah-Hartman Cc: Andrew Morton , linux-renesas-soc@vger.kernel.org, stable@vger.kernel.org, Thomas Gleixner , Kate Stewart , Philippe Ombredanne , open list References: <20180921142234.16882-1-kieran.bingham+renesas@ideasonboard.com> <20180921144527.GB16316@kroah.com> From: Kieran Bingham Organization: Ideas on Board Message-ID: <6436e493-a3e4-7f9e-da1f-9db50643dff8@ideasonboard.com> Date: Fri, 21 Sep 2018 16:58:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180921144527.GB16316@kroah.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, Thank you for quick response! On 21/09/18 15:45, Greg Kroah-Hartman wrote: > On Fri, Sep 21, 2018 at 03:22:33PM +0100, Kieran Bingham wrote: >> kernel/bounds.c is recompiled on every build, and shows the following >> warning when compiling with W=1: So it turns out after a bit more checking that my statement above was a small lie :) My local build scripts were *causing* kernel/bounds.s to be rebuilt on every build, which is why this stood out to me - because of two competing compiles for the kernel image, and the dtb. One with W=1 and the other without... (kbuild detected different flags, and thus rebuilt the common objects) And that's why I saw this warning on every build... and thought this was a hot-path. > Don't do that, you will get a lot of warnings that really don't make > much sense. Like this one :) I know - but I can ignore all on my first build, then on incremental builds where only files I change are compiled - it's much quieter :) I see it as a benefit to compile *my* code with a higher warning level, to prevent /me/ adding further warnings. I realise of course this patch is just pandering to the compiler to shut it up, as this is essentially an 'unused' dummy function from it's perspective. But in this instance, it's because the output is being compiled to an assembly output (kernel/bounds.s) which is then later parsed, so there isn't anywhere else to define the prototype, and the object code is only referenced from the assembly output. >> >> CC kernel/bounds.s >> linux/kernel/bounds.c:16:6: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes] >> void foo(void) >> ^~~ >> >> Provide a prototype to satisfy the compiler. >> >> Signed-off-by: Kieran Bingham >> Cc: stable@vger.kernel.org >> >> --- >> I compile all of my incremental builds with W=1, which allows me to know >> instantly if I add a new compiler warning in code I generate. >> >> This warning always comes up and seems trivial to clean up. >> --- >> kernel/bounds.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/kernel/bounds.c b/kernel/bounds.c >> index c373e887c066..60136d937800 100644 >> --- a/kernel/bounds.c >> +++ b/kernel/bounds.c >> @@ -13,6 +13,8 @@ >> #include >> #include >> >> +void foo(void); >> + >> void foo(void) > > This file is a userspace tool that is used to later generate the > include/generated/bounds.h file. Well more accurately it is a file compiled directly to assembly which is then later parsed to help generate the bounds.h file. It's not itself a userspace tool, nothing executes this code... It's just a compilation object to allow utilisation of the preprocessor and compiler in ways that couldn't be done otherwise as far as I understand it. > If you really want to track this down and fix it properly, put the > prototype in the .c file that ends up calling this function. That's a > fun task to dig through the build system to find :) This is the only location. The compilation output from V=1 (https://paste.debian.net/1043598/ for the full output) shows the command generating this warning as: (with many flags redacted for readability) aarch64-linux-gnu-gcc -Wp,-MD,kernel/.bounds.s.d -nostdinc -Wall -Wstrict-prototypes -DKBUILD_BASENAME='"bounds"' -DKBUILD_MODNAME='"bounds"' -fverbose-asm -S -o kernel/bounds.s kernel/bounds.c I still feel this patch has 'some' merit with the inaccurate leading statement regarding this being output on every build removed from the commit log. What do you think ? Worth a v2 with commit message fixed? Or should I just drop this ? > good luck! > > greg k-h -- Cheers Kieran