Re: [PATCH v3] workqueue: Wrap flush_workqueue() using a macro

From: Tejun Heo
Date: Mon May 23 2022 - 15:25:44 EST


On Sat, May 21, 2022 at 08:37:19PM +0900, Tetsuo Handa wrote:
> +/*
> + * Detect attempt to flush system-wide workqueues at compile time when possible.
> + *
> + * Always warn, for there is no in-tree flush_workqueue(system_*_wq) user.
> + */
> +#define flush_workqueue(wq) \
> +do { \
> + if ((__builtin_constant_p(&(wq) == &system_wq) && \
> + &(wq) == &system_wq) || \
> + (__builtin_constant_p(&(wq) == &system_highpri_wq) && \
> + &(wq) == &system_highpri_wq) || \
> + (__builtin_constant_p(&(wq) == &system_long_wq) && \
> + &(wq) == &system_long_wq) || \
> + (__builtin_constant_p(&(wq) == &system_unbound_wq) && \
> + &(wq) == &system_unbound_wq) || \
> + (__builtin_constant_p(&(wq) == &system_freezable_wq) && \
> + &(wq) == &system_freezable_wq) || \
> + (__builtin_constant_p(&(wq) == &system_power_efficient_wq) && \
> + &(wq) == &system_power_efficient_wq) || \
> + (__builtin_constant_p(&(wq) == &system_freezable_power_efficient_wq) && \
> + &(wq) == &system_freezable_power_efficient_wq)) \
> + __warn_flushing_systemwide_wq(); \
> + flush_workqueue(wq); \
> +} while (0)

Please just rename the backend function.

Thanks.

--
tejun