Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4018190pxk; Tue, 22 Sep 2020 08:23:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHxTmcT6qB1HPMrUZvZKbiJ7lfh40qguUI7fStl6PYrg69REkKoPcspAeUb6w1+IYsWnwC X-Received: by 2002:a17:906:ae45:: with SMTP id lf5mr5309505ejb.339.1600788214177; Tue, 22 Sep 2020 08:23:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600788214; cv=none; d=google.com; s=arc-20160816; b=h9Ynm9fC8mDmQkBcbyzEXkMGTpxzUqFB1e620DfAvCuXgAmzLVuPcEjqLMQy3PdOPb IrhJkYhILlbsQsCR7VlnlvlVkvicMCCroL6cW7PuEiT/ANyKy4npz5KjQXBzhMIOD2eF 9ysVjem3AFRVVQdAkhxi9rAQr0DBRxvKVaeyRPKBC2Kiq9D0Md0KthF7QWLnDNrTXi12 6nz66ov7czSG42139E0FE2cry/gGvnBAPjX00ITE4NEkuGsVqAJaNFoY03bWyy9owJzA 9SPE7yihOwoCdB1Tuy626apozsbpThM9sfWt1lzXsFm61G5uKB4Z/FuknvN07P8uZPI0 rSIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=scqHhJ8H2F1OwqEQAUQOLL4YJrrUXBZObQzVzFZayBI=; b=DXyntCuV5yYj9aB8pBGqc5vlxGajf2McHFFVut3R+HOyQRTAOE5uq9D66JpQ3Fypl0 1Bo/B3fOIpAB62rsB6fIOs5YYE3jLic8p8a1hjAsGWv0KWJYByqpf3895ur1dc5GNzOz dF/EdyCmdV2nuhktO3fAw8xiCH4ynaixuWVpnUGKwCi0HVCCK8KXnXouhbmL5AduvWIi CFTUejZ7nxL4MM9PlOAq6n/P0sDCfWScW3Pcy1t4xeoLeKACIVKknoH3OZLoGXZ3kmke h4TlC9vo+FlW1sUwBrwVXmmRlm8vnhCZ5F+gIkgf5pCJGWeIA5+EZ39AOp51jdLpFd9I +Rxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ud7Z8q5I; 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 n25si10273751ejc.572.2020.09.22.08.23.08; Tue, 22 Sep 2020 08:23:34 -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=ud7Z8q5I; 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 S1726656AbgIVPTZ (ORCPT + 99 others); Tue, 22 Sep 2020 11:19:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726566AbgIVPTZ (ORCPT ); Tue, 22 Sep 2020 11:19:25 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8675C061755 for ; Tue, 22 Sep 2020 08:19:24 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id x23so3742549wmi.3 for ; Tue, 22 Sep 2020 08:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=scqHhJ8H2F1OwqEQAUQOLL4YJrrUXBZObQzVzFZayBI=; b=ud7Z8q5Iaz3v0wMl9sijNgJWLoh+EObUkH3gLhvAfMqP9C5Z7tRIQ534KlkbFRgfv9 z2DD3DE+h2jOvVD1DMpp7Y1TfCNZXb3e/BrPf6Sr0zloAVm3KaDh44i4BK5S/tHMPCRi Gw7bHVM0QAeBLqrCtD5cMYMkstDteJjuR0xOcOaTA7uku4h3iXT/0tP6e3rKoXGO+R2c V3A+DvvT8joCtcYJNKXIkwxk0jU3BDgnl0RHgDv4fPFby36cZsLUZC0jF+NADyZz2uqf ln8jFfTgv5P6BUOuXaEbGATW1CrKZT3e5d6Zw+PgRFlmgq/XViIJ6Sy3RNrGNnp8eOa9 Rokg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=scqHhJ8H2F1OwqEQAUQOLL4YJrrUXBZObQzVzFZayBI=; b=uWP0FgbDimcpY/muqD/r0Obw9fkFEhEL40BQIIjteHbaTCkIHDcRKAWK4Zq2MKQAP8 Cl+CRMXRzbKiVhDzJQqLP3qS7RZRvvfiUzIf2cHNNONsIlnT7IMCCWQ42/t4U7qD38cE /I0EEXNeEDznLB4QM4hDD3G/3YtvWMTMbqUY/JYceJftDLgDMYPhkqp8MfAmshW4uzRT IFrdIuNVZsglBzfudoaHqGuGYZLYaA6Lmy1PWr+rC5qJef2/+fZ/qw9C1bZ8N4MOSgjK Km1c53yndAJ72qlNI9QExSA9pwJgmGw89jtvhtJhoE1qS5khWwaxRHvRHB01JcKTfWK6 xfCg== X-Gm-Message-State: AOAM533jPAKJJruBuFceQi/i10ol4emwI2KLNMGGOcX4iKnc3GG2hL0e Zy/KHU3zANyzqb97eVIYtrAuLACivtK+hsX9CM4= X-Received: by 2002:a1c:7d4d:: with SMTP id y74mr1562936wmc.73.1600787963365; Tue, 22 Sep 2020 08:19:23 -0700 (PDT) MIME-Version: 1.0 References: <20200922054743.2422929-1-natechancellor@gmail.com> In-Reply-To: <20200922054743.2422929-1-natechancellor@gmail.com> From: Alex Deucher Date: Tue, 22 Sep 2020 11:19:12 -0400 Message-ID: Subject: Re: [PATCH] drm/amd/display: Simplify condition in try_disable_dsc To: Nathan Chancellor , "Wentland, Harry" , "Leo (Sunpeng) Li" Cc: Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , clang-built-linux , Maling list - DRI developers , amd-gfx list , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 22, 2020 at 3:47 AM Nathan Chancellor wrote: > > Clang warns: > > drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:637:8: > warning: logical not is only applied to the left hand side of this > comparison [-Wlogical-not-parentheses] > && !params[i].clock_force_enable == DSC_CLK_FORCE_DEFAULT) { > ^ ~~ > drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:637:8: > note: add parentheses after the '!' to evaluate the comparison first > && !params[i].clock_force_enable == DSC_CLK_FORCE_DEFAULT) { > ^ > ( > ) > drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:637:8: > note: add parentheses around left hand side expression to silence this > warning > && !params[i].clock_force_enable == DSC_CLK_FORCE_DEFAULT) { > ^ > ( ) > 1 warning generated. > > The expression "!a == 0" can be more simply written as "a", which makes > it easier to reason about the logic and prevents the warning. > > Fixes: 0749ddeb7d6c ("drm/amd/display: Add DSC force disable to dsc_clock_en debugfs entry") > Link: https://github.com/ClangBuiltLinux/linux/issues/1158 > Signed-off-by: Nathan Chancellor @Wentland, Harry or @Leo (Sunpeng) Li can you provide some guidance on what the logic is supposed to be here? Thanks, Alex > --- > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c > index 9d7333a36fac..0852a24ee392 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c > @@ -634,7 +634,7 @@ static void try_disable_dsc(struct drm_atomic_state *state, > for (i = 0; i < count; i++) { > if (vars[i].dsc_enabled > && vars[i].bpp_x16 == params[i].bw_range.max_target_bpp_x16 > - && !params[i].clock_force_enable == DSC_CLK_FORCE_DEFAULT) { > + && params[i].clock_force_enable) { > kbps_increase[i] = params[i].bw_range.stream_kbps - params[i].bw_range.max_kbps; > tried[i] = false; > remaining_to_try += 1; > > base-commit: 6651cdf3bfeeaeb499db11668313666bf756579a > -- > 2.28.0 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel