lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1551974540.9796.69.camel@acm.org>
Date:   Thu, 07 Mar 2019 08:02:20 -0800
From:   Bart Van Assche <bvanassche@....org>
To:     Arnd Bergmann <arnd@...db.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Will Deacon <will.deacon@....com>
Cc:     Waiman Long <longman@...hat.com>,
        "Steven Rostedt (VMware)" <rostedt@...dmis.org>,
        Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
        Frederic Weisbecker <frederic@...nel.org>,
        "Joel Fernandes (Google)" <joel@...lfernandes.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] lockdep: avoid a clang warning

On Thu, 2019-03-07 at 08:52 +0100, Arnd Bergmann wrote:
> Clang warns about a tentative array definition without a length:
> 
> kernel/locking/lockdep.c:845:12: error: tentative array definition assumed to have one element [-Werror]
> 
> There is no real reason to do this here, so just set the same length as
> in the real definition later in the same file.  It has to be hidden in
> an #ifdef or annotated __maybe_unused though, to avoid the unused-variable
> warning if CONFIG_PROVE_LOCKING is disabled.
> 
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>  kernel/locking/lockdep.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> index 21cb81fe6359..35a144dfddf5 100644
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -842,7 +842,9 @@ static bool class_lock_list_valid(struct lock_class *c, struct list_head *h)
>  	return true;
>  }
>  
> -static u16 chain_hlocks[];
> +#ifdef CONFIG_PROVE_LOCKING
> +static u16 chain_hlocks[MAX_LOCKDEP_CHAIN_HLOCKS];
> +#endif
>  
>  static bool check_lock_chain_key(struct lock_chain *chain)
>  {

Reviewed-by: Bart Van Assche <bvanassche@....org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ