From nobody Sun Feb 8 09:13:21 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5118DEB64D7 for ; Fri, 16 Jun 2023 14:44:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345687AbjFPOoJ (ORCPT ); Fri, 16 Jun 2023 10:44:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345684AbjFPOoG (ORCPT ); Fri, 16 Jun 2023 10:44:06 -0400 Received: from imap5.colo.codethink.co.uk (imap5.colo.codethink.co.uk [78.40.148.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A303230F3 for ; Fri, 16 Jun 2023 07:44:04 -0700 (PDT) Received: from [167.98.27.226] (helo=rainbowdash) by imap5.colo.codethink.co.uk with esmtpsa (Exim 4.94.2 #2 (Debian)) id 1qAAgC-009VIn-Dp; Fri, 16 Jun 2023 15:44:01 +0100 Received: from ben by rainbowdash with local (Exim 4.96) (envelope-from ) id 1qAAgD-000ivQ-09; Fri, 16 Jun 2023 15:44:01 +0100 From: Ben Dooks To: linux-kernel@vger.kernel.org, Nick Terrell Cc: Ben Dooks Subject: [PATCH] zstd: fix g_debuglevel export warning Date: Fri, 16 Jun 2023 15:44:00 +0100 Message-Id: <20230616144400.172683-1-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The g_debuglevel variable in debug.c is only used when DEBUGLEVEL is defined to be above 2. This means by default there's no actual definition of this in the headers, so sparse is giving the following warning: lib/zstd/common/debug.c:24:5: warning: symbol 'g_debuglevel' was not declar= ed. Should it be static? We can use the same check as in the header to remove this if it isn't going to be used, silencing the warning and removing a small bit of unused data. Signed-off-by: Ben Dooks --- lib/zstd/common/debug.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/zstd/common/debug.c b/lib/zstd/common/debug.c index bb863c9ea616..820520b93d2b 100644 --- a/lib/zstd/common/debug.c +++ b/lib/zstd/common/debug.c @@ -21,4 +21,6 @@ =20 #include "debug.h" =20 +#if (DEBUGLEVEL>=3D2) int g_debuglevel =3D DEBUGLEVEL; +#endif --=20 2.39.2