From patchwork Thu Mar 7 07:52:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 159802 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp7138368jad; Wed, 6 Mar 2019 23:55:21 -0800 (PST) X-Google-Smtp-Source: APXvYqwhIDwVmC0jHACmwhwFppgFf6F1AhhcFz5I4QGim/Bub2NBfGDFIO/2Q42AE9ypsWqdsDdb X-Received: by 2002:a62:18d8:: with SMTP id 207mr11644356pfy.57.1551945321440; Wed, 06 Mar 2019 23:55:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551945321; cv=none; d=google.com; s=arc-20160816; b=G/FPtiOWxbn8MM/BTLe9epoz4gnW1kSVV+FOsWvET/BD9vWNTGs1kKaFRgqhwUMrz4 Wh8uhxTyo8JbNdQxPm5DjrGFQJ6qpbWkT1VVp2VX98u8eLlf7GmPkQoWABIahZfb/l87 UcHwuU/udcD6xO/Uz0FoCsenDOPoEPBA1a6vYtQhOTs11LyG3dla16nGCUcoNDE9LqRS 88kJGHgFpe42mDIlCa1BkBGrEDeosrlWkA4dad2mybueRqQT5fHw17WFnQq3kefGP1IG 9SHRI3oKax2jNTNrM+uO77k/hRipxLghOw2pn9Ixvb+6BlZYjTqLsplC2Ft6VJXMZrKr nxmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=eirVJmeIUDnC5j4n9vybHADkPoCxEsKxIgqReALWxVg=; b=xmrOYYG6Sjpm8QmMRr75cKlr7dQptZzbFNJ3zMftrkHAzSlMRfHxKZRxKPT+sTu82y RLwYSWT5T0oO0KT7yO/HwE05976tu6nq6XzuxSEm0in4aCvo0gWM4stIu1+I8yCMN6SU aIV8OyAno+xBCETJXdWhqrb4nnoIu5xKDGq5LkoPfHoPPC2fq9jF05jYCrIQ8mcOUnwx q7Pb20MoqErQm2gi7483a11JRa+LYQN2HcbiRQEo0oXYYNzg96tXyC40pssgirQc/NJ6 +XVqFmwThD4V+CSXu1KxRLR/+klmT+PzYIMILwhSGj42BieHBjaXbF1yvr7OaXOyHrGz HCwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8si3913234pfj.231.2019.03.06.23.55.21; Wed, 06 Mar 2019 23:55:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726140AbfCGHzT (ORCPT + 31 others); Thu, 7 Mar 2019 02:55:19 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:36875 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbfCGHzT (ORCPT ); Thu, 7 Mar 2019 02:55:19 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1MY5s5-1ha90m2mS5-00YRcO; Thu, 07 Mar 2019 08:52:25 +0100 From: Arnd Bergmann To: Peter Zijlstra , Ingo Molnar , Will Deacon Cc: Arnd Bergmann , Bart Van Assche , Waiman Long , "Steven Rostedt (VMware)" , Tetsuo Handa , Frederic Weisbecker , "Joel Fernandes (Google)" , linux-kernel@vger.kernel.org Subject: [PATCH] lockdep: avoid a clang warning Date: Thu, 7 Mar 2019 08:52:12 +0100 Message-Id: <20190307075222.3424524-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:G8mhJwLDpTkj9/KY84pG4Ibbbquqd5jhJl4LFurbt6BePUkuR3K tnlJMDzsRkAVCVZ6XrnlzgS7towk12whK1psomvc4hxzgsoSfxUTQhYkd0Umceatgm9wJW+ bXhIDXy6RP9Jeq1n3mfZcx6DOGAWKvwv2d3kCFtTVaJ1dH5vkOp2NEBG5goeEtGfJXXZddz QMn4oXEc4PSDHjM5po/9Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:NQsCYikYSZM=:twR1be6WSsfM60pj4/nvwT RVbZldgh3+3AbHBIT2qCqSUK9MKSfgtNWaTu8/axQLrwHVZ2FH9SS0MYy7BELidbHET8KTfSt db1ul+gtAnePPyEYK1nr3IEZ7EidagsKnA2Kyblvq5d4yP8epQcTpcm2XASXjsSsSbeerdavH 7Xqps1UPRFhUZV4lwL/5kE+fq4LWvif43MWvGmCtsN9vIgNKOICstJZ0mTlU6UqommEuMlc90 Wvfy9WPI6zn5pk1DmssX4qi/Siq9hz1XU4KoZws3Q2pzUV6c8wssrhZjpj0fQJDBm1VkaFDid IF+RK75SaC4NzTmsWT+TdG0+aLs8R9pIUTwOVyd7rk3nGa3U32dmR4p+/NxSTlhqGTyNzI+WQ YfMY6DjwK37veXbCkrFQ4zs9JcarC2mqnIsHj30TXyLAcf11dvz/fyUl4WbvoBMrcIRPqKqu0 PYLwrGEw1ay7SPXr1LukF9nKAhih4deejVNkzFHaO+DgpLL8heNsZvJcFRMrEtv2AJ6Eo0M7z gEMwQqkUxILeo3xr2THLfJCB+Po9DAulNJRL9LNBATXlhp62LI+/eEVlCMb/Z/j7raAm9JGVy oInMQO27iEkRbpRqiXWocDEHbLSqiUBk9YBsItl+GSL7FWKfuM3cWgQJujWb/ESPrICRVxBHw ZGutaj0LKkW7fHn4AW7TcTmOdNPuOnSOPjJWIIMKvbymGSVTZc26Sh9PBfbC5WEVVvR6+uxbV kJlRkQ4xUefUp0buDCSQkOvjZ0AUPKXzmVN7Qw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- kernel/locking/lockdep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.20.0 Reviewed-by: Bart Van Assche 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) {