From patchwork Tue Mar 13 13:18:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 131469 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp731927ljb; Tue, 13 Mar 2018 06:23:09 -0700 (PDT) X-Google-Smtp-Source: AG47ELskc/1k/0rxVpPmQypFT2k3FjBa3sZR+QEWqQofhqIPCkQ5wiFs2l1+FZhlLbquInSPkbct X-Received: by 2002:a17:902:b183:: with SMTP id s3-v6mr597976plr.108.1520947389311; Tue, 13 Mar 2018 06:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520947389; cv=none; d=google.com; s=arc-20160816; b=O5inNbRm7LLCA4BBi3k20S29vDKL0KW+thGQgPDX2eXYa+sJy7h3H+BubF2v+2Vpwq sxHhzBXNflVoWOM/X84fekwCXQuYtzGOzDju0mi2ZiFfum5SZALRXsAOt/7Kqsgnz0m1 iaMschQsANtryM7Qd209MeWWyHAwR7qoFqj+uNrYVk6E2Pcnu5Lqq7OAcO2dt1jvtNAa lOsHMiaZSmiDdTDFw45MQD1KeRKLkTOvUMrEkY98VYXJHpagDzOWA6eQ+1144rVQReuJ /zanpnsPgWbA3JqAwb9/9wJJ7wD/n+cOV9Z8qE0plAIICWYEg3DyLJuCHSkoWkFAPina IWVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=dF8p9mmKjEqPqmNyw/uh034/DQat/w45OpmEUTi4sEY=; b=P/zdOoiA+T1Np9KDxAQ5a5Szm6sZ9l6xkZ4ZyhTlbtG/SBotDs9UrCB2dVZAfJAZtd T6Cg5bd5rX4UUg9PnyG8Ntk+8pon2hH8JW8p/kQdl3q62BAsDTO4qbR51gtDereGMPPF BxkEGLo/5JvdZIhIZu1mXv9yhBBeRClvd33YyRlCt1vxRaVP8uFdTJWTE2mYWxthxJPG S0W1V8HhjBQPiRRjinF8XJl0OSf5E17YgnMp+Z3gFdRXGllLHgEvWjhaGBGKf1Ynjfcj 4DS7XArPjpqZAMaJ7Ke9UnG0cSSDH+HRe3G8JC0+XLIlgGgaFRsTztH4hMYjq7BW+t/u n6XA== 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 f3si105675pgu.783.2018.03.13.06.23.08; Tue, 13 Mar 2018 06:23:09 -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; 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 S1752750AbeCMNXE (ORCPT + 28 others); Tue, 13 Mar 2018 09:23:04 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:33707 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752391AbeCMNTT (ORCPT ); Tue, 13 Mar 2018 09:19:19 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0MfV31-1fJ32v2wZ9-00P6KS; Tue, 13 Mar 2018 14:18:58 +0100 From: Arnd Bergmann To: Thomas Gleixner , Yang Shi Cc: Arnd Bergmann , Waiman Long , linux-kernel@vger.kernel.org Subject: [PATCH] debugobjects: avoid another unused variable warning. Date: Tue, 13 Mar 2018 14:18:46 +0100 Message-Id: <20180313131857.158876-1-arnd@arndb.de> X-Mailer: git-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YR360LXoeS11EQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org debug_objects_maxchecked is only updated in __debug_check_no_obj_freed(), and only read in debug_objects_maxchecked, unfortunately both of these are optional and depend on different Kconfig symbols. When both CONFIG_DEBUG_OBJECTS_FREE and CONFIG_DEBUG_FS are disabled, we get this warning: lib/debugobjects.c:56:14: error: 'debug_objects_maxchecked' defined but not used [-Werror=unused-variable] Rather than trying to add more complex #ifdef protections, this marks the variable as __maybe_unused so it can be silently dropped when usused. Fixes: bd9dcd046509 ("debugobjects: Export max loops counter") Signed-off-by: Arnd Bergmann --- lib/debugobjects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 Acked-by: Yang Shi diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 105ecfc47d8c..994be4805cec 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -53,7 +53,7 @@ static int obj_nr_tofree; static struct kmem_cache *obj_cache; static int debug_objects_maxchain __read_mostly; -static int debug_objects_maxchecked __read_mostly; +static int __maybe_unused debug_objects_maxchecked __read_mostly; static int debug_objects_fixups __read_mostly; static int debug_objects_warnings __read_mostly; static int debug_objects_enabled __read_mostly