diff options
author | Leon Romanovsky <leonro@mellanox.com> | 2017-08-17 14:50:41 +0200 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-08-24 22:27:10 +0200 |
commit | 5d50f400e56fbc7a14ef3f8d42ba47710e455881 (patch) | |
tree | 5b09b135efa7a78a749aa4f6d0f3f14b6d18985c /drivers/infiniband/hw/usnic/usnic_fwd.c | |
parent | RDMA/mlx4: Remove gfp_mask argument from acquire_group call (diff) | |
download | linux-5d50f400e56fbc7a14ef3f8d42ba47710e455881.tar.xz linux-5d50f400e56fbc7a14ef3f8d42ba47710e455881.zip |
RDMA/usnic: Fix remove address space warning
Sparse tool complains with the following error:
drivers/infiniband/hw/usnic/usnic_ib_main.c:445:16: warning: cast removes
address space of expression
Fix it by doing casting on correct field and convert function helper which
sets ifaddr to be void, because there are no users who are interested in
returned value.
Fixes: c7845bcafe4d ("IB/usnic: Add UDP support in u*verbs.c, u*main.c and u*util.h")
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/usnic/usnic_fwd.c')
-rw-r--r-- | drivers/infiniband/hw/usnic/usnic_fwd.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/infiniband/hw/usnic/usnic_fwd.c b/drivers/infiniband/hw/usnic/usnic_fwd.c index 3c37dd59c04e..995a26b65156 100644 --- a/drivers/infiniband/hw/usnic/usnic_fwd.c +++ b/drivers/infiniband/hw/usnic/usnic_fwd.c @@ -110,20 +110,12 @@ void usnic_fwd_set_mac(struct usnic_fwd_dev *ufdev, char mac[ETH_ALEN]) spin_unlock(&ufdev->lock); } -int usnic_fwd_add_ipaddr(struct usnic_fwd_dev *ufdev, __be32 inaddr) +void usnic_fwd_add_ipaddr(struct usnic_fwd_dev *ufdev, __be32 inaddr) { - int status; - spin_lock(&ufdev->lock); - if (ufdev->inaddr == 0) { + if (!ufdev->inaddr) ufdev->inaddr = inaddr; - status = 0; - } else { - status = -EFAULT; - } spin_unlock(&ufdev->lock); - - return status; } void usnic_fwd_del_ipaddr(struct usnic_fwd_dev *ufdev) |