Skip to contentSkip to conversation

bus: mhi: ep: remove useless judgement in mhi_ep_ring_add_element

PATCH In review Yu Liao 2 participants 3 messages Mar 17, 2022 MHI bus

lore
Share & tools
lore

Yu Liao

author
#0 lore raw

PATCH 1/1 bus: mhi: ep: remove useless judgement in mhi_ep_ring_add_element

Remove the check of 'ret' that is impossible to be non-zero.

---
 drivers/bus/mhi/ep/ring.c | 2 --
 1 file changed, 2 deletions(-)
drivers/bus/mhi/ep/ring.c +0 -2
index ac2043e71943..161505cd628f 100644
@@ -131,8 +131,6 @@ int mhi_ep_ring_add_element(struct mhi_ep_ring *ring, struct mhi_ring_element *e
 
 	mhi_cntrl->write_to_host(mhi_cntrl, (void __iomem *)el, ring->rbase + (old_offset *
 				 sizeof(*el)), sizeof(*el));
-	if (ret < 0)
-		return ret;
 
 	return 0;
 }
Signature · 1 line
2.25.1
author
#1 lore raw

Hi Manivannan, I found that 'ret = ' has been removed. If this is intentional, the check of 'ret' is redundant.

Thanks,

Yu

Quoted 20 lines · Yu Liao

Remove the check of 'ret' that is impossible to be non-zero.

---
 drivers/bus/mhi/ep/ring.c | 2 --
 1 file changed, 2 deletions(-)
drivers/bus/mhi/ep/ring.c +0 -2
index ac2043e71943..161505cd628f 100644
@@ -131,8 +131,6 @@ int mhi_ep_ring_add_element(struct mhi_ep_ring *ring, struct mhi_ring_element *e
 
 	mhi_cntrl->write_to_host(mhi_cntrl, (void __iomem *)el, ring->rbase + (old_offset *
 				 sizeof(*el)), sizeof(*el));
-	if (ret < 0)
-		return ret;
 
 	return 0;
 }
#2 lore raw

Hi,

Quoted 3 lines · Yu Liao

Hi Manivannan, I found that 'ret = ' has been removed. If this is intentional, the check of 'ret' is redundant.

That's not intentional, thanks for finding it out. I've updated the patch. Since the patches are under development, I've squashed the change with the initial patch.

Thanks,
Mani

Quoted 24 lines

Thanks,

Yu

Quoted 20 lines · Yu Liao

Remove the check of 'ret' that is impossible to be non-zero.

---
 drivers/bus/mhi/ep/ring.c | 2 --
 1 file changed, 2 deletions(-)
drivers/bus/mhi/ep/ring.c +0 -2
index ac2043e71943..161505cd628f 100644
@@ -131,8 +131,6 @@ int mhi_ep_ring_add_element(struct mhi_ep_ring *ring, struct mhi_ring_element *e
 
 	mhi_cntrl->write_to_host(mhi_cntrl, (void __iomem *)el, ring->rbase + (old_offset *
 				 sizeof(*el)), sizeof(*el));
-	if (ret < 0)
-		return ret;
 
 	return 0;
 }