@@ -1405,13 +1405,12 @@ static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr,
DRM_DEBUG_KMS("%s: failed to find slot\n", __func__);
return -EAGAIN;
}
- if (mstb->tx_slots[0] == NULL && mstb->tx_slots[1] == NULL) {
+ if (!mstb->tx_slots[0] && !mstb->tx_slots[1]) {
txmsg->seqno = mstb->last_seqno;
mstb->last_seqno ^= 1;
- } else if (mstb->tx_slots[0] == NULL)
- txmsg->seqno = 0;
- else
- txmsg->seqno = 1;
+ } else {
+ txmsg->seqno = mstb->tx_slots[0] ? 1 : 0;
+ }
mstb->tx_slots[txmsg->seqno] = txmsg;
}
@@ -2044,7 +2043,7 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms
/* add initial branch device at LCT 1 */
mstb = drm_dp_add_mst_branch_device(1, NULL);
- if (mstb == NULL) {
+ if (!mstb) {
ret = -ENOMEM;
goto out_unlock;
}