RDMA: clean up usnic_ib_alloc_pd()
Subsystems (3)
PATCH 1/1 RDMA: clean up usnic_ib_alloc_pd()
Remove the unnecessary "umem_pd" variable. And usnic_uiom_alloc_pd() never returns NULL so remove the NULL check.
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/infiniband/hw/usnic/usnic_ib_verbs.c +3 -5
@@ -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 ; }
Signature · 1 line
2.20.1
Quoted 8 lines · Dan Carpenter
Remove the unnecessary "
umem_pd" variable. Andusnic_uiom_alloc_pd()never returns NULL so remove the NULL check.Signed-off-by Dan Carpenter <[email protected]>--- drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
Thanks,
Reviewed-by Leon Romanovsky <[email protected]>
Quoted 8 lines · Dan Carpenter
Remove the unnecessary "
umem_pd" variable. Andusnic_uiom_alloc_pd()never returns NULL so remove the NULL check.Signed-off-by Dan Carpenter <[email protected]>Reviewed-by Leon Romanovsky <[email protected]>--- drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
Applied to for-next, thanks
Jason