Received: by 2002:ab2:23c8:0:b0:1f2:fdbc:cb93 with SMTP id a8csp138578lqe; Wed, 27 Mar 2024 00:54:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV2RechDY5a7ZxjfJyfEgJhn9rlgk/Rla7QcbGNPGrWPxsJ6Xy6O8CzsBcgG4khS/jwe5hdqX4wqf0whYgWpcXVQ9LBFwCPjiC18hEvAQ== X-Google-Smtp-Source: AGHT+IFUJP/3nOoweuxUdRbcaTGJCGNyH4wmdAU0uimERdRMMNyhmVYohhPMn9U7PobybQoREh/c X-Received: by 2002:a50:8e11:0:b0:56b:a092:b6eb with SMTP id 17-20020a508e11000000b0056ba092b6ebmr348646edw.35.1711526092624; Wed, 27 Mar 2024 00:54:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711526092; cv=pass; d=google.com; s=arc-20160816; b=xrJwU5u+li/ZsRcbR86LqqBlF9YMxxkA4FRUZxdSolwABYnRYB95GzTn2mQjAvbi8L BGJ17gwbQ2ie+gaHfsk+pMMWjLuCxrUUAJrQtR+odrMPHkUd5P2zK3T2SvpC9Iw3ARJB x+APzG+nSLQbtjvnHu/l0fTrIUCPddSIQd2JMZnInmKV6VpY5Dm/75POp2Sb7uVg0C/o tb7I5D3u9l2cRRjCuT4YNW3xVz3Ri5KX5uyXeRuFn2NtvIWwauDURxhu3E1cG6xlynm7 Wc/PO6GXkppjbxStGXceiS9imqO0WGJf+OFc9aR9UWbl8UYHPGMaCjihvb94czzFpIN4 UxHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:organization:in-reply-to:subject:cc:to :from:dkim-signature; bh=8LS42RD3JgnSHisQrv46OAfEznsTYikofUDOW3TMFc0=; fh=vZCS/+d3ilFtpzaXGD/zKHXVPjFNy8CsFfzHTWMAoPw=; b=ZlhQ5v6LIonhGjXIpGsdDMhL/RIbnUro/WJCwL2Ss5++GkXhVSEC7/LxJ+B7SXlod9 sA6vB4ncODJJUqEUlGUrF99mCuXSDFwUY/Td0xWIo5/vBHvyPAv+0+NvgxLPY8ap9ozf NFslIsbr8OoBSrHsb9FqtTmJmE+8KAQssoXZMe382gmWKy0iazLTmHCqJI3QRTMgGk2x C9iOFMH5AuDN3zFP6LC0XcAiZVDetFbLLfVLUpHqr3uQzamBPo0qosIHg0NcD8x9XgKF 3wE58B4yR2hZpC+pqwXZTVa9Jwo/xt93f3pyroY+bsmQJKaPsz1rg7lkOxzvP0sgLned HKmQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mBdwjkqw; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-120472-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120472-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id fj9-20020a0564022b8900b00568d7c4b843si4531463edb.298.2024.03.27.00.54.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 00:54:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120472-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mBdwjkqw; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-120472-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120472-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 178C71F2A944 for ; Wed, 27 Mar 2024 07:54:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2929B3BBD1; Wed, 27 Mar 2024 07:50:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="mBdwjkqw" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE5A82E651; Wed, 27 Mar 2024 07:50:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711525819; cv=none; b=fb7DIMoEfXcy8viV0fgq66QCFvxrq6+3AWcCynza4hqULrPrVdy5bJQU1OB3TKcoLHXKt/8bQgUUiXHEgrbTeXp842qjtP0+4QcYE2uMhwAmPKc7PTcUWzuwbXHKsrKddukXKOKk1WDKgp0Wc+miQsRyQDcIUoyGG6him+fI2Wc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711525819; c=relaxed/simple; bh=+I0dUNOdZGkwtBeC0T1EU1TrsDrWBxEiMA9XkoJPZrg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=A6Ghz/AYm4Zg5LvKYaDlxauccQlV19cW/f1PCDce9tXxt88rgc5sAFIpg2e5/RSWORcPVHXXNBklREqVuthV4OeUus1AXjCGFDFL44UYwglYys9FL1Maae666IZ+uYqC+hH6G5Z55Jj5kjYHPyLQ/tnKIk3rOU9+tjd+ogmA6ts= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=mBdwjkqw; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711525817; x=1743061817; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=+I0dUNOdZGkwtBeC0T1EU1TrsDrWBxEiMA9XkoJPZrg=; b=mBdwjkqwAsAxs3oi7apG/3ZtBkcnGikAWzoehoPZOkbTYpetrxHWvsfX +eph1azzxHrFfNAOe6p3LmfchINcPPToWi/uSzbVnwVpruMnB9sCEFaLe 6Vtjlt2UVeYpyuHgis9/Bamdy7vhl6jo6xfrokuGIgi5DF76sHeH3ViIA 0CyFfaC5yKldgVT8vTWq1tQLAx7V1Zzt5Qh37mN1+jSMm7ppYAORBtgoZ CvpJr8zEtA9Lw8dPHV/iPBMlmZCOWcE7GDpphatxEOVFPHAUqnLxZNonI wQEAoOq8KpfgzUnoQhZbRHqTqka+psUEpRumluka9xe1SnEhxqH4FODgt Q==; X-CSE-ConnectionGUID: MsyQbz5AQHy8y68fVaLnuQ== X-CSE-MsgGUID: hocw4mZkQ2y001r8rNwlqA== X-IronPort-AV: E=McAfee;i="6600,9927,11025"; a="6467190" X-IronPort-AV: E=Sophos;i="6.07,158,1708416000"; d="scan'208";a="6467190" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 00:50:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,158,1708416000"; d="scan'208";a="16277502" Received: from mmazilu-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.56.43]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 00:50:08 -0700 From: Jani Nikula To: Arnd Bergmann , Arnd Bergmann , linux-kbuild@vger.kernel.org, Masahiro Yamada , Harry Wentland , Alex Deucher , Christian =?utf-8?Q?K=C3=B6nig?= , Lucas De Marchi , Oded Gabbay , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jakub Kicinski , Paolo Abeni , Andrew Jeffery , Linus Walleij , Joel Stanley , Alexei Starovoitov , Daniel Borkmann , Andrew Morton , Nathan Chancellor Cc: Nicolas Schier , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Netdev , linux-mm@kvack.org, llvm@lists.linux.dev Subject: Re: [PATCH 01/12] kbuild: make -Woverride-init warnings more consistent In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20240326144741.3094687-1-arnd@kernel.org> <20240326144741.3094687-2-arnd@kernel.org> <87jzlohhbc.fsf@intel.com> Date: Wed, 27 Mar 2024 09:50:05 +0200 Message-ID: <87edbwglle.fsf@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Tue, 26 Mar 2024, "Arnd Bergmann" wrote: > On Tue, Mar 26, 2024, at 21:24, Jani Nikula wrote: >> On Tue, 26 Mar 2024, Arnd Bergmann wrote: >>> From: Arnd Bergmann >>> index 475e1e8c1d35..0786eb0da391 100644 >>> --- a/drivers/net/ethernet/renesas/sh_eth.c >>> +++ b/drivers/net/ethernet/renesas/sh_eth.c >>> @@ -50,7 +50,7 @@ >>> * the macros available to do this only define GCC 8. >>> */ >>> __diag_push(); >>> -__diag_ignore(GCC, 8, "-Woverride-init", >>> +__diag_ignore_all("-Woverride-init", >>> "logic to initialize all and then override some is OK"); >> >> This is nice because it's more localized than the per-file >> disable. However, we tried to do this in i915, but this doesn't work for >> GCC versions < 8, and some defconfigs enabling -Werror forced us to >> revert. See commit 290d16104575 ("Revert "drm/i915: use localized >> __diag_ignore_all() instead of per file""). > > It works now. > > The original __diag_ignore_all() only did it for gcc-8 and above > because that was initially needed to suppress warnings that > got added in that version, but this was always a mistake. > > 689b097a06ba ("compiler-gcc: Suppress -Wmissing-prototypes > warning for all supported GCC") made it work correctly. Oh, nice! Then I think we'd like to go back to __diag_ignore_all() in i915 and xe. The diff is below. I'm fine with you squashing it to your patch, or if you want me to turn it into a proper patch for you to pick up in your series, that's fine too. Just let me know. BR, Jani. Signed-off-by: Jani Nikula diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile index 3ef6ed41e62b..87d6ba8d2341 100644 --- a/drivers/gpu/drm/i915/Makefile +++ b/drivers/gpu/drm/i915/Makefile @@ -32,11 +32,6 @@ endif # Enable -Werror in CI and development subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror -# Fine grained warnings disable -CFLAGS_i915_pci.o = $(call cc-disable-warning, override-init) -CFLAGS_display/intel_display_device.o = $(call cc-disable-warning, override-init) -CFLAGS_display/intel_fbdev.o = $(call cc-disable-warning, override-init) - # Support compiling the display code separately for both i915 and xe # drivers. Define I915 when building i915. subdir-ccflags-y += -DI915 diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c index c02d79b50006..b8903bd0e82a 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.c +++ b/drivers/gpu/drm/i915/display/intel_display_device.c @@ -17,6 +17,9 @@ #include "intel_display_reg_defs.h" #include "intel_fbc.h" +__diag_push(); +__diag_ignore_all("-Woverride-init", "Allow field initialization overrides for display info"); + static const struct intel_display_device_info no_display = {}; #define PIPE_A_OFFSET 0x70000 @@ -768,6 +771,8 @@ static const struct intel_display_device_info xe2_lpd_display = { BIT(INTEL_FBC_C) | BIT(INTEL_FBC_D), }; +__diag_pop(); + /* * Separate detection for no display cases to keep the display id array simple. * diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c index 99894a855ef0..43855c6c3509 100644 --- a/drivers/gpu/drm/i915/display/intel_fbdev.c +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c @@ -135,6 +135,9 @@ static int intel_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma) return i915_gem_fb_mmap(obj, vma); } +__diag_push(); +__diag_ignore_all("-Woverride-init", "Allow field initialization overrides for fb ops"); + static const struct fb_ops intelfb_ops = { .owner = THIS_MODULE, __FB_DEFAULT_DEFERRED_OPS_RDWR(intel_fbdev), @@ -146,6 +149,8 @@ static const struct fb_ops intelfb_ops = { .fb_mmap = intel_fbdev_mmap, }; +__diag_pop(); + static int intelfb_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) { diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c index 1e69783ae4fd..405ca17a990b 100644 --- a/drivers/gpu/drm/i915/i915_pci.c +++ b/drivers/gpu/drm/i915/i915_pci.c @@ -38,6 +38,9 @@ #include "i915_reg.h" #include "intel_pci_config.h" +__diag_push(); +__diag_ignore_all("-Woverride-init", "Allow field initialization overrides for device info"); + #define PLATFORM(x) .platform = (x) #define GEN(x) \ .__runtime.graphics.ip.ver = (x), \ @@ -785,6 +788,8 @@ static const struct intel_device_info mtl_info = { #undef PLATFORM +__diag_pop(); + /* * Make sure any device matches here are from most specific to most * general. For example, since the Quanta match is based on the subsystem diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile index 3c3e67885559..2f58faf0a79a 100644 --- a/drivers/gpu/drm/xe/Makefile +++ b/drivers/gpu/drm/xe/Makefile @@ -172,9 +172,6 @@ subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \ -Ddrm_i915_gem_object=xe_bo \ -Ddrm_i915_private=xe_device -CFLAGS_i915-display/intel_fbdev.o = $(call cc-disable-warning, override-init) -CFLAGS_i915-display/intel_display_device.o = $(call cc-disable-warning, override-init) - # Rule to build SOC code shared with i915 $(obj)/i915-soc/%.o: $(srctree)/drivers/gpu/drm/i915/soc/%.c FORCE $(call cmd,force_checksrc) -- Jani Nikula, Intel