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=-5.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 BEB73C7619B for ; Mon, 17 Feb 2020 02:58:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7FC2220857 for ; Mon, 17 Feb 2020 02:58:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="hrie61hL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FC2220857 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 1924F6B0003; Sun, 16 Feb 2020 21:58:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 143AF6B0005; Sun, 16 Feb 2020 21:58:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 031186B0007; Sun, 16 Feb 2020 21:58:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0061.hostedemail.com [216.40.44.61]) by kanga.kvack.org (Postfix) with ESMTP id DF20C6B0003 for ; Sun, 16 Feb 2020 21:58:02 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 961FC2C37 for ; Mon, 17 Feb 2020 02:58:02 +0000 (UTC) X-FDA: 76498109604.10.worm49_2913ac6c96d20 X-HE-Tag: worm49_2913ac6c96d20 X-Filterd-Recvd-Size: 4524 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Mon, 17 Feb 2020 02:58:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:References:Cc:To:From: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=fvW9MSMh9kEZIr51sUu4eHoff9LTnk1nQKXSASjslKo=; b=hrie61hLh+edr3TtebFbwpgPl1 nt6PxcIjub0RJAWUPgR3Uiy+7aWx/MwleItEHSIUvlUdgckrPXZ4A9PYpzZ/n7P8ujkG2z6FiagXj JBCpZx3QwznwO/iy6TnGWigigXoKpExoYNgAIVuMOxPFFeEJF+c9h+OHgzZ67RBPKn/Nh4lk622QH xkqDPEEu9KgzKfnDmo+4Gv2C1LxVBiaOIr45fafgZ0bqlEpRiZWWTN0M54kNRjj6LLTZzZZsEWLJS 763KQOfRRVFCyA9lxfCLC4BIGTUnyLmNEofyyS393enIFTEX0y6+2b5sWEWwKJeJwh4brr6HAeDsD ZX45Gccg==; Received: from [2601:1c0:6280:3f0::19c2] by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1j3WbW-0004N6-80; Mon, 17 Feb 2020 02:57:50 +0000 Subject: [PATCH] hugetlb: fix structs From: Randy Dunlap To: Mina Almasry Cc: linux-mm@kvack.org, linux-next@vger.kernel.org, open list , David Rientjes , Greg Thelen , Mike Kravetz , Shakeel Butt , Andrew Morton , Stephen Rothwell References: <7ff9e944-1c6c-f7c1-d812-e12817c7a317@oracle.com> <20200214204544.231482-1-almasrymina@google.com> <5237b9bc-2614-0a3a-afa5-5015f30d28bc@infradead.org> Message-ID: Date: Sun, 16 Feb 2020 18:57:49 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US 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 2/16/20 6:48 PM, Randy Dunlap wrote: > On 2/16/20 1:03 PM, Mina Almasry wrote: >> On Sun, Feb 16, 2020 at 12:40 PM Mina Almasry = wrote: >>> >> any insight into why I can't reproduce the >> warning? Wrong tree perhaps? >> >> I suspect a forward declaration of struct resv_map and struct >> file_region in hugetlb_cgroup.h would also fix. Yes, adding struct stubs in that header file does remove the build warnings. thanks. =3D=3D=3D patch follows =3D=3D=3D From: Randy Dunlap Fix build warnings when CONFIG_HUGETLB is not set/enabled. Fixes these warnings: In file included from ../mm/migrate.c:39:0: ../include/linux/hugetlb_cgroup.h:147:21: warning: =E2=80=98struct file_r= egion=E2=80=99 declared inside parameter list will not be visible outside= of this definition or declaration struct file_region *rg, ^~~~~~~~~~~ ../include/linux/hugetlb_cgroup.h:146:63: warning: =E2=80=98struct resv_m= ap=E2=80=99 declared inside parameter list will not be visible outside of= this definition or declaration static inline void hugetlb_cgroup_uncharge_file_region(struct resv_map *= resv, ^~~~~~~~ ../include/linux/hugetlb_cgroup.h:234:59: warning: =E2=80=98struct resv_m= ap=E2=80=99 declared inside parameter list will not be visible outside of= this definition or declaration static inline void hugetlb_cgroup_uncharge_counter(struct resv_map *resv= , ^~~~~~~~ Suggested-by: Mina Almasry Signed-off-by: Randy Dunlap --- include/linux/hugetlb_cgroup.h | 3 +++ 1 file changed, 3 insertions(+) --- mmotm-2020-0213-2226.orig/include/linux/hugetlb_cgroup.h +++ mmotm-2020-0213-2226/include/linux/hugetlb_cgroup.h @@ -18,6 +18,9 @@ #include =20 struct hugetlb_cgroup; +struct file_region; +struct resv_map; + /* * Minimum page order trackable by hugetlb cgroup. * At least 4 pages are necessary for all the tracking information.