Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp845457ybf; Fri, 28 Feb 2020 08:43:08 -0800 (PST) X-Google-Smtp-Source: APXvYqyfwroajxHph4sHGtjVHPVRQ2rRp3E1a+kSeB7+4MyDdSgoYv9gSSOqY3vp0tCVxh/lXfZu X-Received: by 2002:a9d:51c1:: with SMTP id d1mr3982856oth.136.1582908188211; Fri, 28 Feb 2020 08:43:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582908188; cv=none; d=google.com; s=arc-20160816; b=HMgKcGUgaUXAphlNi18G6C2Ham7iLQQZZ0vPP3q2PZpRt2izsK4yKTAz1/+nYtqlIo 9nttaWgHced2Vm9jgwtoPsxgz7Mv0/hEvMu7EcE9+m7GWWYEL8FTZSnWc3YDbkMTSA7R /Axx0yf2NtRwNhkBwF2y/nAIcbflGuSwCT8IRUhx6dpX+9DECkXzPo9RsxC/5FmNuLuZ siscxr6QSe6mdGQEOnI4IGO7DuptA9uhnZouI4jHBhlnF2YRdxz8RVKemNHrMe5+X4eS u7ONQrl7p0UsTPFC0OF9rpIPIfXOSMu+2vxOKNtQtN9xlzINLo9bQLD91M2/ovnkQ3DU Hu3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ldf8hYsODju3QfMuQceixPCm/gYiMPapiNP2c55hvY8=; b=wV90uMBK4Et+NcNx5AuIpRvZ//aKQnn51ZUWgbo+xDiRu+tvwpblu/OafmVE0cXgT5 QiCTB8W7RuTXuc8MpBY4W0xYCMb+VSbFLhp5tQI1zSAP0BYe3aoWSw/cJvEhmjvgDqVP foxdPHOVQ1RZAcx9+p+wmNuO0XAmoesQLTq7qdBU5pAFObF+rOfNPpdnqi9kJR/9NGtJ EOv7Jbslxhbgf2Ta08EaoS5jnXXc/jI3umc0eNUCNyULuQWiqzG4E2qfkTWjZfBgEo3z 5a+/Sb/rrH20VlO6cxLuuW69qtX7nHvl6Mg/S9LRG8gJO0gS9aHsKqSDnAAojHIS29RH dQbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=olqIOHkF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j9si2191531oiw.133.2020.02.28.08.42.56; Fri, 28 Feb 2020 08:43:08 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=olqIOHkF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726752AbgB1Qlz (ORCPT + 99 others); Fri, 28 Feb 2020 11:41:55 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:41643 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725886AbgB1Qlz (ORCPT ); Fri, 28 Feb 2020 11:41:55 -0500 Received: by mail-ed1-f67.google.com with SMTP id c26so4048726eds.8 for ; Fri, 28 Feb 2020 08:41:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ldf8hYsODju3QfMuQceixPCm/gYiMPapiNP2c55hvY8=; b=olqIOHkF6nsW9UYb36nMIzd9lU3s+uRqS8wOR3h+TWG0ta18aKezAaCKixv6gGPxUK c73TR/s6tYA9rZOfOJF4Ady5JMGtZY+hzChGh6zLbscqlrLWUMVqi/C2YcYch6GUV1/g s61HJHjR2efaala0vgj64Lj9PlShUwxgCshyR7y28f2vS5WpYFIwPBXT9+u/kxW+OLnP plrBWmysnZ2K4ReVWEZxPeP3v1vACgn5hyiCXW4cBmJBdIa6dW6PiKy9mLvM/X5uC8WL vYi/06mnmp2hD3XGRHYvd/YAg2Dg3ZZTT4jzHlE56A3+6daLQZSTkB+TwlUNHpdT7jq2 mkrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ldf8hYsODju3QfMuQceixPCm/gYiMPapiNP2c55hvY8=; b=Sqg1r6rnkeww7GiBlfBOQFHbqg3ABHYtbADMtckADyEW6vKaYjxhdEaMxznfNK6Tzn +2eXE/h/P7kq0gFUKec2E2sb9V6olQ3GYspY+MRcZSFgiEtQ/y3ivYJq85MmgMKzz8Df vY9TqO6GpMNXZNNTvA3muH2yY2mh3iOEj1YQXrIfTDGxmkxPeigLN4filceKmB3rwf5N 1XbYwJignr8lGhPwaIIny3/itI+JM1vw5ijlc8aNao8gaGL3ZQ0h1PLlccSO87hPFaNg D1qB6xsCG9VkD2oYienjoDhOHGBTlAPPj6VZe6LpbR9IwEylYFSXo3pu7Hwl2V/s4eZt vX2g== X-Gm-Message-State: APjAAAWs/YrTtKJoC4qFj3BeoCV+Mp0rBTgBHiZ+ok6gF2s6xclbzWtG MX0HyunF2i0B57YBGQ/LYl0= X-Received: by 2002:a05:6402:c08:: with SMTP id co8mr5180686edb.197.1582908113875; Fri, 28 Feb 2020 08:41:53 -0800 (PST) Received: from smtp.gmail.com (1.77.115.89.rev.vodafone.pt. [89.115.77.1]) by smtp.gmail.com with ESMTPSA id b14sm579365edx.64.2020.02.28.08.41.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Feb 2020 08:41:52 -0800 (PST) Date: Fri, 28 Feb 2020 13:41:45 -0300 From: Melissa Wen To: Harry Wentland , Leo Li , Alex Deucher , Christian Konig , David Zhou , David Airlie , Daniel Vetter , Rodrigo Siqueira Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] drm/amd/display: dc_link: code clean up on enable_link_dp function Message-ID: <922a2d0df348e72588405dedd4f9a296448f51c3.1582907436.git.melissa.srw@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Coding style clean up on enable_link_dp function as suggested by checkpatch.pl: CHECK: Lines should not end with a '(' WARNING: line over 80 characters WARNING: suspect code indent for conditional statements (8, 24) CHECK: braces {} should be used on all arms of this statement ERROR: else should follow close brace '}' CHECK: Comparison to NULL could be written "link->preferred_training_settings.fec_enable" Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c index 02e1ad318203..eb9894e416ed 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c @@ -1498,9 +1498,8 @@ static void enable_stream_features(struct pipe_ctx *pipe_ctx) } } -static enum dc_status enable_link_dp( - struct dc_state *state, - struct pipe_ctx *pipe_ctx) +static enum dc_status enable_link_dp(struct dc_state *state, + struct pipe_ctx *pipe_ctx) { struct dc_stream_state *stream = pipe_ctx->stream; enum dc_status status; @@ -1532,7 +1531,8 @@ static enum dc_status enable_link_dp( pipe_ctx->stream_res.pix_clk_params.requested_sym_clk = link_settings.link_rate * LINK_RATE_REF_FREQ_IN_KHZ; if (state->clk_mgr && !apply_seamless_boot_optimization) - state->clk_mgr->funcs->update_clocks(state->clk_mgr, state, false); + state->clk_mgr->funcs->update_clocks(state->clk_mgr, + state, false); // during mode switch we do DP_SET_POWER off then on, and OUI is lost dpcd_set_source_specific_data(link); @@ -1540,21 +1540,20 @@ static enum dc_status enable_link_dp( skip_video_pattern = true; if (link_settings.link_rate == LINK_RATE_LOW) - skip_video_pattern = false; - - if (perform_link_training_with_retries( - &link_settings, - skip_video_pattern, - LINK_TRAINING_ATTEMPTS, - pipe_ctx, - pipe_ctx->stream->signal)) { + skip_video_pattern = false; + + if (perform_link_training_with_retries(&link_settings, + skip_video_pattern, + LINK_TRAINING_ATTEMPTS, + pipe_ctx, + pipe_ctx->stream->signal)) { link->cur_link_settings = link_settings; status = DC_OK; - } - else + } else { status = DC_FAIL_DP_LINK_TRAINING; + } - if (link->preferred_training_settings.fec_enable != NULL) + if (link->preferred_training_settings.fec_enable) fec_enable = *link->preferred_training_settings.fec_enable; else fec_enable = true; -- 2.25.0