Commit 60f9ae9d authored by Lyude Paul's avatar Lyude Paul
Browse files

drm/dp_mst: Remove huge conditional in drm_dp_mst_handle_up_req()



Which reduces indentation and makes this function more legible.

Cc: Juston Li <juston.li@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Harry Wentland <hwentlan@amd.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190903204645.25487-11-lyude@redhat.com
parent 95b0013d
Loading
Loading
Loading
Loading
+45 −45
Original line number Diff line number Diff line
@@ -3271,7 +3271,9 @@ static int drm_dp_mst_handle_down_rep(struct drm_dp_mst_topology_mgr *mgr)

static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr)
{
	int ret = 0;
	struct drm_dp_sideband_msg_req_body msg;
	struct drm_dp_mst_branch *mstb = NULL;
	bool seqno;

	if (!drm_dp_get_one_sb_msg(mgr, true)) {
		memset(&mgr->up_req_recv, 0,
@@ -3279,10 +3281,8 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr)
		return 0;
	}

	if (mgr->up_req_recv.have_eomt) {
		struct drm_dp_sideband_msg_req_body msg;
		struct drm_dp_mst_branch *mstb = NULL;
		bool seqno;
	if (!mgr->up_req_recv.have_eomt)
		return 0;

	if (!mgr->up_req_recv.initial_hdr.broadcast) {
		mstb = drm_dp_get_mst_branch_device(mgr,
@@ -3333,8 +3333,8 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr)
		drm_dp_mst_topology_put_mstb(mstb);

	memset(&mgr->up_req_recv, 0, sizeof(struct drm_dp_sideband_msg_rx));
	}
	return ret;

	return 0;
}

/**