From patchwork Wed Jul 5 14:01:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13302190 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 4C629EB64DD for ; Wed, 5 Jul 2023 14:01:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232415AbjGEOB2 (ORCPT ); Wed, 5 Jul 2023 10:01:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232308AbjGEOB1 (ORCPT ); Wed, 5 Jul 2023 10:01:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86F0511B; Wed, 5 Jul 2023 07:01:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2529261568; Wed, 5 Jul 2023 14:01:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48E37C433C8; Wed, 5 Jul 2023 14:01:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688565684; bh=FHi/Fy+Rz8l44deZjk2XDQviwjz4I8IKV7b4enS5SEQ=; h=From:To:Cc:Subject:Date:From; b=d2SMSLOC31lu72n6cEq55pYUHZ71RewQ1uNdAFL0V6qKqUAFnZjVk7ZVpCMtE34dV 3Q0PHhYLzvVklSe1xjMHMKqVd2ClWG2044YARAp7SVuO89L/wzO/sAchA9acLwbu9O TwXV0lk+LuIegaUnyo94LcxlIJqlPo3T3D4gq/6lHQzlN6N+qVcLe3iMQ7986xE8n7 kj/q95yHPBrFJb12w+SUV3XhBhfTfMIAbjkl8Zw8SOpX800YI/wlShsZNUBDjjjgue /tDNqMyRt65UeIFdipeCPiJuiqkGCmlIq5+BrIjXyGPI7XwrML50Mf7iX8FLTNhfnF 6JlWH9oQtSCHw== From: Arnd Bergmann To: Chris Mason , Josef Bacik , David Sterba Cc: Arnd Bergmann , Johannes Thumshirn , Anand Jain , Filipe Manana , Qu Wenruo , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] btrfs: avoid Wmaybe-uninitialized warnings Date: Wed, 5 Jul 2023 16:01:08 +0200 Message-Id: <20230705140117.795478-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Arnd Bergmann The -Wmaybe-uninitialized warning option in gcc produces tons of false positive warnings when KASAN is enabled, as that turns off some required optimizations. Rework the makefile to only enable the warning in btrfs when KASAN is disabled, as it was before commit 78a5255ffb6a1 ("Stop the ad-hoc games with -Wno-maybe-initialized") turned it off globally. Fixes: 1ec49744ba83f ("btrfs: turn on -Wmaybe-uninitialized") Signed-off-by: Arnd Bergmann --- fs/btrfs/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile index 90d53209755bf..a4927bf2ce7ee 100644 --- a/fs/btrfs/Makefile +++ b/fs/btrfs/Makefile @@ -11,8 +11,12 @@ condflags := \ $(call cc-option, -Wunused-but-set-variable) \ $(call cc-option, -Wunused-const-variable) \ $(call cc-option, -Wpacked-not-aligned) \ - $(call cc-option, -Wstringop-truncation) \ - $(call cc-option, -Wmaybe-uninitialized) + $(call cc-option, -Wstringop-truncation) + +ifndef CONFIG_KASAN +conflags += $(call cc-option, -Wmaybe-uninitialized) +endif + subdir-ccflags-y += $(condflags) # The following turn off the warnings enabled by -Wextra subdir-ccflags-y += -Wno-missing-field-initializers