Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5724047imb; Fri, 8 Mar 2019 00:29:33 -0800 (PST) X-Google-Smtp-Source: APXvYqzsOSPwjrlzmcNGrNv7RxBQj+jsKyH7EYXjXsOdFZoOXxiDkkxqpZdT7MUkTS/yGdOISSKo X-Received: by 2002:a65:52cd:: with SMTP id z13mr15771857pgp.134.1552033773550; Fri, 08 Mar 2019 00:29:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552033773; cv=none; d=google.com; s=arc-20160816; b=KjBCmOh0ILhtBNav2SZdNE2Rvhv5aG5TxEV2JpNJro7YyOZ1vy29T3zveZVqfFjNfE +VUbrgzqDLTtqwKtNDtCHk9LgpSh2DllQ2CQg4VEM87/QdOKfzXu4ZjIpIfSthCEFj65 HmZB+sAkbd2p8LItnT2Ik5SmcMbcHJ8M45X3tVI0xIfaQQwVRXuFMNHhhVunLv/1UOag HKUev0nwlVHqTYInCH6iio8j2Jah4pFQ9Vub29ifM0gJKl0TKOoLBscqaHarQKiGNOCh gl0svi4GTOcXg5zFRBJSd3Z9rsxBnr8d07v4f3Lt4ZDx1sVYTbbWSt18RBZH3xUX0WON wOZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version; bh=p9ZrcRtt+sloFLuAkbwJk5VWOPjRP1ULwRNhayHhCWY=; b=Slg5Dnlbu9/oPTd+j9Y+VUOIZ+uDADw9/oKD8WY1pyhxosFXjLiKqXrWVWZO/gUqzk RR8ya+/kJ3ipF36Yj5i15lk1AatghtKdLTIE1tHmlSw3hIexdZxM081BRWhwM0QR84OO zaoyTu+5idHjeqIebVBYKxamrveTxRi8R0YraRrm7g95SBGVodT+b+pz4rgT0okVSkVh 0DsgtuiZ09UJGqN55FnS6VhPsarpyJSbfDynHoaCZvNehXX6WZJ9mEyWi5RFbiypZkZw IMKnALON8q/GOzA/hpDWzTnByx/ziCHTMPcItjhAJblgWEq2zzdIIY6YDWgE/cNmRTkZ kMJA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si6025194pgq.185.2019.03.08.00.29.17; Fri, 08 Mar 2019 00:29:33 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726361AbfCHI10 convert rfc822-to-8bit (ORCPT + 99 others); Fri, 8 Mar 2019 03:27:26 -0500 Received: from mail.fireflyinternet.com ([109.228.58.192]:59747 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725789AbfCHI10 (ORCPT ); Fri, 8 Mar 2019 03:27:26 -0500 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from localhost (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP (TLS) id 15819001-1500050 for multiple; Fri, 08 Mar 2019 08:27:13 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT To: Jani Nikula , Joonas Lahtinen , Nathan Chancellor , Rodrigo Vivi From: Chris Wilson In-Reply-To: <20190308012023.5709-1-natechancellor@gmail.com> Cc: intel-gfx@lists.freedesktop.org, Nick Desaulniers , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, clang-built-linux@googlegroups.com, Nathan Chancellor References: <20190308012023.5709-1-natechancellor@gmail.com> Message-ID: <155203363088.27405.11887329278848171622@skylake-alporthouse-com> User-Agent: alot/0.6 Subject: Re: [Intel-gfx] [PATCH] drm/i915: Zero initialize this_cpu in busywait_stop Date: Fri, 08 Mar 2019 08:27:10 +0000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Nathan Chancellor (2019-03-08 01:20:24) > When building with -Wsometimes-uninitialized, Clang warns: > > drivers/gpu/drm/i915/i915_request.c:1032:6: warning: variable 'this_cpu' > is used uninitialized whenever '&&' condition is false > [-Wsometimes-uninitialized] > > time_after expands to use two typecheck with logical ANDs between them. > typecheck evaluates to 1 but Clang clearly gets confused with the logic > that as semantic analysis happens early in the pipeline. Fix this by > just zero initializing this_cpu as it will always be properly > initialized before the comparison below. > > Link: https://github.com/ClangBuiltLinux/linux/issues/415 > Signed-off-by: Nathan Chancellor > --- > > Alternatively, this can be solved by having the return value of > local_clock_us(&this_cpu) be a local variable but this seems less > controversial. I'll just wait for clang to be fixed, as this severely undermines any respect I have for its semantic analysis. -Chris