Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3754534ybb; Mon, 6 Apr 2020 15:12:54 -0700 (PDT) X-Google-Smtp-Source: APiQypKhiK0DOgDWX1Ko0417C9EHgy3FHmjn8ACgKW3/TUswv0XtgZouaMWvZ2s18GGstE7IiWyS X-Received: by 2002:aca:aa0a:: with SMTP id t10mr1247285oie.38.1586211174454; Mon, 06 Apr 2020 15:12:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586211174; cv=none; d=google.com; s=arc-20160816; b=wQaVVgo/7CKJvJLhiEVrFnqJjKY1wluhGt00kEpA5u1UNLHJnZhvhg+iH/p8OB7zQs DwKDgXzpAxjf/FsH91WFDMYQuuPHiIpSmXww+2Rfw29hEBenclUu7eLBci0iC/TV0596 /9+aBUpv/Y2NMLx708sDZoK9ZvIwXHqppQBSdNIyN6ydGKYeujvUHoItD3UDAfrp/Me5 RkYL1u284w74rExnCrAtFnFN1VVoGs9X4KBsbRWveoPkFhouWzLw/kohP0jADmupOePr qj5X6beJl9mrtJf7Lcb8DMTv6d+F9OpEaTJ0WP0O4U+W/5xUpC1mOa/a9yyCvpyx8W4Y jR0w== 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 :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=v2Ct5V3S1c+UJwUTQhQD51UKnmSY4RKZxhEZvTjd+3g=; b=Ja8h1XHAFTRZHkY8OIrfWsOSvJPAmNCG6KyHamNb2YZ9ezfjIlaXA5D1w/Nuz9AKqv q2Mc1+aGfxDVOsXLdU4lV1kQ/pHu8bXkPF/l7J6lt7R7/UZ7Lxakq0ASleIknB6WUlC+ KyG/FyHLo0DykfveVpdI7WO1jF7/igqjgQcgzqx4fanAcY4Too/zrYwHuFMGrxnuktAl FXkhlFyBaKK3Wf7b/mG38NExVRGQhRMUv93LYdUFb+AgSTkCIvQs9CmahcwGAKV6RgLu ef4EgCVWviL0S9t9xCpyl+UZiPO7CMxA/IYr3f8urYjlftEOmVCfh9zoKWrtNxVas1JY LVxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EJkSmRhm; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k3si7892290oib.82.2020.04.06.15.12.41; Mon, 06 Apr 2020 15:12:54 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=EJkSmRhm; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726310AbgDFWLu (ORCPT + 99 others); Mon, 6 Apr 2020 18:11:50 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:49145 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726254AbgDFWLu (ORCPT ); Mon, 6 Apr 2020 18:11:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586211108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v2Ct5V3S1c+UJwUTQhQD51UKnmSY4RKZxhEZvTjd+3g=; b=EJkSmRhmL5JmRoJom2bl5XIKhIO8JKPCC1vD+uhVt4RRbuvmIfhGwfqJVRY25QzgyVWgwz kaSJReq0168fCihhN79g1ryi1tZGKWuGUKf1v8Icg4MCWDmISlPqWZbKZJEEBxS/eSqJm4 jt0YyQXfZbGdzSN678YSABBafpJZqVc= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-67-ToekIsGCMGurPXnvA_4o9A-1; Mon, 06 Apr 2020 18:11:46 -0400 X-MC-Unique: ToekIsGCMGurPXnvA_4o9A-1 Received: by mail-qk1-f199.google.com with SMTP id b21so1290814qkl.14 for ; Mon, 06 Apr 2020 15:11:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:organization:user-agent:mime-version :content-transfer-encoding; bh=v2Ct5V3S1c+UJwUTQhQD51UKnmSY4RKZxhEZvTjd+3g=; b=FyU5gNdIx8JmvSs3R68SnEDtr2hTlYZ1lEI3OPMKwV0I43zkBYlQd0mIet05n+lRg+ i2bwwk71ljMGCyGjtoiqTC3sEJP/Yye3GQcTUrX6Bky7nsh+z0Ha+fB/wcCcdp8DaGMl yraU5LY1wtu1ZibsMRxcAf0uy12rk/XOw9h7TH81brKncfeU/YLSRwbFVNQ+BO2t62Hv J5zLtEa8nrhX8tPlsbsfIbF0xkFrhgyk4OXULjh/9zv7fr9Bn+agrdDvRJ7sPqXJDePq lmAJA8obrfYRSHg0St4WQiEaPDIpmPUM1kQmEJaGFhn9L8aRatUFL9zhxOF18Bx+NjMr epWg== X-Gm-Message-State: AGi0Pua1RSNeCgSCRLhht4HWp/Y4G9G/Lk1m3NzWyEov4DhzYC3qW1co ML7bud0Y71ZK4CBxpViJ1LtLe2QYgygcT1ZFn89G+o3xMeozUtRyeqk5wr69xofnXC0HUZl2br9 g6R3bvOsfDBW5tbY5FqYnxEUR X-Received: by 2002:ad4:4862:: with SMTP id u2mr2024805qvy.67.1586211106318; Mon, 06 Apr 2020 15:11:46 -0700 (PDT) X-Received: by 2002:ad4:4862:: with SMTP id u2mr2024783qvy.67.1586211106090; Mon, 06 Apr 2020 15:11:46 -0700 (PDT) Received: from Ruby.lyude.net (static-173-76-190-23.bstnma.ftas.verizon.net. [173.76.190.23]) by smtp.gmail.com with ESMTPSA id m5sm14413184qtk.85.2020.04.06.15.11.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2020 15:11:45 -0700 (PDT) Message-ID: Subject: Re: [PATCH 2/4] drm/dp_mst: Reformat drm_dp_check_act_status() a bit From: Lyude Paul To: Sean Paul Cc: dri-devel , stable , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Dave Airlie , Todd Previte , LKML Date: Mon, 06 Apr 2020 18:11:44 -0400 In-Reply-To: References: <20200403200757.886443-1-lyude@redhat.com> <20200403200757.886443-3-lyude@redhat.com> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-04-06 at 15:23 -0400, Sean Paul wrote: > On Fri, Apr 3, 2020 at 4:08 PM Lyude Paul wrote: > > Just add a bit more line wrapping, get rid of some extraneous > > whitespace, remove an unneeded goto label, and move around some variable > > declarations. No functional changes here. > > > > Signed-off-by: Lyude Paul > > [this isn't a fix, but it's needed for the fix that comes after this] > > Fixes: ad7f8a1f9ced ("drm/helper: add Displayport multi-stream helper > > (v0.6)") > > Cc: Sean Paul > > Cc: # v3.17+ > > --- > > drivers/gpu/drm/drm_dp_mst_topology.c | 22 ++++++++++------------ > > 1 file changed, 10 insertions(+), 12 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c > > b/drivers/gpu/drm/drm_dp_mst_topology.c > > index 2b9ce965f044..7aaf184a2e5f 100644 > > --- a/drivers/gpu/drm/drm_dp_mst_topology.c > > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c > > @@ -4473,33 +4473,31 @@ static int drm_dp_dpcd_write_payload(struct > > drm_dp_mst_topology_mgr *mgr, > > */ > > int drm_dp_check_act_status(struct drm_dp_mst_topology_mgr *mgr) > > { > > + int count = 0, ret; > > u8 status; > > - int ret; > > - int count = 0; > > > > do { > > - ret = drm_dp_dpcd_readb(mgr->aux, > > DP_PAYLOAD_TABLE_UPDATE_STATUS, &status); > > - > > + ret = drm_dp_dpcd_readb(mgr->aux, > > + DP_PAYLOAD_TABLE_UPDATE_STATUS, > > + &status); > > if (ret < 0) { > > - DRM_DEBUG_KMS("failed to read payload table status > > %d\n", ret); > > - goto fail; > > + DRM_DEBUG_KMS("failed to read payload table status > > %d\n", > > + ret); > > + return ret; > > } > > > > if (status & DP_PAYLOAD_ACT_HANDLED) > > break; > > count++; > > udelay(100); > > - > > } while (count < 30); > > > > if (!(status & DP_PAYLOAD_ACT_HANDLED)) { > > - DRM_DEBUG_KMS("failed to get ACT bit %d after %d > > retries\n", status, count); > > - ret = -EINVAL; > > - goto fail; > > + DRM_DEBUG_KMS("failed to get ACT bit %d after %d > > retries\n", > > Should we print status in base16 here? jfyi - I realized we don't actually need to do this, because we do this in the next patch whoops. Just figured I'd point that out > > Otherwise: > > Reviewed-by: Sean Paul > > > + status, count); > > + return -EINVAL; > > } > > return 0; > > -fail: > > - return ret; > > } > > EXPORT_SYMBOL(drm_dp_check_act_status); > > > > -- > > 2.25.1 > > -- Cheers, Lyude Paul (she/her) Associate Software Engineer at Red Hat