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.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 8DADEC433DB for ; Tue, 22 Dec 2020 20:40:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 734E4224F4 for ; Tue, 22 Dec 2020 20:40:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 734E4224F4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C3C508D000E; Tue, 22 Dec 2020 15:40:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BECA58D0003; Tue, 22 Dec 2020 15:40:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B01AB8D000E; Tue, 22 Dec 2020 15:40:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0254.hostedemail.com [216.40.44.254]) by kanga.kvack.org (Postfix) with ESMTP id 9B70B8D0003 for ; Tue, 22 Dec 2020 15:40:05 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 5DE8F3638 for ; Tue, 22 Dec 2020 20:40:05 +0000 (UTC) X-FDA: 77622085170.01.trick34_511143e27462 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 314891004A313 for ; Tue, 22 Dec 2020 20:40:05 +0000 (UTC) X-HE-Tag: trick34_511143e27462 X-Filterd-Recvd-Size: 3479 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Dec 2020 20:40:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=tQUpm8etH6snW7WfiSHzS0QYahDTXLO8tTkPD0yqoA8=; b=RpxeFr5fCcqPuMAQnJ1AEpis3c Uo7BAVoGmBcllP1SzDaJt6IpQzBa50AB2BJUy/57FHoKe40nvWd7Eiez9vC08NqKSGVysAlUjQqeA PWZ3ZDu/VmIgOH1UfqcyvulBLhOFFz8mrjEK/yn7zfNazRKBHI5wCSAUUKkUl5OuUu97mUWfY+/XM lTuZpDKvGHcStdHGo+Goe2aZOn6MVKbo5QGPJ3JYMPlBZAblLMy2ueCEiKmuPs8yKlSAsAW/Owfta NTBwAESFvYGFnah3R0YUCYJ7FZcQyHsxLjEcGk74T5ildogQJqXdJ2nT6pcHCqfMJSLJyoB4PkzNM 0GjR/e4A==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kroRs-0004Sj-Bf; Tue, 22 Dec 2020 20:40:00 +0000 Date: Tue, 22 Dec 2020 20:40:00 +0000 From: Matthew Wilcox To: Souptick Joarder Cc: akpm@linux-foundation.org, 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: <20201222204000.GN874@casper.infradead.org> References: <1608646792-29073-1-git-send-email-jrdr.linux@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1608646792-29073-1-git-send-email-jrdr.linux@gmail.com> Content-Transfer-Encoding: quoted-printable 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, Dec 22, 2020 at 07:49:52PM +0530, Souptick Joarder wrote: > Otherwise it cause gcc warning: > ^~~~~~~~~~~~~~~ That line is just confusing. > ../mm/filemap.c:830:14: warning: no previous prototype for > =E2=80=98__add_to_page_cache_locked=E2=80=99 [-Wmissing-prototypes] > noinline int __add_to_page_cache_locked(struct page *page, > ^~~~~~~~~~~~~~~~~~~~~~~~~~ And I don't think those two lines add much value, do you? > A previous attempt to make this function static leads to > compile error for few architectures. It might be better to say why it has to be non-static here (because it's an error injection point). And it's not architecture dependent (afaik), it's whether error injection is enabled in the config. > Adding a prototype will silence the warning. >=20 > Signed-off-by: Souptick Joarder > Cc: Alex Shi > Cc: Andrew Morton > --- > include/linux/mm.h | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 5299b90a..ac07f65 100644 > --- 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. > +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'.