diff mbox series

[2/4] drm/mst: Some style improvements in drm_dp_mst_topology_mgr_set_mst()

Message ID 20200117015837.402239-2-jose.souza@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/4] drm/mst: Don't do atomic checks over disabled managers | expand

Commit Message

Souza, Jose Jan. 17, 2020, 1:58 a.m. UTC
Removing this lose code block and removing unnecessary bracket.

Cc: Lyude Paul <lyude@redhat.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Comments

Lyude Paul Jan. 17, 2020, 8:22 p.m. UTC | #1
Reviewed-by: Lyude Paul <lyude@redhat.com>

On Thu, 2020-01-16 at 17:58 -0800, José Roberto de Souza wrote:
> Removing this lose code block and removing unnecessary bracket.
> 
> Cc: Lyude Paul <lyude@redhat.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/drm_dp_mst_topology.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 38bf111e5f9b..e3a22362aaf2 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -3491,6 +3491,8 @@ int drm_dp_mst_topology_mgr_set_mst(struct
> drm_dp_mst_topology_mgr *mgr, bool ms
>  	mgr->mst_state = mst_state;
>  	/* set the device into MST mode */
>  	if (mst_state) {
> +		struct drm_dp_payload reset_pay;
> +
>  		WARN_ON(mgr->mst_primary);
>  
>  		/* get dpcd info */
> @@ -3521,16 +3523,12 @@ int drm_dp_mst_topology_mgr_set_mst(struct
> drm_dp_mst_topology_mgr *mgr, bool ms
>  
>  		ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL,
>  							 DP_MST_EN |
> DP_UP_REQ_EN | DP_UPSTREAM_IS_SRC);
> -		if (ret < 0) {
> +		if (ret < 0)
>  			goto out_unlock;
> -		}
>  
> -		{
> -			struct drm_dp_payload reset_pay;
> -			reset_pay.start_slot = 0;
> -			reset_pay.num_slots = 0x3f;
> -			drm_dp_dpcd_write_payload(mgr, 0, &reset_pay);
> -		}
> +		reset_pay.start_slot = 0;
> +		reset_pay.num_slots = 0x3f;
> +		drm_dp_dpcd_write_payload(mgr, 0, &reset_pay);
>  
>  		queue_work(system_long_wq, &mgr->work);
>
Lyude Paul Jan. 17, 2020, 9:20 p.m. UTC | #2
JFYI: I'm going to go ahead and push this patch by itself to drm-misc-next
since it applies cleanly, the other patches in this series don't depend on
this, and I'm about to send out a patch that modifies the code around these
hunks anyway.

On Thu, 2020-01-16 at 17:58 -0800, José Roberto de Souza wrote:
> Removing this lose code block and removing unnecessary bracket.
> 
> Cc: Lyude Paul <lyude@redhat.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/drm_dp_mst_topology.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 38bf111e5f9b..e3a22362aaf2 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -3491,6 +3491,8 @@ int drm_dp_mst_topology_mgr_set_mst(struct
> drm_dp_mst_topology_mgr *mgr, bool ms
>  	mgr->mst_state = mst_state;
>  	/* set the device into MST mode */
>  	if (mst_state) {
> +		struct drm_dp_payload reset_pay;
> +
>  		WARN_ON(mgr->mst_primary);
>  
>  		/* get dpcd info */
> @@ -3521,16 +3523,12 @@ int drm_dp_mst_topology_mgr_set_mst(struct
> drm_dp_mst_topology_mgr *mgr, bool ms
>  
>  		ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL,
>  							 DP_MST_EN |
> DP_UP_REQ_EN | DP_UPSTREAM_IS_SRC);
> -		if (ret < 0) {
> +		if (ret < 0)
>  			goto out_unlock;
> -		}
>  
> -		{
> -			struct drm_dp_payload reset_pay;
> -			reset_pay.start_slot = 0;
> -			reset_pay.num_slots = 0x3f;
> -			drm_dp_dpcd_write_payload(mgr, 0, &reset_pay);
> -		}
> +		reset_pay.start_slot = 0;
> +		reset_pay.num_slots = 0x3f;
> +		drm_dp_dpcd_write_payload(mgr, 0, &reset_pay);
>  
>  		queue_work(system_long_wq, &mgr->work);
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 38bf111e5f9b..e3a22362aaf2 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -3491,6 +3491,8 @@  int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms
 	mgr->mst_state = mst_state;
 	/* set the device into MST mode */
 	if (mst_state) {
+		struct drm_dp_payload reset_pay;
+
 		WARN_ON(mgr->mst_primary);
 
 		/* get dpcd info */
@@ -3521,16 +3523,12 @@  int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms
 
 		ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL,
 							 DP_MST_EN | DP_UP_REQ_EN | DP_UPSTREAM_IS_SRC);
-		if (ret < 0) {
+		if (ret < 0)
 			goto out_unlock;
-		}
 
-		{
-			struct drm_dp_payload reset_pay;
-			reset_pay.start_slot = 0;
-			reset_pay.num_slots = 0x3f;
-			drm_dp_dpcd_write_payload(mgr, 0, &reset_pay);
-		}
+		reset_pay.start_slot = 0;
+		reset_pay.num_slots = 0x3f;
+		drm_dp_dpcd_write_payload(mgr, 0, &reset_pay);
 
 		queue_work(system_long_wq, &mgr->work);