From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C360C433E0 for ; Tue, 22 Dec 2020 23:53:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3832B22D57 for ; Tue, 22 Dec 2020 23:53:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3832B22D57 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BF40D6B007E; Tue, 22 Dec 2020 18:53:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BA4846B0080; Tue, 22 Dec 2020 18:53:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB9F36B0081; Tue, 22 Dec 2020 18:53:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id 934F16B007E for ; Tue, 22 Dec 2020 18:53:47 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5FC6C1EFD for ; Tue, 22 Dec 2020 23:53:47 +0000 (UTC) X-FDA: 77622573294.24.jar55_2800e9f27464 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 49BBF1A4A5 for ; Tue, 22 Dec 2020 23:53:47 +0000 (UTC) X-HE-Tag: jar55_2800e9f27464 X-Filterd-Recvd-Size: 3485 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Dec 2020 23:53:46 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id A40BC22B2D; Tue, 22 Dec 2020 23:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1608681225; bh=HWarrS6CziBbBzyDxCxnKusJ4RarklBqybLYalWUSa0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=synwhqm8/c7DFJaUZ7GKtJYIvYhcTKnqKRHDBtRLB1p4TFBL6s4LazB7x/xfX7i0E gPxTbPvfwlqkkoReusb8wwGRDsHi99Y/eq+Pg2Tr4o/R7j2hq7WClyv5+yR6lbcPRW cI2XxuOUJKI8LQgJFFo7RWPuSF9JP9Lf712ksIXg= Date: Tue, 22 Dec 2020 15:53:45 -0800 From: Andrew Morton To: Matthew Wilcox Cc: Souptick Joarder , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Alex Shi Subject: Re: [PATCH] mm: add prototype for __add_to_page_cache_locked() Message-Id: <20201222155345.e7086ad37967c9b7feae29e4@linux-foundation.org> In-Reply-To: <20201222204000.GN874@casper.infradead.org> References: <1608646792-29073-1-git-send-email-jrdr.linux@gmail.com> <20201222204000.GN874@casper.infradead.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 22 Dec 2020 20:40:00 +0000 Matthew Wilcox wrote: > On Tue, Dec 22, 2020 at 07:49:52PM +0530, Souptick Joarder wrote: > > Otherwise it cause gcc warning: > > ^~~~~~~~~~~~~~~ > > That line is just confusing. I cleaned up the changelog. It is presently : Subject: include/linux/mm.h: add prototype for __add_to_page_cache_locked() : : Otherwise it causes a gcc warning: : : ../mm/filemap.c:830:14: warning: no previous prototype for : `__add_to_page_cache_locked' [-Wmissing-prototypes] : : A previous attempt to make this function static led to compilation : errors for a few architectures, because __add_to_page_cache_locked() is : referred to by BPF code. : : Adding a prototype will silence the warning. > > --- a/include/linux/mm.h > > +++ b/include/linux/mm.h > > @@ -216,6 +216,12 @@ int overcommit_kbytes_handler(struct ctl_table *, int, void *, size_t *, > > loff_t *); > > int overcommit_policy_handler(struct ctl_table *, int, void *, size_t *, > > loff_t *); > > +/* > > + * Any attempt to mark this function as static leads to build failure > > + * for few architectures. Adding a prototype to silence gcc warning. > > + */ > > We don't need a comment here for this. The commit log is enough. I think it's OK - people do send patches which remove a prototype and also make the function static. A tree-wide grep would catch the bpf reference but I suspect people tend to grep for "foo(" rather then "foo". > > +int __add_to_page_cache_locked(struct page *page, struct address_space *mapping, > > + pgoff_t offset, gfp_t gfp, void **shadowp); > > Please name that 'index', not 'offset'. I too prefer index over offset. X1:/usr/src/linux-5.10> grep -r "pgoff_t offset" . | wc -l 52 X1:/usr/src/linux-5.10> grep -r "pgoff_t index" . | wc -l 250 But renaming this arg should be a separate patch. And I don't think we should be preparing large "rename offset to index" patches, please. The value/noise ratio is too low.