Linux-Next Archive on lore.kernel.org
 help / color / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Mina Almasry <almasrymina@google.com>
Cc: linux-mm@kvack.org, linux-next@vger.kernel.org,
	open list <linux-kernel@vger.kernel.org>,
	David Rientjes <rientjes@google.com>,
	Greg Thelen <gthelen@google.com>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Shakeel Butt <shakeelb@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Subject: [PATCH] hugetlb: fix <linux/hugetlb_cgroup.h> structs
Date: Sun, 16 Feb 2020 18:57:49 -0800
Message-ID: <cf31c5ba-c60e-cee2-9c43-0da453f31b0c@infradead.org> (raw)
In-Reply-To: <cad14d07-199e-fd2e-f2ac-0d7460277d62@infradead.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 <almasrymina@google.com> 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 <rdunlap@infradead.org>

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 <almasrymina@google.com>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
 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 <linux/mmdebug.h>
 
 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.


  reply index

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200203173311.6269a8be06a05e5a4aa08a93@linux-foundation.org>
2020-02-14  6:26 ` mmotm 2020-02-13-22-26 uploaded Andrew Morton
2020-02-14 16:29   ` mmotm 2020-02-13-22-26 uploaded (mm/hugetlb.c) Randy Dunlap
2020-02-14 17:18     ` Mike Kravetz
2020-02-14 20:51       ` Mina Almasry
     [not found]       ` <20200214204544.231482-1-almasrymina@google.com>
2020-02-14 21:00         ` [PATCH] hugetlb: fix CONFIG_CGROUP_HUGETLB ifdefs Mina Almasry
2020-02-15  1:17           ` Randy Dunlap
2020-02-15  1:56             ` Randy Dunlap
2020-02-16 20:40               ` Mina Almasry
2020-02-16 21:03                 ` Mina Almasry
2020-02-17  2:48                   ` Randy Dunlap
2020-02-17  2:57                     ` Randy Dunlap [this message]
2020-02-17  3:53               ` Stephen Rothwell
2020-02-14 16:49   ` mmotm 2020-02-13-22-26 uploaded (mm/migrate.c, hugetlb_cgroup.h) Randy Dunlap
2020-02-25  3:53 ` mmotm 2020-02-24-19-53 uploaded Andrew Morton
2020-02-25  6:16   ` mmotm 2020-02-24-19-53 uploaded (init/main.c: initrd*) Randy Dunlap
2020-02-25  6:18     ` Randy Dunlap
2020-02-25  6:21       ` Randy Dunlap
2020-02-25 16:41   ` mmotm 2020-02-24-19-53 uploaded (drivers/platform/x86/intel_pmc_core.c) Randy Dunlap
2020-02-25 17:01   ` mmotm 2020-02-24-19-53 uploaded (objtool warning) Randy Dunlap
2020-02-27 21:52     ` Josh Poimboeuf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf31c5ba-c60e-cee2-9c43-0da453f31b0c@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=almasrymina@google.com \
    --cc=gthelen@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mike.kravetz@oracle.com \
    --cc=rientjes@google.com \
    --cc=sfr@canb.auug.org.au \
    --cc=shakeelb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Next Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-next/0 linux-next/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-next linux-next/ https://lore.kernel.org/linux-next \
		linux-next@vger.kernel.org
	public-inbox-index linux-next

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-next


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git