Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp397004ybi; Tue, 16 Jul 2019 22:34:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfkhK6BoOf0X8UBT5uGQeACW/TXkeQ3L2MunaMJTFT5XYVGdFLz1c9t9lBuvSV1PUU5z6I X-Received: by 2002:a65:4304:: with SMTP id j4mr39646105pgq.419.1563341640126; Tue, 16 Jul 2019 22:34:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563341640; cv=none; d=google.com; s=arc-20160816; b=luvg/5oUWQymNynXWvWAe4u2vvqnP+l3T7NODyNa1dWSrw/O1ysPPcp1vhet2QSTRf WrQO7ziL0PjaeL13mQjG3yU6C84W6OudL9tzg/i4X8Aqi818w5wdMz+4mfKP6aLW7n4M avBL/xnYnFgJXVwhYt1Q9lZpYUouh2Oz2GIXfW8qWO639Wu3uZyBqsK8e9a8iL5fedN2 /9NXHspAC9WSXP7Gq7yu1AqxfgHyrC3YkF0l4RLVBNpBZKzFeJP2Dyck0CWLACCntnKa 7QW7xR/N4IFRSrTIYNaENkNJkQc/L+8aaAcbhb0I4ctr+fNaMtoq1LHAX/qGq0QSKrYd g/IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=RiyaRaIWUGIsAa8lRiNjECqd/N4fEUvhVcUuMO28K0E=; b=kPMS5F5j+fDif85kyzvq5TzhOXFMMFlW+do0voJ23DZP/3LTXggFB7IvSzvrJgJNQo 4Ky2fcsclHFh+V7y/Rr33K6sO8YEyUXxEWO7TSqL0+UF3QMu53SOndliteNBeD84/PMD HLAV35Br+091cG3ZPxjoEsQ8FAZSe7+7KnNGpGkaEnbCpSrc8XAlUdeB2yCJ33xVimys 4j7Eum9i+6bLgvtvT7n5rJZgXgZh/rK76JvffmYZHlOPFxo0woHb2HLWCqNndtEU/oqB NsSXtHKQSiKbfr9EqK7d+q+qDk67OFgddaxgEb7mB5CbaDXyBFb5VMxJkMlgR03Y7V1N mFbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YSO+abSw; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si21602150pla.75.2019.07.16.22.33.44; Tue, 16 Jul 2019 22:34:00 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YSO+abSw; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726812AbfGQFdL (ORCPT + 99 others); Wed, 17 Jul 2019 01:33:11 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:41163 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725799AbfGQFdL (ORCPT ); Wed, 17 Jul 2019 01:33:11 -0400 Received: by mail-qk1-f193.google.com with SMTP id v22so16514140qkj.8 for ; Tue, 16 Jul 2019 22:33:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RiyaRaIWUGIsAa8lRiNjECqd/N4fEUvhVcUuMO28K0E=; b=YSO+abSwu2ezoMPct2o4RKHrP0PgNwSzcQjt+oqwXwecnjrX2JDJCvQ4OdZRGLzW5O gd2Ejwy8TvaUkHtOs/6jB9/k+58LfKZBfdnJBZtjMr18hMa2IRAPjRbrA4CChKGpFO0v EGAoEgXp2gP1LEn4MUOw8cBKLhm9IfbLUjwDrYRmyCvNZyFtST/tp98Dkk9damXz+7p1 aolOISQV9Dyy6zCG4c64v9wyVg/95aoKm5wprKkpNLCICgrqrLNWh4sr7nh9+NoPmvyV Cpajs++nZVNKhbCuessupquwH0Bap83aQLXeb5k71ayIEpNv0ySOlg6OGfDCRyQK1aVK PO1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RiyaRaIWUGIsAa8lRiNjECqd/N4fEUvhVcUuMO28K0E=; b=uFt8IRttkLEZdCB+0a8zaTSzuuEFgyrKeUo1f1wLofI3J4HUk7pvjr+qh1vKZAjUXp EQi1Qait2QSLz7LlDOPi4SDN8dBiPEvpK4++NgbRAJ2lF+ctemjH9A6ydU8IWfM6lZbg nYGkZqYX7pMVol0AwgoDg4PEcpjG7PceVOi7tspza9sDdyHsoTX5vIVTJ1dRuXq3hkKy WhDctS0jBU87BYfKIyWR8MQ7+SD2VebQmvqz3i0KL2A8JBMwfTMmqA+UmiyErEIaZtle ggdzz+LyTYtG6It9LILRexB0djPgGdTc9m6+8XcvfxGPpE1Gh2Z3z4WBfME5M12/nqiS +Duw== X-Gm-Message-State: APjAAAVspJaCkcXrhooROt1neX2xODYz8w9vRGRAGHDBVYff2N55lO2B 7j1V60j0euDEqdL4Qp+5ErVtnwbtZqeQItrbLNc= X-Received: by 2002:a05:620a:1181:: with SMTP id b1mr25847555qkk.390.1563341590181; Tue, 16 Jul 2019 22:33:10 -0700 (PDT) MIME-Version: 1.0 References: <20190715092809.736834-1-arnd@arndb.de> In-Reply-To: <20190715092809.736834-1-arnd@arndb.de> From: Yuyang Du Date: Wed, 17 Jul 2019 13:32:58 +0800 Message-ID: Subject: Re: [PATCH] locking/lockdep: hide unused 'class' variable To: Arnd Bergmann Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , Qian Cai , Andrew Morton , Linus Torvalds , "Paul E. McKenney" , Thomas Gleixner , Will Deacon , Frederic Weisbecker , Ingo Molnar , Bart Van Assche , Waiman Long , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Whoops..... Thanks. On Mon, 15 Jul 2019 at 17:28, Arnd Bergmann wrote: > > The usage is now hidden in an #ifdef, so we need to move > the variable itself in there as well to avoid this warning: > > kernel/locking/lockdep_proc.c:203:21: error: unused variable 'class' [-Werror,-Wunused-variable] > > Fixes: 68d41d8c94a3 ("locking/lockdep: Fix lock used or unused stats error") > Signed-off-by: Arnd Bergmann > --- > kernel/locking/lockdep_proc.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/kernel/locking/lockdep_proc.c b/kernel/locking/lockdep_proc.c > index 65b6a1600c8f..bda006f8a88b 100644 > --- a/kernel/locking/lockdep_proc.c > +++ b/kernel/locking/lockdep_proc.c > @@ -200,7 +200,6 @@ static void lockdep_stats_debug_show(struct seq_file *m) > > static int lockdep_stats_show(struct seq_file *m, void *v) > { > - struct lock_class *class; > unsigned long nr_unused = 0, nr_uncategorized = 0, > nr_irq_safe = 0, nr_irq_unsafe = 0, > nr_softirq_safe = 0, nr_softirq_unsafe = 0, > @@ -211,6 +210,8 @@ static int lockdep_stats_show(struct seq_file *m, void *v) > sum_forward_deps = 0; > > #ifdef CONFIG_PROVE_LOCKING > + struct lock_class *class; > + > list_for_each_entry(class, &all_lock_classes, lock_entry) { > > if (class->usage_mask == 0) > -- > 2.20.0 >