Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp799008pxx; Thu, 29 Oct 2020 14:59:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1wgRVO3dpB7WPcacxs7WmMzd6AZx3L9GSCBUpKuh0Pm29HhXWviM3/5OD87yqUbowaQJf X-Received: by 2002:a50:c38e:: with SMTP id h14mr6534077edf.174.1604008744985; Thu, 29 Oct 2020 14:59:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604008744; cv=none; d=google.com; s=arc-20160816; b=usncFa8OqJjTPqyRNv+llpA4fUfAIxBkUbuQdm8/hFaQ6iK254JxhE3YhRSXNTZCiy gwb7sp1VQPPMiSNeNAu6tyWgPG3TSel9vSP/ydv5eD5EoOmyD/MRIKGUBl/YWIXY3qpu lxnGh8eM1FH/HO5AVMd10HQ4sM/5NZVp4fKlECbRFHWBAwL4I4U91Niftth3BWIf7BvY uftbCeFerTRcAtl6EmD126N5ELJfIJiQK4/HP3SjrAWgn4gAXNy8NTQKTKU8kXSVZXAK tlxS0txvySpKsq8nP4AYGdhkOQQ2fbSa60fuOle+h8osol20mbwHMP8rePt2TLLyAmYo yuLg== 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=pxEzC4iXwKkMYRjWUeZ8FVw3qPnIVhPs3JqnX8Dyn5w=; b=UxEVVA2czURphvf4S/EwJJL4l2wJiCFnCCWkIpA6ol7wewV/An4BS86kaK+NRwvCJs AvG9B7l1g5qeOBFBJPYgfAQ4Bbho9srbEUi2nj8ShMbC/TMBpJR1lwKzFDFvjF8jnQMg 7EiH5t5vDPrL+sWLVIhg3q7yCvGIIjjSWF70qSSC+pQEApQx5Vhn6avOaHLYphnz+jSw hIMTuUuZrOxXrtiE7wM2drALTnlQtl7QiqoN8JFteAIr3BLmy9Of0gNShGV4PX9i/38K OhuSNGYNE8cY1sV+Z0dbTCM0wbPKlNKvRL/Kq8uNSmcSdk9tYtPaKOy7PPc2jBQzvt5i KlBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bCqhzo47; 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 g3si2691694ejd.269.2020.10.29.14.58.42; Thu, 29 Oct 2020 14:59:04 -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=bCqhzo47; 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 S1725769AbgJ2V5H (ORCPT + 99 others); Thu, 29 Oct 2020 17:57:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725379AbgJ2V5G (ORCPT ); Thu, 29 Oct 2020 17:57:06 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FC1AC0613CF for ; Thu, 29 Oct 2020 14:57:04 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id g12so4363916wrp.10 for ; Thu, 29 Oct 2020 14:57:04 -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=pxEzC4iXwKkMYRjWUeZ8FVw3qPnIVhPs3JqnX8Dyn5w=; b=bCqhzo47jGw85rQcqtMBdPjFZCPnL9SWqPqUzPqBEnVzPT3Z4LICGCDxQVeZQ4Khg0 +5D3fPaoSAHqAzj3tlLWqh4opQHJjXOFZ2p9vvEa/wr+Av3jF5G1dMLuV+7lMJjJM/oI OW/Z9rTUiGD6Adc7mAolZBJly5PSx6XtD5TCW4K2sodlrbI7kdgFQMI+xcRgJQvUnuwN nRr+mnDVQ9zYxP3d6Ae/IY9kc1YBFce3LpxDhjU2ofW4q7BhLmeCDh5QMvr6SoJ78LTN wWigLf4IV+o1bYxi8c/zzfojTwIpdYA0++YGk8OVCktHLM4y7HVHSfsBK1CwIH8doRic RNYg== 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=pxEzC4iXwKkMYRjWUeZ8FVw3qPnIVhPs3JqnX8Dyn5w=; b=K370/8il/E6A2wqYnRHuFx+NPTOaTWmZV7OuNnV64FprkwZzF1BovA9IUQNC5fXE1+ mOw+tQeE/b+eEHLcpdxhMpBIvTh4vmS9Z9JoTBoswXh3L+ubpHVJjs76xuMtjysZDpPk eQ7uzdxtculeKlmCDST2NR2zDk8t1gXH9io20aAEaLA9VgJYI7pcLelyPuPg9WIama5T r0ASPd5P1jGIX0u1+N5FVvvkqXK6S50v4mmZdREQuMUT318/PUSEDIps3g9w9M99gWnu yb/Qqp3nccg/QJ3ghff12EnwpnFDzLT2vXCWU1C/3c6MzqfjRXL7tWLOvLNK4llrXUcG N9dQ== X-Gm-Message-State: AOAM531tqYGtEKHwwUwoBzf4cDhlMdosjvG5D4Luuye5RPaSXTw2QlFX HriOL256eEQQzSp/Tr4NVyz+3V1KnG+G5q2RIPjL6rEe X-Received: by 2002:adf:f181:: with SMTP id h1mr4554978wro.374.1604008622873; Thu, 29 Oct 2020 14:57:02 -0700 (PDT) MIME-Version: 1.0 References: <1603874171-106841-1-git-send-email-zou_wei@huawei.com> In-Reply-To: <1603874171-106841-1-git-send-email-zou_wei@huawei.com> From: Alex Deucher Date: Thu, 29 Oct 2020 17:56:51 -0400 Message-ID: Subject: Re: [PATCH -next] drm/amd/display: remove useless if/else To: Zou Wei Cc: "Wentland, Harry" , "Leo (Sunpeng) Li" , "Deucher, Alexander" , Christian Koenig , Dave Airlie , Daniel Vetter , 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 Applied. Thanks! Alex On Wed, Oct 28, 2020 at 2:56 PM Zou Wei wrote: > > Fix the following coccinelle report: > > ./drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c:1367:3-5: > WARNING: possible condition with no effect (if == else) > > Both branches are the same, so remove the if/else altogether. > > Fixes: 81875979f0b2 ("drm/amd/display: Remove extra pairs of parentheses in dce_calcs.c") > Reported-by: Hulk Robot > Signed-off-by: Zou Wei > --- > drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c > index 2c6db37..e4f29cd 100644 > --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c > +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c > @@ -1364,13 +1364,10 @@ static void calculate_bandwidth( > /*if stutter and dram clock state change are gated before cursor then the cursor latency hiding does not limit stutter or dram clock state change*/ > for (i = 0; i <= maximum_number_of_surfaces - 1; i++) { > if (data->enable[i]) { > - if (dceip->graphics_lb_nodownscaling_multi_line_prefetching == 1) { > - data->maximum_latency_hiding[i] = bw_add(data->minimum_latency_hiding[i], bw_mul(bw_frc_to_fixed(5, 10), data->total_dmifmc_urgent_latency)); > - } > - else { > - /*maximum_latency_hiding(i) = minimum_latency_hiding(i) + 1 / vsr(i) * h_total(i) / pixel_rate(i) + 0.5 * total_dmifmc_urgent_latency*/ > - data->maximum_latency_hiding[i] = bw_add(data->minimum_latency_hiding[i], bw_mul(bw_frc_to_fixed(5, 10), data->total_dmifmc_urgent_latency)); > - } > + /*maximum_latency_hiding(i) = minimum_latency_hiding(i) + 1 / vsr(i) **/ > + /* h_total(i) / pixel_rate(i) + 0.5 * total_dmifmc_urgent_latency*/ > + data->maximum_latency_hiding[i] = bw_add(data->minimum_latency_hiding[i], > + bw_mul(bw_frc_to_fixed(5, 10), data->total_dmifmc_urgent_latency)); > data->maximum_latency_hiding_with_cursor[i] = bw_min2(data->maximum_latency_hiding[i], data->cursor_latency_hiding[i]); > } > } > -- > 2.6.2 > > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx