]> www.infradead.org Git - users/willy/xarray.git/commitdiff
kernel: only define task_struct_whitelist conditionally
authorChristoph Hellwig <hch@lst.de>
Mon, 12 Aug 2019 06:55:24 +0000 (08:55 +0200)
committerTony Luck <tony.luck@intel.com>
Mon, 12 Aug 2019 16:53:28 +0000 (09:53 -0700)
If CONFIG_ARCH_TASK_STRUCT_ALLOCATOR is set task_struct_whitelist is
never called, and thus generates a compiler warning.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lkml.kernel.org/r/20190812065524.19959-5-hch@lst.de
Signed-off-by: Tony Luck <tony.luck@intel.com>
kernel/fork.c

index 2852d0e76ea3b905693a454f36e21524c14a8b54..f79e3da0caaf091219073516e5c5cf9ed1ff4a5c 100644 (file)
@@ -768,6 +768,7 @@ static void set_max_threads(unsigned int max_threads_suggested)
 int arch_task_struct_size __read_mostly;
 #endif
 
+#ifndef CONFIG_ARCH_TASK_STRUCT_ALLOCATOR
 static void task_struct_whitelist(unsigned long *offset, unsigned long *size)
 {
        /* Fetch thread_struct whitelist for the architecture. */
@@ -782,6 +783,7 @@ static void task_struct_whitelist(unsigned long *offset, unsigned long *size)
        else
                *offset += offsetof(struct task_struct, thread);
 }
+#endif /* CONFIG_ARCH_TASK_STRUCT_ALLOCATOR */
 
 void __init fork_init(void)
 {