Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3563385pxb; Mon, 24 Jan 2022 12:17:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGQWfkg/DnJ57y4orGfaDsO+AEWNBqtofx4a3NAZ3/3IEAOTibHYYlgLGVB2mGy2e9cE8Q X-Received: by 2002:a05:6a00:1946:b0:44d:8136:a4a4 with SMTP id s6-20020a056a00194600b0044d8136a4a4mr15306791pfk.46.1643055477843; Mon, 24 Jan 2022 12:17:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055477; cv=none; d=google.com; s=arc-20160816; b=Lox39u2JMViWyiE+BbNpPBjIOSgmAldlsbSf1fseC7n15HI4DF0y+NyG/yp+yXz9Hg kb0EUI5gIfc13O0cXxRpRFEq+2nnj1NU6E7ZZqCfF0gl/HLQIwacWa9OZ29FGJWbD24C O13+Yq8eZhhcyMU453by722j6r4dD0AiyokBnfjjk4ZqPCbXDdDbRysaIH4/kXFVEcvK GZdoM6nuRK4x0inY4RrBbaU2/qkRqMnJ7e92hf2V+gupfsTQXOpumgDx/54niATCgeB1 5ga8OR11wbFH8aadcPyvuKhYiMtwmigDmJ95HQnRsKCf1oAEYEI9jsKxRCNHMj0IF9zO 3egw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H9FLC/cGiZzx9+WW2QVB7GYKLZJfGDS+hNwBnRkrzq0=; b=VNznr56rmDcFbGUQTntVFIcfgUNqAdtrSacV3jyItz1n3gRdNx53HqGlslpqhPIwY6 scQpHyhy9GsrIYG2MdgNEarqMrX3TsBsJ+EjYSMi1/rvZiYvHVHWKkeQ07R+5GJ7VbaO mOvdZFPYpAEyejpzUm3rjJ6EYnx73a2xU5Rj/4WY8kbMtxska0ZpYtUasdpTX8x4VWVz bnVVo9jk+8i2zFtL9ACJvEX7+4W+j2wpHNArs4xYwg1VRRwgyl0wdAEgD0zW4XhP8Fid Dr/mLk5aTr+Qo6cENV7/4BDlHU7iwzuEDbuJIW9tivexvNazbB/hjh40g0TYVQWsBWqp tMhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w1Fwtiwj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c2si15425579plh.127.2022.01.24.12.17.45; Mon, 24 Jan 2022 12:17:57 -0800 (PST) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w1Fwtiwj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349040AbiAXTUF (ORCPT + 99 others); Mon, 24 Jan 2022 14:20:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347805AbiAXTLL (ORCPT ); Mon, 24 Jan 2022 14:11:11 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00591C08E87C; Mon, 24 Jan 2022 11:02:42 -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 B2C67B8119D; Mon, 24 Jan 2022 19:02:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7B06C340E5; Mon, 24 Jan 2022 19:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050960; bh=IR6MvDjAe+wJMl1IxlgonkXpDFZ0GOTFD4VnS/SjRDc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w1FwtiwjS6nHEo75YV6M/ro716I+KWV0Ul2Led8Xky3eLRyO/srG9lYaB9wp9/IcZ N1SlyGMn8H2knOJteTbh7AhkZKkncrtSMM/C1TTp/V/SBrYfQGUpxkPSgAaT3A2Fh0 WZZKihJQJigMGPtpshKu9ylZJk/NDfkGmiPWdJwI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nick Desaulniers , Nathan Chancellor , =?UTF-8?q?D=C3=A1vid=20Bolvansk=C3=BD?= , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Subject: [PATCH 4.14 010/186] drm/i915: Avoid bitwise vs logical OR warning in snb_wm_latency_quirk() Date: Mon, 24 Jan 2022 19:41:25 +0100 Message-Id: <20220124183937.447155070@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor commit 2e70570656adfe1c5d9a29940faa348d5f132199 upstream. A new warning in clang points out a place in this file where a bitwise OR is being used with boolean types: drivers/gpu/drm/i915/intel_pm.c:3066:12: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical] changed = ilk_increase_wm_latency(dev_priv, dev_priv->wm.pri_latency, 12) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This construct is intentional, as it allows every one of the calls to ilk_increase_wm_latency() to occur (instead of short circuiting with logical OR) while still caring about the result of each call. To make this clearer to the compiler, use the '|=' operator to assign the result of each ilk_increase_wm_latency() call to changed, which keeps the meaning of the code the same but makes it obvious that every one of these calls is expected to happen. Link: https://github.com/ClangBuiltLinux/linux/issues/1473 Reported-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Suggested-by: Dávid Bolvanský Reviewed-by: Nick Desaulniers Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211014211916.3550122-1-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/intel_pm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -2985,9 +2985,9 @@ static void snb_wm_latency_quirk(struct * The BIOS provided WM memory latency values are often * inadequate for high resolution displays. Adjust them. */ - changed = ilk_increase_wm_latency(dev_priv, dev_priv->wm.pri_latency, 12) | - ilk_increase_wm_latency(dev_priv, dev_priv->wm.spr_latency, 12) | - ilk_increase_wm_latency(dev_priv, dev_priv->wm.cur_latency, 12); + changed = ilk_increase_wm_latency(dev_priv, dev_priv->wm.pri_latency, 12); + changed |= ilk_increase_wm_latency(dev_priv, dev_priv->wm.spr_latency, 12); + changed |= ilk_increase_wm_latency(dev_priv, dev_priv->wm.cur_latency, 12); if (!changed) return;