linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] RDMA: Remove unnecessary NULL values
@ 2023-08-04  8:21 Ruan Jinjie
  2023-08-07 13:57 ` Leon Romanovsky
  0 siblings, 1 reply; 2+ messages in thread
From: Ruan Jinjie @ 2023-08-04  8:21 UTC (permalink / raw)
  To: linux-rdma, Jason Gunthorpe, Leon Romanovsky, Mustafa Ismail,
	Shiraz Saleem
  Cc: ruanjinjie

The NULL initialization of the pointers assigned by kzalloc() first is
not necessary, because if the kzalloc() failed, the pointers will be
assigned NULL, otherwise it works as usual. so remove it.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
---
 drivers/infiniband/core/iwpm_util.c | 2 +-
 drivers/infiniband/hw/irdma/verbs.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/core/iwpm_util.c b/drivers/infiniband/core/iwpm_util.c
index 358a2db38d23..eecb369898f5 100644
--- a/drivers/infiniband/core/iwpm_util.c
+++ b/drivers/infiniband/core/iwpm_util.c
@@ -307,7 +307,7 @@ int iwpm_get_remote_info(struct sockaddr_storage *mapped_loc_addr,
 struct iwpm_nlmsg_request *iwpm_get_nlmsg_request(__u32 nlmsg_seq,
 					u8 nl_client, gfp_t gfp)
 {
-	struct iwpm_nlmsg_request *nlmsg_request = NULL;
+	struct iwpm_nlmsg_request *nlmsg_request;
 	unsigned long flags;
 
 	nlmsg_request = kzalloc(sizeof(struct iwpm_nlmsg_request), gfp);
diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index a1a42a7cd783..b250f6ac0eea 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -2826,7 +2826,7 @@ static struct irdma_mr *irdma_alloc_iwmr(struct ib_umem *region,
 {
 	struct irdma_device *iwdev = to_iwdev(pd->device);
 	struct irdma_pbl *iwpbl = NULL;
-	struct irdma_mr *iwmr = NULL;
+	struct irdma_mr *iwmr;
 	unsigned long pgsz_bitmap;
 
 	iwmr = kzalloc(sizeof(*iwmr), GFP_KERNEL);
-- 
2.34.1


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

* Re: [PATCH -next] RDMA: Remove unnecessary NULL values
  2023-08-04  8:21 [PATCH -next] RDMA: Remove unnecessary NULL values Ruan Jinjie
@ 2023-08-07 13:57 ` Leon Romanovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2023-08-07 13:57 UTC (permalink / raw)
  To: linux-rdma, Jason Gunthorpe, Mustafa Ismail, Shiraz Saleem, Ruan Jinjie


On Fri, 04 Aug 2023 16:21:01 +0800, Ruan Jinjie wrote:
> The NULL initialization of the pointers assigned by kzalloc() first is
> not necessary, because if the kzalloc() failed, the pointers will be
> assigned NULL, otherwise it works as usual. so remove it.
> 
> 

Applied, thanks!

[1/1] RDMA: Remove unnecessary NULL values
      https://git.kernel.org/rdma/rdma/c/849b1955ade1c6

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>

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

end of thread, other threads:[~2023-08-07 14:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-04  8:21 [PATCH -next] RDMA: Remove unnecessary NULL values Ruan Jinjie
2023-08-07 13:57 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).