Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3579682pxp; Tue, 8 Mar 2022 17:59:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzdVuga2XLPuxP66D+BwXQlcQqQgcyZBM+S8FFGzQyLpMNmKQKyrt5gSW4YyfBPL0q7SGa X-Received: by 2002:a17:903:234c:b0:151:e633:748f with SMTP id c12-20020a170903234c00b00151e633748fmr14369891plh.81.1646791149063; Tue, 08 Mar 2022 17:59:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646791149; cv=none; d=google.com; s=arc-20160816; b=AEADH0GTKB7OJtPf2fPcs3f1BtuaZN5kSKvGn7uP834gm44DskA960u3Y03BtinBTj IsFG0r/FHVkheZp5y79dbDRN9EFB+lYcRN61xocbFlRd9QskL5cIef0U6X9oaZvI1sDu +gWsqm3XzNU+bSxoEBhxgQizsTq1Z3YMFFzazFFhymuSedVdA3S2IDsWcquXWmfLp3VW M1IfkVl6F2VXGd+AT/AEIzLhy/D9x47ah2fQWUk49j28/9QT5mIEX8/C5708/6/NZkNd DJvrDFYxHnNcXsuP2BBUgSA9sgFeK3NPhY9/Np7oiK2ZBbMeXbIk+cUiVUWrGXLXsQIb VC2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7JJ+QkrKTVVaZ9ziCapSveoUvMzsPn6Ye+9SJz43tKs=; b=dC2vRUwUMk7XpYBVDrozp9yaRF7NOMy4NshaiO44k/r9KwNs+Eczj9T4trZoBr9tGR iIUV0OOMMZspSvD3hfgisUtmxMyEwPbQlVXkfF7UICJmfncfmOUa7pK1B2QdNsij+Efn N9jqrzF1KBjQsXMV52Frkei/yOEkqioy2kLS3ojYvGdMu9x7HqXt1zrl/pFqfn09kJBv 3Quno2wwYHKoZ08nfDArkV/1EwUXh6oegsAUoqoBVsb74tSEfJGyZHBYZcPzYu9lAjrE mxttdbxYEUavhsEu/8bPQsi9SkJ7hTNYDb+HwT4XGYuP8Dq922spqpKMsYY6Rx5S5wG7 IoJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MGcDWHDd; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id z12-20020a65610c000000b00373dd4e83f8si565812pgu.168.2022.03.08.17.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 17:59:09 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MGcDWHDd; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 06E1921A98C; Tue, 8 Mar 2022 16:33:37 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344544AbiCHV6C (ORCPT + 99 others); Tue, 8 Mar 2022 16:58:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350577AbiCHV55 (ORCPT ); Tue, 8 Mar 2022 16:57:57 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E78D50E07; Tue, 8 Mar 2022 13:57:00 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E6039B81D86; Tue, 8 Mar 2022 21:56:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BC43C340F9; Tue, 8 Mar 2022 21:56:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646776617; bh=MSDAfiFmxb619SbNV0Do6ViYQlOLDRcmxvg0q5mQXVg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MGcDWHDdpzSijirtmAR+bbuZP2FzIWh8GyKHYDevUEiMiwo5oAaKV8kVMjuWYTcZl QeSIFMI4XCpErcpUaSG8ulhzpgVPJq1gCUwI2SftIEoafLPwXA74zMnYRIuI9kTY/X KgnJDTclYL4o7ODLvWSOpj6I+iUf88LiLWNYyLbA7TH1AV8VLlm6n/u5EdB49MrJ/0 fZ6Baio/T7JaQ+1y35Ic458d1rPh0QxXs87jgA7/VFNJDxsC5tvBs5XaBZ8JRQFPRT yr9CvKVbA37y+Jz7GPiMGTrG6R8VI5WacCYe6SzjSOqr6DEaT6eV/xkTes5b6yWItb +wXyUC9EAOI6Q== From: Arnd Bergmann To: Masahiro Yamada Cc: alexs@kernel.org, arnd@arndb.de, arnd@kernel.org, dsterba@suse.com, elver@google.com, jani.nikula@intel.com, linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, mark.rutland@arm.com, ndesaulniers@google.com, ojeda@kernel.org, torvalds@linux-foundation.org Subject: [PATCH 1/4] [v4] Kbuild: add -Wno-shift-negative-value where -Wextra is used Date: Tue, 8 Mar 2022 22:56:12 +0100 Message-Id: <20220308215615.14183-2-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220308215615.14183-1-arnd@kernel.org> References: <20220308215615.14183-1-arnd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann As a preparation for moving to -std=gnu11, turn off the -Wshift-negative-value option. This warning is enabled by gcc when building with -Wextra for c99 or higher, but not for c89. Since the kernel already relies on well-defined overflow behavior, the warning is not helpful and can simply be disabled in all locations that use -Wextra. Signed-off-by: Arnd Bergmann --- [v4] split into a separate patch --- drivers/gpu/drm/i915/Makefile | 1 + drivers/staging/greybus/tools/Makefile | 3 ++- fs/btrfs/Makefile | 1 + scripts/Makefile.extrawarn | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile index 1b62b9f65196..1618a6e0af4e 100644 --- a/drivers/gpu/drm/i915/Makefile +++ b/drivers/gpu/drm/i915/Makefile @@ -17,6 +17,7 @@ subdir-ccflags-y += -Wno-unused-parameter subdir-ccflags-y += -Wno-type-limits subdir-ccflags-y += -Wno-missing-field-initializers subdir-ccflags-y += -Wno-sign-compare +subdir-ccflags-y += -Wno-shift-negative-value subdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable) subdir-ccflags-y += $(call cc-disable-warning, frame-address) subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror diff --git a/drivers/staging/greybus/tools/Makefile b/drivers/staging/greybus/tools/Makefile index ad0ae8053b79..a3bbd73171f2 100644 --- a/drivers/staging/greybus/tools/Makefile +++ b/drivers/staging/greybus/tools/Makefile @@ -12,7 +12,8 @@ CFLAGS += -std=gnu99 -Wall -Wextra -g \ -Wredundant-decls \ -Wcast-align \ -Wsign-compare \ - -Wno-missing-field-initializers + -Wno-missing-field-initializers \ + -Wno-shift-negative-value CC := $(CROSS_COMPILE)gcc diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile index 4188ba3fd8c3..99f9995670ea 100644 --- a/fs/btrfs/Makefile +++ b/fs/btrfs/Makefile @@ -17,6 +17,7 @@ subdir-ccflags-y += $(condflags) subdir-ccflags-y += -Wno-missing-field-initializers subdir-ccflags-y += -Wno-sign-compare subdir-ccflags-y += -Wno-type-limits +subdir-ccflags-y += -Wno-shift-negative-value obj-$(CONFIG_BTRFS_FS) := btrfs.o diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index 8be892887d71..650d0b8ceec3 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -36,6 +36,7 @@ KBUILD_CFLAGS += $(call cc-option, -Wstringop-truncation) KBUILD_CFLAGS += -Wno-missing-field-initializers KBUILD_CFLAGS += -Wno-sign-compare KBUILD_CFLAGS += -Wno-type-limits +KBUILD_CFLAGS += -Wno-shift-negative-value KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN1 -- 2.29.2