Received: by 10.192.165.148 with SMTP id m20csp4206788imm; Mon, 30 Apr 2018 13:52:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoUtcBWSNOeGHdUovvNQFsiLifb6K6Rcif14p4wo/q6CWFIa/9vGwtv677vGwnbEC/33na5 X-Received: by 10.98.47.2 with SMTP id v2mr13293449pfv.239.1525121540363; Mon, 30 Apr 2018 13:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525121540; cv=none; d=google.com; s=arc-20160816; b=dG+7n6lNpQwgdkBQn7/YSCcqjyFKrHcfghnbdkL3RQ0ynccV83MBSZTfU/8g/ImYmj h4ecgczaVv1gPj0b+DqNMZBZiNfs30mbDE79EbZUfYbM42MqSabqyLf9yJeLKQEBzzNC DOEOj8e0rdV90iNgg1PltGGmP2oTcsJYNYWyna83ByjF3PeDw8oVqpvP7RhBvnNPVG6k lHwTKy7/6Dq60s6jvwZSd5VeZcuqQDDHN4ckPMw0yhJQGvyyB80BHRRVwP82+YEC2+9l CBRwHFPy9F+p4pNQqtHsa+oUilyVXO7vtW6TW6iaOsSZAMph7RlnHIxDL0Yb8UUEORSD Sg9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=uQJskhJI2IeuogijaXa9yb833B8xyy+dAu8QFhNNEX0=; b=CZLcCtpJ/ErUZzi2AxHIwF/v3nzxlwljcW9AL+Ak3dQVYzb4Q6ToKskaUN6GGH0N6y MpGSn8kQUzBdGVdDgRla9hFCFDyZ5/NOER7/MFYonv78pSCBENATUQKWu49fFdf0igny 6220X/FBCM4sAGz0Ap/miD+p5StQw+Y+fN7hcM8CP3+mKGpV5K7/4DFcP33ZbVqDxaKF u7blYkmb/2eAsTqC0CTiG2Utrnys9gqwujjAQIQlPgHek41jpdBuDA4WYAaMwjKW/ufT QGA/MNTMcVq1+7qzkGuVrvnP+f/LS/phybQXjra8J5uqeQJIXhNRnBbgFkcJAe8YVM+N cLfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RhuLEeBr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1-v6si6503205pge.538.2018.04.30.13.52.05; Mon, 30 Apr 2018 13:52:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RhuLEeBr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754936AbeD3Uvt (ORCPT + 99 others); Mon, 30 Apr 2018 16:51:49 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:42821 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751241AbeD3Uvr (ORCPT ); Mon, 30 Apr 2018 16:51:47 -0400 Received: by mail-pg0-f67.google.com with SMTP id p9-v6so4168358pgc.9 for ; Mon, 30 Apr 2018 13:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uQJskhJI2IeuogijaXa9yb833B8xyy+dAu8QFhNNEX0=; b=RhuLEeBrGmAXfqGhKaqCnI/OMhrxCHMCudopNg1qMysnCgENKyMlxPur147J97MHlG eWLZin4YcwUtewvxuN4pK5lV359NYqloL9RyC9yC/eBJa185R4uBtX5amyOdAystmkCR j0bfWPrIRPmu+IV4chu7Zwma7v/lIkCHkyz5k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=uQJskhJI2IeuogijaXa9yb833B8xyy+dAu8QFhNNEX0=; b=ejv4YgqEE0BVDuTn+V1+by2qvsSm3wAyQOq7klga5hpDxrjjJfebrq6ob+5U3dijEG JfIKTRjSuqrWy7AfMi7oyOmvZ04CXSea0uoeAqV7bJaWZbqvbKRO7ljWf2iOymsxLNIQ 1CbPpgsvMiFU+Gjy7+nr4kFRSEnkQunqx+xeo57YqKKRrPIBZVcK9XKccgoVsoNldQX/ 8hZeg3nM/4J4PfS4Rtkb4oSMr7mV9K1ZTBJHKhHiqzYrrcMo0dOrD16UXH4kk5fKk3kr MjG8QhWEuuPY6iOHICtmHU7IMDnG79eJNAm4dV9s0aFgOyWmcyIwknOFOddKBe0hrTJY Mk0w== X-Gm-Message-State: ALQs6tAO45hFGpJvNd9xrbfP/ZpZuI0W6kqrRdTt+QhbhMVAzRdex7ON vWz1wrcBHOxrFh/z8cce+ongyg== X-Received: by 2002:a17:902:968d:: with SMTP id n13-v6mr13329209plp.168.1525121506966; Mon, 30 Apr 2018 13:51:46 -0700 (PDT) Received: from localhost ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id u70sm8841079pfk.121.2018.04.30.13.51.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 13:51:46 -0700 (PDT) Date: Mon, 30 Apr 2018 13:51:45 -0700 From: Matthias Kaehlcke To: Chris Wilson Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Guenter Roeck , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [Intel-gfx] [PATCH v2] drm/i915: Disable some extra clang warnings Message-ID: <20180430205145.GC133494@google.com> References: <20180319191451.83910-1-mka@chromium.org> <20180430193119.GB133494@google.com> <152511850981.10429.1077865835761338509@mail.alporthouse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <152511850981.10429.1077865835761338509@mail.alporthouse.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 30, 2018 at 09:01:49PM +0100, Chris Wilson wrote: > Quoting Matthias Kaehlcke (2018-04-30 20:31:19) > > On Mon, Mar 19, 2018 at 12:14:51PM -0700, Matthias Kaehlcke wrote: > > > Commit 39bf4de89ff7 ("drm/i915: Add -Wall -Wextra to our build, set > > > warnings to full") enabled extra warnings for i915 to spot possible > > > bugs in new code, and then disabled a subset of these warnings to keep > > > the current code building without warnings (with gcc). Enabling the > > > extra warnings also enabled some additional clang-only warnings, as a > > > result building i915 with clang currently is extremely noisy. For now > > > also disable the clang warnings sign-compare, sometimes-uninitialized, > > > unneeded-internal-declaration and initializer-overrides. If desired > > > they can be re-enabled after the code has been fixed. > > > > > > Fixes: 39bf4de89ff7 ("drm/i915: Add -Wall -Wextra to our build, set > > > warnings to full") > > Do we need to backport this for a non-default build with a non-default > compiler? If it affected a LTS build I'd say yes, but since that isn't the case I think it's not necessary. > > > Signed-off-by: Matthias Kaehlcke > > > --- > > > Changes in v2: > > > - rebased on drm-tip > > > - added comment indicating that disabled warnings are clang warnings > > > > > > drivers/gpu/drm/i915/Makefile | 5 +++++ > > > 1 file changed, 5 insertions(+) > > > > > > diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile > > > index 4eee91a3a236..9717c037b582 100644 > > > --- a/drivers/gpu/drm/i915/Makefile > > > +++ b/drivers/gpu/drm/i915/Makefile > > > @@ -18,6 +18,11 @@ subdir-ccflags-y += $(call cc-disable-warning, type-limits) > > > subdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers) > > > subdir-ccflags-y += $(call cc-disable-warning, implicit-fallthrough) > > > subdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable) > > > +# clang warnings > > > +subdir-ccflags-y += $(call cc-disable-warning, sign-compare) > > Too much mixup in the code to be fixed overnight indeed. > > > > +subdir-ccflags-y += $(call cc-disable-warning, sometimes-uninitialized) > > Annoyingly it appears that clang has more false positives. > > > > +subdir-ccflags-y += $(call cc-disable-warning, unneeded-internal-declaration) > > Example? I don't recall this one, so don't know if we should just not > fix it rather than suppress. I've used ignored-attributes, perhaps that > was for the same cause. drivers/gpu/drm/i915/intel_guc_submission.c:183:13: warning: function 'has_doorbell' is not needed and will not be emitted [-Wunneeded-internal-declaration] static bool has_doorbell(struct intel_guc_client *client) The function is only called within a GEM_BUG_ON macro, which does not evaluate the expression unless CONFIG_DRM_I915_DEBUG_GEM is set. Instead of disabling the warning it would probably be better to mark has_doorbell as __maybe_unused.