Thread (15 messages) 15 messages, 5 authors, 2022-08-01

Re: [PATCH] kernel/watch_queue: Make pipe NULL while clearing watch_queue

From: Khalid Masum <hidden>
Date: 2022-07-24 03:45:45
Also in: linux-kernel-mentees, lkml

On Sat, Jul 23, 2022 at 8:29 PM Siddh Raman Pant via
Linux-kernel-mentees [off-list ref]
wrote:
On Sat, 23 Jul 2022 19:33:33 +0530  Greg KH [off-list ref] wrote:
quoted
You should not use #ifdef in .c files, it's unmaintainable over time.

thanks,

greg k-h
I used it because it is used in the same way in fs/pipe.c too (please check the
stated line number).

That, in turn, is because `watch_queue` member in the `pipe_inode_info` struct
is defined that way (see line 80 of include/linux/pipe_fs_i.h), so I am forced
to use the ifdef guard.
Maybe, we can use the IS_ENABLED macro here to avoid ifdef in the .c file as
suggested here:
https://www.kernel.org/doc/html/v4.10/process/coding-style.html#conditional-compilation

if(IS_ENABLED(CONFIG_WATCH_QUEUE)){
     ...
}
Thanks,
Siddh
Thanks,
  -- Khalid Masum
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help