Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1240484pxk; Thu, 10 Sep 2020 10:21:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyA2QBXkxmf1tcmx4ohZhMO3Dx7OLZMC7wYzdkSjA+UBXJNcHY78mhSL/IWI5KDVZJJWfB X-Received: by 2002:a05:6402:1773:: with SMTP id da19mr9962555edb.171.1599758465442; Thu, 10 Sep 2020 10:21:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599758465; cv=none; d=google.com; s=arc-20160816; b=wyV8kIl9v9tnAcKxRc9q20ceoZkSlFpHPi9mV8hJWjsCeMg5cpULYfj4k2cf+iEiyB pYb7aUxhdbRAB7sbqrAjle6udM/HzbEPpeITWL00Joo3E/p+Q4z4RylWcYc5ZMSqIcM6 S5sVzUFe447NDt74fJtFmAZtKOwI1abrRSFj4xKSAKqg3h0f/jhWOUDkv8QzT6xHRC/+ +JNn8adRxn+Jj/TfVuSgDx+T4QgDPVp7DszVjJ7NEghUaOrYo8LU8cWn4pMoXO23MJHq KiWbpUE8x/n/oeRPpAYIUoqycxZapzWJVfNAIXWxV20eaOWWWQ6waUr0N82GyB4v1fye A4Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=KOPXfJ4o+30xKb8orSC8RLivwhkM6sb3eQ91eOmY0Vo=; b=fbPgB9LvNAMioyOUSY2kO92yTganNxcKJl80ogaBnMcGWgVXW3Nc+QgOsCnluPvs2o VymMbs8NBGgq+6eJmHo0Jy+84gTHAtI6xmurenfuydwkrz254cy2u12vxDTTAwb1VD7w +/k7biVb7ogkuvR7Lqy14yjFYp8fPYjKlj3Ws6GhhgouVPMC33wlTHUHjxWw2pu+blVa 7lR6MPPAu9XIVxjHS5zNCLNa9f46y+g8rdOpJnejjqDdXHecLfs7YvcLP6r6tpr3jeQ3 FHCW10rbqY3WcwvL7Fayy0ylGVyClStwouAV5i8LXRxNm0gUuGr85HxK0e0DJbz5qn3D XnrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="gNcWA/DM"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a13si3844001edh.74.2020.09.10.10.20.42; Thu, 10 Sep 2020 10:21:05 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="gNcWA/DM"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726844AbgIJRTY (ORCPT + 99 others); Thu, 10 Sep 2020 13:19:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725803AbgIJRSs (ORCPT ); Thu, 10 Sep 2020 13:18:48 -0400 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A008C061573 for ; Thu, 10 Sep 2020 10:18:48 -0700 (PDT) Received: by mail-qk1-x743.google.com with SMTP id q63so6074179qkf.3 for ; Thu, 10 Sep 2020 10:18:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KOPXfJ4o+30xKb8orSC8RLivwhkM6sb3eQ91eOmY0Vo=; b=gNcWA/DM9IKpsqtMRdGgyqQBa8ngfSU0q04kaiB/amfRI5odcxESYG9avLfaext3aR MTBhV7S0tIkeb6rvVo/oM4QNgeAnZobe2glDYt3akPElqv7scj9/BCIuGRH8BOwLKgHC 8T7CvZ3siJpvaw1VkA9fqbjVSW5pMMp03K2VOVLo344lOlhMt+OwM3PKI5+zMDyQj14Z bIf0x2ixTqcKpb+zjZPuNYb3mhvU/fYE8w0QWQ2XvytuC4yuU0KeDHHKz6nsOBLyWQiY xIvGAS3BHP9rpF6YcHRcpDs3TuLpEYX8sQN4TzTLBWQ8xqTvLYevBPB9zqAYKqgDCbWm uSig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KOPXfJ4o+30xKb8orSC8RLivwhkM6sb3eQ91eOmY0Vo=; b=HNN3r1O6DC3n7xWSr/CpBPJeBMHeVQNbF8ySukHZk8iKPIgHV/8B7bXehHb+X+Fv4l rvzHCf2JAZRlFGeOiUvwjizXhcQzrhvJwPHe+dr8KDAt3m9sjf584qU9GTJP0TvMzqFK tgDKTWCxisKgqpdvheqs96imgi8ao5MuBd3N8BOgz4ayaJ/IrNLbCXt/3h075T6VYKrK cNbsBVrOzDWesq3cWV8xKInMPIcu2Cycu2sjQo7irbRSq9VKeBSmPykdaASAhu/eU8Qh ggG3oXtLZe3X12YgGQGB7qgzQuNf28Bb2sO6Y2GOgywE7QmcJ8pWLX+lMGRk8jknTa1O 9r+w== X-Gm-Message-State: AOAM531p2zcLS1ax6crUOmSsfR6gNg9+ZVtyvJ6FWd+/aBYv3aW3wIyz K54d6knudETdxmPsJXx/gGc= X-Received: by 2002:a37:b347:: with SMTP id c68mr8956861qkf.430.1599758327484; Thu, 10 Sep 2020 10:18:47 -0700 (PDT) Received: from localhost.localdomain ([2604:1380:45d1:2600::1]) by smtp.gmail.com with ESMTPSA id a25sm7370452qtd.8.2020.09.10.10.18.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 10:18:46 -0700 (PDT) From: Nathan Chancellor To: Eric Anholt , Maxime Ripard Cc: Dave Stevenson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH] drm/vc4: Fix bitwise OR versus ternary operator in vc4_plane_mode_set Date: Thu, 10 Sep 2020 10:18:32 -0700 Message-Id: <20200910171831.4112580-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang warns: drivers/gpu/drm/vc4/vc4_plane.c:901:27: warning: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Wbitwise-conditional-parentheses] fb->format->has_alpha ? ~~~~~~~~~~~~~~~~~~~~~ ^ drivers/gpu/drm/vc4/vc4_plane.c:901:27: note: place parentheses around the '|' expression to silence this warning fb->format->has_alpha ? ~~~~~~~~~~~~~~~~~~~~~ ^ drivers/gpu/drm/vc4/vc4_plane.c:901:27: note: place parentheses around the '?:' expression to evaluate it first fb->format->has_alpha ? ~~~~~~~~~~~~~~~~~~~~~~^ 1 warning generated. Add the parentheses as that was clearly intended, otherwise SCALER5_CTL2_ALPHA_PREMULT won't be added to the list. Fixes: c54619b0bfb3 ("drm/vc4: Add support for the BCM2711 HVS5") Link: https://github.com/ClangBuiltLinux/linux/issues/1150 Signed-off-by: Nathan Chancellor --- drivers/gpu/drm/vc4/vc4_plane.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 24d7e6db6fdd..89543fa8ca4d 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -898,8 +898,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, vc4_dlist_write(vc4_state, VC4_SET_FIELD(state->alpha >> 4, SCALER5_CTL2_ALPHA) | - fb->format->has_alpha ? - SCALER5_CTL2_ALPHA_PREMULT : 0 | + (fb->format->has_alpha ? + SCALER5_CTL2_ALPHA_PREMULT : 0) | (mix_plane_alpha ? SCALER5_CTL2_ALPHA_MIX : 0) | VC4_SET_FIELD(fb->format->has_alpha ? base-commit: 8c3c818c23a5bbce6ff180dd2ee04415241df77c -- 2.28.0