Skip to contentSkip to conversation

pid_namespace.c/.h: Simplifying defines.

PATCH New Raphael S.Carvalho 1 participant 1 message Mar 6, 2013 Namespaces:

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pid_namespace.c/.h: Simplifying defines.

This patch removes BITS_PER_PAGE from pid_namespace.c and put it into pid_namespace.h instead, since we can simplify the define PID_MAP_ENTRIES by using the BITS_PER_PAGE.

---
 include/linux/pid_namespace.h |    3 ++-
 kernel/pid_namespace.c        |    2 --
 2 files changed, 2 insertions(+), 3 deletions(-)
include/linux/pid_namespace.h +2 -1
index 215e5e3..e4ae945 100644
@@ -13,7 +13,8 @@ struct pidmap {
        void *page;
 };
 
-#define PIDMAP_ENTRIES         ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8)
+#define BITS_PER_PAGE		(PAGE_SIZE * 8)
+#define PIDMAP_ENTRIES		((PID_MAX_LIMIT+BITS_PER_PAGE-1)/BITS_PER_PAGE)
 
 struct bsd_acct_struct;
 
kernel/pid_namespace.c +0 -2
index c1c3dc1..f158e27 100644
@@ -19,8 +19,6 @@
 #include <linux/reboot.h>
 #include <linux/export.h>
 
-#define BITS_PER_PAGE		(PAGE_SIZE*8)
-
 struct pid_cache {
 	int nr_ids;
 	char name[16];
Signature · 1 line
1.7.2.5