All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA: clean up usnic_ib_alloc_pd()
@ 2021-11-18 11:39 Dan Carpenter
  2021-11-18 13:04 ` Leon Romanovsky
  2021-11-19 16:07 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-11-18 11:39 UTC (permalink / raw)
  To: Christian Benvenuti, Upinder Malhi
  Cc: Nelson Escobar, Doug Ledford, Jason Gunthorpe, linux-rdma,
	kernel-janitors

Remove the unnecessary "umem_pd" variable.  And usnic_uiom_alloc_pd()
never returns NULL so remove the NULL check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
index 756a83bcff58..5a0e26cd648e 100644
--- a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
+++ b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
@@ -442,12 +442,10 @@ int usnic_ib_query_gid(struct ib_device *ibdev, u32 port, int index,
 int usnic_ib_alloc_pd(struct ib_pd *ibpd, struct ib_udata *udata)
 {
 	struct usnic_ib_pd *pd = to_upd(ibpd);
-	void *umem_pd;
 
-	umem_pd = pd->umem_pd = usnic_uiom_alloc_pd();
-	if (IS_ERR_OR_NULL(umem_pd)) {
-		return umem_pd ? PTR_ERR(umem_pd) : -ENOMEM;
-	}
+	pd->umem_pd = usnic_uiom_alloc_pd();
+	if (IS_ERR(pd->umem_pd))
+		return PTR_ERR(pd->umem_pd);
 
 	return 0;
 }
-- 
2.20.1


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

* Re: [PATCH] RDMA: clean up usnic_ib_alloc_pd()
  2021-11-18 11:39 [PATCH] RDMA: clean up usnic_ib_alloc_pd() Dan Carpenter
@ 2021-11-18 13:04 ` Leon Romanovsky
  2021-11-19 16:07 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2021-11-18 13:04 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Christian Benvenuti, Upinder Malhi, Nelson Escobar, Doug Ledford,
	Jason Gunthorpe, linux-rdma, kernel-janitors

On Thu, Nov 18, 2021 at 02:39:24PM +0300, Dan Carpenter wrote:
> Remove the unnecessary "umem_pd" variable.  And usnic_uiom_alloc_pd()
> never returns NULL so remove the NULL check.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 

Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

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

* Re: [PATCH] RDMA: clean up usnic_ib_alloc_pd()
  2021-11-18 11:39 [PATCH] RDMA: clean up usnic_ib_alloc_pd() Dan Carpenter
  2021-11-18 13:04 ` Leon Romanovsky
@ 2021-11-19 16:07 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2021-11-19 16:07 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Christian Benvenuti, Upinder Malhi, Nelson Escobar, Doug Ledford,
	linux-rdma, kernel-janitors

On Thu, Nov 18, 2021 at 02:39:24PM +0300, Dan Carpenter wrote:
> Remove the unnecessary "umem_pd" variable.  And usnic_uiom_alloc_pd()
> never returns NULL so remove the NULL check.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
> ---
>  drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)

Applied to for-next, thanks

Jason

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

end of thread, other threads:[~2021-11-19 16:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 11:39 [PATCH] RDMA: clean up usnic_ib_alloc_pd() Dan Carpenter
2021-11-18 13:04 ` Leon Romanovsky
2021-11-19 16:07 ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.