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 9462FC7619B for ; Mon, 17 Feb 2020 02:57:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6A29920857 for ; Mon, 17 Feb 2020 02:57:56 +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" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726564AbgBQC54 (ORCPT ); Sun, 16 Feb 2020 21:57:56 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:46476 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726498AbgBQC5z (ORCPT ); Sun, 16 Feb 2020 21:57:55 -0500 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: 8bit Sender: linux-next-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org 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. === patch follows === 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: ‘struct file_region’ 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: ‘struct resv_map’ 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: ‘struct resv_map’ 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 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.