Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp335155ybf; Wed, 26 Feb 2020 14:07:57 -0800 (PST) X-Google-Smtp-Source: APXvYqxZEavuSNOrx+MHzo9cuX2FS5JC4CmpVeVl3jaGpJ4gsiq/dpcmNfWr8uBtB2DlaMmibhiW X-Received: by 2002:a05:6830:150:: with SMTP id j16mr626198otp.301.1582754877429; Wed, 26 Feb 2020 14:07:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582754877; cv=none; d=google.com; s=arc-20160816; b=RDAobaVdKG8w7Ug35SqWLlrg91qxPtaueSa7fn1PFizfALdjlNBJPpRHin3fzSVkrv 1NpI9rTw2P5whME8xsQOg6aDdd7aNGu6ivHr4glhITVXLIZwYhY8aKoTaB+a61OnWMu2 COMGxBUQtG1DHnDLwfurkMx88/AAvlqjyVGHEK/1xj4v9L/5gBbP8wvYuhka97Qyr/2H BY8mikMZtZqWJb1Gj/gmqZlifWQNyD4RWczkzOuq3KTEexU03s7N4BPtK5uBP+IW3DMw H/rXIJKXA3hN3CYJ/RA24lPEmNS/KGqbToRHDhtuOX2kX5fOYZC27DHPjVhOVtMgfCG9 ZFvQ== 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=smlCNyZtkUS5wtodeApayWhfct5DN5V19mI08hkP2Xo=; b=vdiq3Hv/0/OM4E0WuBgun9v9P+qgWaFYI2NNaqF5buaHvDgxvTRivLj/cC39TETcWp L8mMaQpi8/WFGQPJozeCdprH0vW5Khleo7a6+ji4GjXWutdos680VmNhfh0OIS+i8ov5 lPV1BQ6bmZwvkS3sS+NUFd7Hp5NwUYkgrM1wVJhcPKVSAvLfxDY7FLMTVzm0rybtngnG TtM+DlcJ4fLhvYyYLne+LX3TrfCVhAuGorJb8zySkZ+RLJSvOLplhRz3VS7L3TTqdNzC en70BnFhQFLYqtg43vV1T0IdaXqcAU5YJCx5m9LLEiyDZLAEiSSnTWHE3hOv84YATLdQ fZrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ghjQ5U1N; 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 25si290146oiz.230.2020.02.26.14.07.45; Wed, 26 Feb 2020 14:07:57 -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=ghjQ5U1N; 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 S1727742AbgBZWHW (ORCPT + 99 others); Wed, 26 Feb 2020 17:07:22 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:33195 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727670AbgBZWHW (ORCPT ); Wed, 26 Feb 2020 17:07:22 -0500 Received: by mail-ed1-f65.google.com with SMTP id r21so742062edq.0 for ; Wed, 26 Feb 2020 14:07:21 -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=smlCNyZtkUS5wtodeApayWhfct5DN5V19mI08hkP2Xo=; b=ghjQ5U1NmSHaFr6tU8IENHZwipVNP5jyCzhU6nV7h62ZPW7X/96FvJA4rm+8dx9NLp Lzd5H3l47KL7iTnNZY7zVeqQ/HnDHNpQuZP7ARkYx2TTibZvYng1c2fUWKKEjHGkzxtW j1PlGGs0/1wf50f7E3QadDLs3ZBZRg9/DvGaOqo/8AvBqVzwQBjqD1DQuwqCnO3lK2bT rwoIV172jr0CeKH9b1pAVwxqkMxt0yqC4ZUhM2SxcG9cd9GwMlXDtdBrZARBHOHdwr41 VUFjM18z3YNswbBL+eHJYJPQ3udUr/0Hk8gGHg5rhle/X6/ZmXBw1ZALYJwNCy1zxr7l 3ZTw== 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=smlCNyZtkUS5wtodeApayWhfct5DN5V19mI08hkP2Xo=; b=KovPrCTmtMXCmnG5ecK5DEpKMNkIIusyVx7n3TtN6tyWc1llL+0d55gmstCS9fFRGe ii0+XPgohzgmQLpHEzhmABqV0IVYGxthGoTG3W7tnZ2vJdodrzdDu0AEwARVSpvSMb8m HVG8CqsmBXQzsMPJ+xk8/KusXCDX1NWf4bwcr347JmDeSmDUSs0Tj7BFpwkv6BuiYy7q qiUB5TGR3p6jgWFHwaRXXltKXxZFVZRvZciHRfa34NDkralPPw/HGqJT3TMXIcVUbvGA /t9yRic1o+liAK8KNcHE/KfWWJ+sNQBC5c2a6rulcKBatXiKEJX2/xJtRhgNwDA/BW4w ntpg== X-Gm-Message-State: APjAAAVQ/0iLwDP8SxGknwMWmqeKfwcdQf1s13ajiDr4Kx+EiGUSEDnv /oHVE+23hi4AbYa5gbaQhFA= X-Received: by 2002:aa7:ca10:: with SMTP id y16mr489172eds.217.1582754840773; Wed, 26 Feb 2020 14:07:20 -0800 (PST) Received: from smtp.gmail.com ([2001:818:e238:a000:51c6:2c09:a768:9c37]) by smtp.gmail.com with ESMTPSA id dd20sm167771ejb.59.2020.02.26.14.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 14:07:20 -0800 (PST) Date: Wed, 26 Feb 2020 19:07:12 -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 1/2] drm/amd/display: dc_link: code clean up on enable_link_dp function Message-ID: <990112183d2bc344bd921bb55eee2f8cc2cd8bd5.1582752490.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 | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 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 a09119c10d7c..0f28b5694144 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c @@ -1480,9 +1480,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; @@ -1512,27 +1511,28 @@ 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); + if (state->clk_mgr && !apply_seamless_boot_optimization) { + state->clk_mgr->funcs->update_clocks(state->clk_mgr, + state, false); + } 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