summaryrefslogtreecommitdiffstats
path: root/ipc/util.h
diff options
context:
space:
mode:
authorDavidlohr Bueso <davidlohr@hp.com>2014-01-27 17:07:09 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-27 21:02:40 -0800
commitdaf948c7d1a080041ae19aca07625efec670695a (patch)
treeaf17f8452bcd1e6c709f4875c4a04d95d4b6b62f /ipc/util.h
parent8dc5cd04f97b5d6cad64df1e7dc5c49110b4d5e3 (diff)
downloadlinux-stable-daf948c7d1a080041ae19aca07625efec670695a.tar.gz
linux-stable-daf948c7d1a080041ae19aca07625efec670695a.tar.bz2
linux-stable-daf948c7d1a080041ae19aca07625efec670695a.zip
ipc: delete seq_max field in struct ipc_ids
This field is only used to reset the ids seq number if it exceeds the smaller of INT_MAX/SEQ_MULTIPLIER and USHRT_MAX, and can therefore be moved out of the structure and into its own macro. Since each ipc_namespace contains a table of 3 pointers to struct ipc_ids we can save space in instruction text: text data bss dec hex filename 56232 2348 24 58604 e4ec ipc/built-in.o 56216 2348 24 58588 e4dc ipc/built-in.o-after Signed-off-by: Davidlohr Bueso <davidlohr@hp.com> Reviewed-by: Jonathan Gonzalez <jgonzalez@linets.cl> Cc: Aswin Chandramouleeswaran <aswin@hp.com> Cc: Rik van Riel <riel@redhat.com> Acked-by: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc/util.h')
-rw-r--r--ipc/util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ipc/util.h b/ipc/util.h
index d64db3e56f7d..9c47d6f6c7b4 100644
--- a/ipc/util.h
+++ b/ipc/util.h
@@ -100,6 +100,7 @@ void __init ipc_init_proc_interface(const char *path, const char *header,
#define ipcid_to_idx(id) ((id) % SEQ_MULTIPLIER)
#define ipcid_to_seqx(id) ((id) / SEQ_MULTIPLIER)
+#define IPCID_SEQ_MAX min_t(int, INT_MAX/SEQ_MULTIPLIER, USHRT_MAX)
/* must be called with ids->rwsem acquired for writing */
int ipc_addid(struct ipc_ids *, struct kern_ipc_perm *, int);