lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.00.0909241143400.2673@chino.kir.corp.google.com>
Date:	Thu, 24 Sep 2009 11:45:52 -0700 (PDT)
From:	David Rientjes <rientjes@...gle.com>
To:	David Howells <dhowells@...hat.com>
cc:	torvalds@...l.org, akpm@...ux-foundation.org, ebmunson@...ibm.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HugeTLB: Fix unused variable warning

On Thu, 24 Sep 2009, David Howells wrote:

> Fix an unused variable warning:
> 
> 	mm/mmap.c: In function 'do_mmap_pgoff':
> 	mm/mmap.c:953: warning: unused variable 'user'
> 
> by converting the CONFIG_HUGETLBFS=n version of hugetlb_file_setup() into an
> inline function instead of a macro.
> 
> Introduced by:
> 
> 	commit 4e52780d41a741fb4861ae1df2413dd816ec11b1
> 	Author: Eric B Munson <ebmunson@...ibm.com>
> 	Date:   Mon Sep 21 17:03:47 2009 -0700
> 	hugetlb: add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
> 
> Signed-off-by: David Howells <dhowells@...hat.com>

Andrew added hugetlb_file_setup-use-c-not-cpp.patch to -mm on Tuesday and 
it should appear in the next mmotm.


From: Andrew Morton <akpm@...ux-foundation.org>

why macros are always wrong:

mm/mmap.c: In function 'do_mmap_pgoff':
mm/mmap.c:953: warning: unused variable 'user'

also, move a couple of struct forward-decls outside `#ifdef
CONFIG_HUGETLB_PAGE' - it's pointless and frequently harmful to make these
conditional (eg, this patch needed `struct user_struct').

Cc: Lee Schermerhorn <lee.schermerhorn@...com>
Cc: Mel Gorman <mel@....ul.ie>
Cc: Nishanth Aravamudan <nacc@...ibm.com>
Cc: David Rientjes <rientjes@...gle.com>
Cc: Adam Litke <agl@...ibm.com>
Cc: Andy Whitcroft <apw@...onical.com>
Cc: Eric Whitney <eric.whitney@...com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---

 include/linux/hugetlb.h |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff -puN include/linux/hugetlb.h~hugetlb_file_setup-use-c-not-cpp include/linux/hugetlb.h
--- a/include/linux/hugetlb.h~hugetlb_file_setup-use-c-not-cpp
+++ a/include/linux/hugetlb.h
@@ -3,15 +3,15 @@

 #include <linux/fs.h>

+struct ctl_table;
+struct user_struct;
+
 #ifdef CONFIG_HUGETLB_PAGE

 #include <linux/mempolicy.h>
 #include <linux/shm.h>
 #include <asm/tlbflush.h>

-struct ctl_table;
-struct user_struct;
-
 int PageHuge(struct page *page);

 static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
@@ -187,7 +187,11 @@ static inline void set_file_hugepages(st

 #define is_file_hugepages(file)                        0
 #define set_file_hugepages(file)               BUG()
-#define hugetlb_file_setup(name,size,acct,user,creat)  ERR_PTR(-ENOSYS)
+static inline struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag,
+                               struct user_struct **user, int creat_flags)
+{
+       return ERR_PTR(-ENOSYS);
+}

 #endif /* !CONFIG_HUGETLBFS */
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ