Skip to contentSkip to conversation

mailbox: ti-msgmgr: Remove redundant logical check

PATCH-next Advait Dhamorikar 1 participant 1 message Nov 25, 2024 Mailbox API

lore
Share & tools
lore
#0 lore raw

Remove redundant WARN_ON(!inst) check as container_of will always calculate the address of ti_msgmgr_inst if *mbox is valid. The indicated dead code may have performed some action; that action will never occur.

---
 drivers/mailbox/ti-msgmgr.c | 2 --
 1 file changed, 2 deletions(-)
drivers/mailbox/ti-msgmgr.c +0 -2
index 8eb8df8d95a4..b5fb01327d80 100644
@@ -580,8 +580,6 @@ static struct mbox_chan *ti_msgmgr_of_xlate(struct mbox_controller *mbox,
 	int i, ncells;
 
 	inst = container_of(mbox, struct ti_msgmgr_inst, mbox);
-	if (WARN_ON(!inst))
-		return ERR_PTR(-EINVAL);
 
 	d = inst->desc;
 
Signature · 1 line
2.34.1