Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4063459pxb; Mon, 4 Oct 2021 16:33:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypiCeE7uoQsx2WV2NR+bfv1EIMlQpeQ8mIQNHTeiIBIbjL6cu8vqm0TUyBhFNY4neVEL/O X-Received: by 2002:a05:6402:452:: with SMTP id p18mr21636259edw.34.1633390408227; Mon, 04 Oct 2021 16:33:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633390408; cv=none; d=google.com; s=arc-20160816; b=K9wQPvfcyBN/4imJxVTRNkcFj7ZcSHT+Ln0PEyxomOdjknP3EbiqdE3E+FS8EKWVw4 AUeJTvOkHrPrPz0XPNHTUwRuSGNPEFIh7phydYHkxY3tlPOCpTlN+5SfAnieYOnOk2Wz 1zbYtD8Mc5D/VMwwnwNDLd2SNHYG94ndOd3y823mXaN+/7z6fd/AHcFestCw6TwoRWe5 BufFifvDZVFxoi/6k6qPhFm+Ct6XCAuD5QuJ5YVLULs7PZ0arpQmnGda9lBfIXvCsjV8 MrKUA5hRk3ReXBCtYXZPzOgSkFp9lolqofBAnkpmWWxENajOeMjYNxF7XiDd89iBDa+L HzBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from; bh=70DIcQhhpHsDZKfEM8h68r1/03xE7sxVzIKXF2+jo98=; b=eau8FNPaBU/EjeU5RfnmNyzNqjnzpnZU98e8lp7TaEo9axHoT4rZeLB8i9a9j1DJcY 3Cam5MMTAeS3ndiPaVo50R18DrMoYZO0LX1AwHZ3wRT8KyL5wWhyQC+FG8XNhKiRPtUY NszhnwFQWKpmyNod6rqCMx49r4Mk8EIRLp9dP0/dn8VqUOoMSKYZ6Q7ojqu6K38gZ9SJ JdrTBWf7MtZK35we6t6y+JhhxxwCL6asKWE7BKUn8Epmj9f+4cnZLeGbUAPg6CbROPeF 9Z4aYt1w8m+n5hqRDuBQ5/TcP0wlSnP0Lg6GB+3eK37dK1LP6/avsiiAqoCxifjBoU0h W2wg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nc14si33987263ejc.181.2021.10.04.16.33.02; Mon, 04 Oct 2021 16:33:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236054AbhJDTIp (ORCPT + 99 others); Mon, 4 Oct 2021 15:08:45 -0400 Received: from mga17.intel.com ([192.55.52.151]:46637 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233226AbhJDTIo (ORCPT ); Mon, 4 Oct 2021 15:08:44 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10127"; a="206367250" X-IronPort-AV: E=Sophos;i="5.85,346,1624345200"; d="scan'208";a="206367250" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2021 10:44:18 -0700 X-IronPort-AV: E=Sophos;i="5.85,346,1624345200"; d="scan'208";a="477275904" Received: from pmittal1-mobl.gar.corp.intel.com (HELO localhost) ([10.251.223.27]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2021 10:43:55 -0700 From: Jani Nikula To: Nathan Chancellor , Joonas Lahtinen , Rodrigo Vivi Cc: Nick Desaulniers , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor Subject: Re: [PATCH v2] drm/i915: Clean up disabled warnings In-Reply-To: <20210914194944.4004260-1-nathan@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20210914194944.4004260-1-nathan@kernel.org> Date: Mon, 04 Oct 2021 20:43:41 +0300 Message-ID: <87v92c1y9e.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Sep 2021, Nathan Chancellor wrote: > i915 enables a wider set of warnings with '-Wall -Wextra' then disables > several with cc-disable-warning. If an unknown flag gets added to > KBUILD_CFLAGS when building with clang, all subsequent calls to > cc-{disable-warning,option} will fail, meaning that all of these > warnings do not get disabled [1]. > > A separate series will address the root cause of the issue by not adding > these flags when building with clang [2]; however, the symptom of these > extra warnings appearing can be addressed separately by just removing > the calls to cc-disable-warning, which makes the build ever so slightly > faster because the compiler does not need to be called as much before > building. > > The following warnings are supported by GCC 4.9 and clang 10.0.1, which > are the minimum supported versions of these compilers so the call to > cc-disable-warning is not necessary. Masahiro cleaned this up for the > reset of the kernel in commit 4c8dd95a723d ("kbuild: add some extra > warning flags unconditionally"). > > * -Wmissing-field-initializers > * -Wsign-compare > * -Wtype-limits > * -Wunused-parameter > > -Wunused-but-set-variable was implemented in clang 13.0.0 and > -Wframe-address was implemented in clang 12.0.0 so the > cc-disable-warning calls are kept for these two warnings. > > Lastly, -Winitializer-overrides is clang's version of -Woverride-init, > which is disabled for the specific files that are problematic. clang > added a compatibility alias in clang 8.0.0 so -Winitializer-overrides > can be removed. > > [1]: https://lore.kernel.org/r/202108210311.CBtcgoUL-lkp@intel.com/ > [2]: https://lore.kernel.org/r/20210824022640.2170859-1-nathan@kernel.org/ > > Reviewed-by: Nick Desaulniers > Signed-off-by: Nathan Chancellor Thanks for the patch, and sorry for the delay. Exceptionally pushed to drm-intel-gt-next instead of drm-intel-next because some of the dependencies such as 43192617f781 ("drm/i915: Enable -Wsometimes-uninitialized") were queued there too. BR, Jani. > --- > > v1 -> v2: https://lore.kernel.org/r/20210824232237.2085342-1-nathan@kernel.org/ > > * Rebase on drm-intel-gt-next now that the prerequisite patch series has > been merged: https://lore.kernel.org/r/87wnnj13t5.fsf@intel.com/ > > * Add Nick's reviewed-by tag. > > drivers/gpu/drm/i915/Makefile | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile > index c584188aa15a..fd99374583d5 100644 > --- a/drivers/gpu/drm/i915/Makefile > +++ b/drivers/gpu/drm/i915/Makefile > @@ -13,13 +13,11 @@ > # will most likely get a sudden build breakage... Hopefully we will fix > # new warnings before CI updates! > subdir-ccflags-y := -Wall -Wextra > -subdir-ccflags-y += $(call cc-disable-warning, unused-parameter) > -subdir-ccflags-y += $(call cc-disable-warning, type-limits) > -subdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers) > +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 += $(call cc-disable-warning, unused-but-set-variable) > -# clang warnings > -subdir-ccflags-y += $(call cc-disable-warning, sign-compare) > -subdir-ccflags-y += $(call cc-disable-warning, initializer-overrides) > subdir-ccflags-y += $(call cc-disable-warning, frame-address) > subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror > > > base-commit: 43192617f7816bb74584c1df06f57363afd15337 -- Jani Nikula, Intel Open Source Graphics Center