mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] RDMA: remove null check after call container_of()
@ 2022-05-17  1:33 Haowen Bai
  2022-05-17 12:16 ` Jason Gunthorpe
  0 siblings, 1 reply; 6+ messages in thread
From: Haowen Bai @ 2022-05-17  1:33 UTC (permalink / raw)
  To: Dennis Dalessandro, Jason Gunthorpe, Leon Romanovsky
  Cc: Haowen Bai, linux-rdma, linux-kernel

container_of() will never return NULL, so remove useless code.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
 drivers/infiniband/sw/rdmavt/vt.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c
index 59481ae39505..b2d83b4958fc 100644
--- a/drivers/infiniband/sw/rdmavt/vt.c
+++ b/drivers/infiniband/sw/rdmavt/vt.c
@@ -50,8 +50,6 @@ struct rvt_dev_info *rvt_alloc_device(size_t size, int nports)
 	struct rvt_dev_info *rdi;
 
 	rdi = container_of(_ib_alloc_device(size), struct rvt_dev_info, ibdev);
-	if (!rdi)
-		return rdi;
 
 	rdi->ports = kcalloc(nports, sizeof(*rdi->ports), GFP_KERNEL);
 	if (!rdi->ports)
-- 
2.7.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-18  1:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17  1:33 [PATCH] RDMA: remove null check after call container_of() Haowen Bai
2022-05-17 12:16 ` Jason Gunthorpe
2022-05-17 17:54   ` Christophe JAILLET
2022-05-17 18:03     ` Jason Gunthorpe
2022-05-17 19:42       ` Christophe JAILLET
2022-05-18  1:55       ` baihaowen

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®