Re: [PATCH] kbuild: Enable -Wsometimes-uninitialized
From: Nathan Chancellor
Date: Wed May 22 2019 - 21:57:13 EST
On Tue, Apr 30, 2019 at 11:46:44AM +0200, Arnd Bergmann wrote:
> Ah, I thought they were all fixed, as I don't see any remaining warnings
> in my tree. It seems that I never send this workaround for
> DECLARE_WAIT_QUEUE_HEAD_ONSTACK:
>
> diff --git a/include/linux/wait.h b/include/linux/wait.h
> index 5f3efabc36f4..cbe1ea0fce84 100644
> --- a/include/linux/wait.h
> +++ b/include/linux/wait.h
> @@ -68,8 +68,15 @@ extern void __init_waitqueue_head(struct
> wait_queue_head *wq_head, const char *n
> } while (0)
>
> #ifdef CONFIG_LOCKDEP
> -# define __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) \
> - ({ init_waitqueue_head(&name); name; })
> +# define __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) {
> \
> + .lock = __SPIN_LOCK_UNLOCKED(name.lock),
> \
> + .head = ({
> \
> + static struct lock_class_key __key;
> \
> + lockdep_set_class_and_name(&(name).lock, &__key, #
> name); \
> + (struct list_head){ &(name).head, &(name).head };
> \
> + }),
> \
> +}
> +
> # define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name) \
> struct wait_queue_head name = __WAIT_QUEUE_HEAD_INIT_ONSTACK(name)
> #else
>
> Are there any others you see?
>
> Arnd
Hi Arnd,
Were you planning on sending this out for review? It would be nice to
get these fixed so we can get this warning enabled.
I am bumping the other patches/inquiries I have sent now.
Cheers,
Nathan