diff mbox series

hugetlb: fix <linux/hugetlb_cgroup.h> structs

Message ID cf31c5ba-c60e-cee2-9c43-0da453f31b0c@infradead.org (mailing list archive)
State New, archived
Headers show
Series hugetlb: fix <linux/hugetlb_cgroup.h> structs | expand

Commit Message

Randy Dunlap Feb. 17, 2020, 2:57 a.m. UTC
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(+)
diff mbox series

Patch

--- 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.