dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lyude Paul <lyude@redhat.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/dp/mst: Reduce nested ifs
Date: Wed, 25 Sep 2019 15:10:51 -0400	[thread overview]
Message-ID: <3fa09bd0ce97546afc1077d4a7a11122bb7dcbdf.camel@redhat.com> (raw)
In-Reply-To: <20190925141442.23236-1-ville.syrjala@linux.intel.com>

Reviewed-by: Lyude Paul <lyude@redhat.com>

On Wed, 2019-09-25 at 17:14 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Replace the nested ifs with a single if and a logical AND.
> 
> Cc: Lyude Paul <lyude@redhat.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/drm_dp_mst_topology.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 97216099a718..e25597eb3ca1 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -1123,11 +1123,11 @@ static void drm_dp_mst_put_payload_id(struct
> drm_dp_mst_topology_mgr *mgr,
>  	clear_bit(vcpi - 1, &mgr->vcpi_mask);
>  
>  	for (i = 0; i < mgr->max_payloads; i++) {
> -		if (mgr->proposed_vcpis[i])
> -			if (mgr->proposed_vcpis[i]->vcpi == vcpi) {
> -				mgr->proposed_vcpis[i] = NULL;
> -				clear_bit(i + 1, &mgr->payload_mask);
> -			}
> +		if (mgr->proposed_vcpis[i] &&
> +		    mgr->proposed_vcpis[i]->vcpi == vcpi) {
> +			mgr->proposed_vcpis[i] = NULL;
> +			clear_bit(i + 1, &mgr->payload_mask);
> +		}
>  	}
>  	mutex_unlock(&mgr->payload_lock);
>  }
-- 
Cheers,
	Lyude Paul

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      parent reply	other threads:[~2019-09-25 19:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25 14:14 [PATCH 1/3] drm/dp/mst: Reduce nested ifs Ville Syrjala
2019-09-25 14:14 ` [PATCH 2/3] drm/dp/mst: Handle arbitrary DP_LINK_BW values Ville Syrjala
2019-09-26  0:03   ` Lyude Paul
2019-09-25 14:14 ` [PATCH 3/3] drm/dp/mst: Replace the fixed point thing with straight calculation Ville Syrjala
2019-09-26  0:07   ` Lyude Paul
2019-09-25 16:14 ` [PATCH 1/3] drm/dp/mst: Reduce nested ifs Lucas De Marchi
2019-09-25 19:10 ` Lyude Paul [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3fa09bd0ce97546afc1077d4a7a11122bb7dcbdf.camel@redhat.com \
    --to=lyude@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox