提交 03b00ebc 编写于 作者: R Russell King 提交者: Linus Torvalds

[PATCH] Shut up warnings in ipc/shm.c

Fix two warnings in ipc/shm.c

ipc/shm.c:122: warning: statement with no effect
ipc/shm.c:560: warning: statement with no effect

by converting the macros to empty inline functions.  For safety, let's do
all three.  This also has the advantage that typechecking gets performed
even without CONFIG_SHMEM enabled.
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 a94b3ab7
......@@ -634,9 +634,24 @@ struct mempolicy *shmem_get_policy(struct vm_area_struct *vma,
int shmem_lock(struct file *file, int lock, struct user_struct *user);
#else
#define shmem_nopage filemap_nopage
#define shmem_lock(a, b, c) ({0;}) /* always in memory, no need to lock */
#define shmem_set_policy(a, b) (0)
#define shmem_get_policy(a, b) (NULL)
static inline int shmem_lock(struct file *file, int lock,
struct user_struct *user)
{
return 0;
}
static inline int shmem_set_policy(struct vm_area_struct *vma,
struct mempolicy *new)
{
return 0;
}
static inline struct mempolicy *shmem_get_policy(struct vm_area_struct *vma,
unsigned long addr)
{
return NULL;
}
#endif
struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册