From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751477Ab1GRWBN (ORCPT ); Mon, 18 Jul 2011 18:01:13 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:36488 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750868Ab1GRWBM (ORCPT ); Mon, 18 Jul 2011 18:01:12 -0400 From: Arnaud Lacombe To: Americo Wang , Michal Marek Cc: linux-kernel@vger.kernel.org, Arnaud Lacombe , Andrew Morton , Rusty Russell , KOSAKI Motohiro , Christoph Lameter , Mel Gorman , Steven Rostedt Subject: Re: [Patch] fix a headers_check warning in include/linux/kernel.h Date: Mon, 18 Jul 2011 18:00:57 -0400 Message-Id: <1311026457-23534-1-git-send-email-lacombar@gmail.com> X-Mailer: git-send-email 1.7.6.153.g78432 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, For the sake of having a patch ready. I actually did it yesterday but did not send it then. Cc'ed to the authors of the relevant macros; __FUNCTION__ was actually exported since ages, but I really do not see why the kernel exports this macros... - Arnaud -- From: Arnaud Lacombe Subject: linux/kernel.h: hide internal macros Unexpose to userland the following macros - BUILD_BUG_ON.* - __FUNCTION__ - NUMA_BUILD - COMPACTION_BUILD - REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD Cc: Andrew Morton Cc: Rusty Russell Cc: KOSAKI Motohiro Cc: Christoph Lameter Cc: Mel Gorman Cc: Steven Rostedt Signed-off-by: Arnaud Lacombe --- include/linux/kernel.h | 46 +++++++++++++++++++++++----------------------- 1 files changed, 23 insertions(+), 23 deletions(-) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 567a6f7..9a43ad7 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -646,29 +646,6 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) -struct sysinfo; -extern int do_sysinfo(struct sysinfo *info); - -#endif /* __KERNEL__ */ - -#define SI_LOAD_SHIFT 16 -struct sysinfo { - long uptime; /* Seconds since boot */ - unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ - unsigned long totalram; /* Total usable main memory size */ - unsigned long freeram; /* Available memory size */ - unsigned long sharedram; /* Amount of shared memory */ - unsigned long bufferram; /* Memory used by buffers */ - unsigned long totalswap; /* Total swap space size */ - unsigned long freeswap; /* swap space still available */ - unsigned short procs; /* Number of current processes */ - unsigned short pad; /* explicit padding for m68k */ - unsigned long totalhigh; /* Total high memory size */ - unsigned long freehigh; /* Available high memory size */ - unsigned int mem_unit; /* Memory unit size in bytes */ - char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ -}; - #ifdef __CHECKER__ #define BUILD_BUG_ON_NOT_POWER_OF_2(n) #define BUILD_BUG_ON_ZERO(e) (0) @@ -736,4 +713,27 @@ extern int __build_bug_on_failed; # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD #endif +struct sysinfo; +extern int do_sysinfo(struct sysinfo *info); + +#endif /* __KERNEL__ */ + +#define SI_LOAD_SHIFT 16 +struct sysinfo { + long uptime; /* Seconds since boot */ + unsigned long loads[3]; /* 1, 5, and 15 minute load averages */ + unsigned long totalram; /* Total usable main memory size */ + unsigned long freeram; /* Available memory size */ + unsigned long sharedram; /* Amount of shared memory */ + unsigned long bufferram; /* Memory used by buffers */ + unsigned long totalswap; /* Total swap space size */ + unsigned long freeswap; /* swap space still available */ + unsigned short procs; /* Number of current processes */ + unsigned short pad; /* explicit padding for m68k */ + unsigned long totalhigh; /* Total high memory size */ + unsigned long freehigh; /* Available high memory size */ + unsigned int mem_unit; /* Memory unit size in bytes */ + char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ +}; + #endif -- 1.7.6.153.g78432