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>] [day] [month] [year] [list]
Message-ID: <1415603517-9527-1-git-send-email-peter.ujfalusi@ti.com>
Date:	Mon, 10 Nov 2014 09:11:57 +0200
From:	Peter Ujfalusi <peter.ujfalusi@...com>
To:	<cl@...ux.com>, <penberg@...nel.org>, <rientjes@...gle.com>,
	<iamjoonsoo.kim@....com>, <akpm@...ux-foundation.org>
CC:	<linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
	<vdavydov@...allels.com>
Subject: [PATCH] slab: Fix compilation error in case of !CONFIG_NUMA

Move the definition of slab_free() outside of #ifdef CONFIG_NUMA since it
is used by code which is not NUMA specific. Fixes the following error
introduced by the following commit:
5da1c3c725ab slab: recharge slab pages to the allocating memory cgroup

  CC      mm/slab.o
/home/ZZZZZ/linux/mm/slab.c: In function ‘slab_alloc’:
/home/ZZZZZ/linux/mm/slab.c:3260:4: error: implicit declaration of function ‘slab_free’ [-Werror=implicit-function-declaration]
    slab_free(cachep, objp);
    ^
/home/ZZZZZ/linux/mm/slab.c: At top level:
/home/ZZZZZ/linux/mm/slab.c:3534:29: warning: conflicting types for ‘slab_free’ [enabled by default]
 static __always_inline void slab_free(struct kmem_cache *cachep, void *objp)
                             ^
/home/ZZZZZ/linux/mm/slab.c:3534:29: error: static declaration of ‘slab_free’ follows non-static declaration
/home/ZZZZZ/linux/mm/slab.c:3260:4: note: previous implicit declaration of ‘slab_free’ was here
    slab_free(cachep, objp);
    ^
cc1: some warnings being treated as errors
/home/ZZZZZ/linux/scripts/Makefile.build:257: recipe for target 'mm/slab.o' failed
make[2]: *** [mm/slab.o] Error 1
/home/ZZZZZ/linux/Makefile:953: recipe for target 'mm' failed
make[1]: *** [mm] Error 2
make[1]: *** Waiting for unfinished jobs....
  CHK     kernel/config_data.h

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@...com>
---
 mm/slab.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 61b01c2ae1d9..301ede1c6784 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3133,8 +3133,6 @@ done:
 	return obj;
 }
 
-static __always_inline void slab_free(struct kmem_cache *cachep, void *objp);
-
 static __always_inline void *
 slab_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid,
 		   unsigned long caller)
@@ -3228,6 +3226,8 @@ __do_cache_alloc(struct kmem_cache *cachep, gfp_t flags)
 
 #endif /* CONFIG_NUMA */
 
+static __always_inline void slab_free(struct kmem_cache *cachep, void *objp);
+
 static __always_inline void *
 slab_alloc(struct kmem_cache *cachep, gfp_t flags, unsigned long caller)
 {
-- 
2.1.3

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