linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernfs: add stub helper for kernfs_generic_poll()
@ 2023-07-24 12:18 Arnd Bergmann
  2023-07-24 12:46 ` Chengming Zhou
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2023-07-24 12:18 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Tejun Heo, Peter Zijlstra (Intel),
	Suren Baghdasaryan, Andrew Morton, Johannes Weiner
  Cc: Arnd Bergmann, Chengming Zhou, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

In some randconfig builds, kernfs ends up being disabled, so there is no prototype
for kernfs_generic_poll()

In file included from kernel/sched/build_utility.c:97:
kernel/sched/psi.c:1479:3: error: implicit declaration of function 'kernfs_generic_poll' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                kernfs_generic_poll(t->of, wait);
                ^

Add a stub helper for it, as we have it for other kernfs functions.

Fixes: aff037078ecae ("sched/psi: use kernfs polling functions for PSI trigger polling")
Fixes: 147e1a97c4a0b ("fs: kernfs: add poll file operation")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
While the stub was always missing, this only caused problems now that sched/psi.c
calls it unconditionally. The patch that caused it was already merged into v6.5-rc2
---
 include/linux/kernfs.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h
index 73f5c120def88..2a36f3218b510 100644
--- a/include/linux/kernfs.h
+++ b/include/linux/kernfs.h
@@ -550,6 +550,10 @@ static inline int kernfs_setattr(struct kernfs_node *kn,
 				 const struct iattr *iattr)
 { return -ENOSYS; }
 
+static inline __poll_t kernfs_generic_poll(struct kernfs_open_file *of,
+					   struct poll_table_struct *pt)
+{ return -ENOSYS; }
+
 static inline void kernfs_notify(struct kernfs_node *kn) { }
 
 static inline int kernfs_xattr_get(struct kernfs_node *kn, const char *name,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kernfs: add stub helper for kernfs_generic_poll()
  2023-07-24 12:18 [PATCH] kernfs: add stub helper for kernfs_generic_poll() Arnd Bergmann
@ 2023-07-24 12:46 ` Chengming Zhou
  0 siblings, 0 replies; 2+ messages in thread
From: Chengming Zhou @ 2023-07-24 12:46 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, Tejun Heo,
	Peter Zijlstra (Intel),
	Suren Baghdasaryan, Andrew Morton, Johannes Weiner
  Cc: Arnd Bergmann, linux-kernel

On 2023/7/24 20:18, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> In some randconfig builds, kernfs ends up being disabled, so there is no prototype
> for kernfs_generic_poll()
> 
> In file included from kernel/sched/build_utility.c:97:
> kernel/sched/psi.c:1479:3: error: implicit declaration of function 'kernfs_generic_poll' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
>                 kernfs_generic_poll(t->of, wait);
>                 ^
> 
> Add a stub helper for it, as we have it for other kernfs functions.
> 
> Fixes: aff037078ecae ("sched/psi: use kernfs polling functions for PSI trigger polling")
> Fixes: 147e1a97c4a0b ("fs: kernfs: add poll file operation")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> While the stub was always missing, this only caused problems now that sched/psi.c
> calls it unconditionally. The patch that caused it was already merged into v6.5-rc2
> ---
>  include/linux/kernfs.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h
> index 73f5c120def88..2a36f3218b510 100644
> --- a/include/linux/kernfs.h
> +++ b/include/linux/kernfs.h
> @@ -550,6 +550,10 @@ static inline int kernfs_setattr(struct kernfs_node *kn,
>  				 const struct iattr *iattr)
>  { return -ENOSYS; }
>  
> +static inline __poll_t kernfs_generic_poll(struct kernfs_open_file *of,
> +					   struct poll_table_struct *pt)
> +{ return -ENOSYS; }
> +
>  static inline void kernfs_notify(struct kernfs_node *kn) { }
>  
>  static inline int kernfs_xattr_get(struct kernfs_node *kn, const char *name,

Reviewed-by: Chengming Zhou <zhouchengming@bytedance.com>

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-24 12:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-24 12:18 [PATCH] kernfs: add stub helper for kernfs_generic_poll() Arnd Bergmann
2023-07-24 12:46 ` Chengming Zhou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).