mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Advait Dhamorikar <advaitdhamorikar@gmail.com>
To: Jassi Brar <jassisinghbrar@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Advait Dhamorikar <advaitdhamorikar@gmail.com>
Subject: [PATCH-next] mailbox: ti-msgmgr: Remove redundant logical check
Date: Mon, 25 Nov 2024 21:59:09 +0530	[thread overview]
Message-ID: <20241125162909.20319-1-advaitdhamorikar@gmail.com> (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.

Signed-off-by: Advait Dhamorikar <advaitdhamorikar@gmail.com>
---
 drivers/mailbox/ti-msgmgr.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mailbox/ti-msgmgr.c b/drivers/mailbox/ti-msgmgr.c
index 8eb8df8d95a4..b5fb01327d80 100644
--- a/drivers/mailbox/ti-msgmgr.c
+++ b/drivers/mailbox/ti-msgmgr.c
@@ -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;
 
-- 
2.34.1


                 reply	other threads:[~2024-11-25 16:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241125162909.20319-1-advaitdhamorikar@gmail.com \
    --to=advaitdhamorikar@gmail.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®