Skip to contentSkip to conversation

pipe: Eliminate compilation warnings

PATCH New Tianjia Zhang 1 participant 1 message Nov 16, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pipe: Eliminate compilation warnings

When CONFIG_WATCH_QUEUE is not set, clang will have five similar compilation warnings as follows:

fs/pipe.c:755:15: warning: no previous prototype for function 'account_pipe_buffers' [-Wmissing-prototypes] unsigned long account_pipe_buffers(struct user_struct *user,

                ^

fs/pipe.c:755:1: note: declare 'static' if the function is not intended to be used outside of this translation unit unsigned long account_pipe_buffers(struct user_struct *user,
^
static

Eliminate compilation warnings by removing macro compilation in header files.

---
 include/linux/pipe_fs_i.h | 4 ----
 1 file changed, 4 deletions(-)
include/linux/pipe_fs_i.h +0 -4
index fc5642431b92..b4fa7879ad83 100644
@@ -256,18 +256,14 @@ void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *);
 
 extern const struct pipe_buf_operations nosteal_pipe_buf_ops;
 
-#ifdef CONFIG_WATCH_QUEUE
 unsigned long account_pipe_buffers(struct user_struct *user,
 				   unsigned long old, unsigned long new);
 bool too_many_pipe_buffers_soft(unsigned long user_bufs);
 bool too_many_pipe_buffers_hard(unsigned long user_bufs);
 bool pipe_is_unprivileged_user(void);
-#endif
 
 /* for F_SETPIPE_SZ and F_GETPIPE_SZ */
-#ifdef CONFIG_WATCH_QUEUE
 int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots);
-#endif
 long pipe_fcntl(struct file *, unsigned int, unsigned long arg);
 struct pipe_inode_info *get_pipe_info(struct file *file, bool for_splice);
 
Signature · 1 line
2.32.0