]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/ipoib: Remove can_sleep parameter from iboib_mcast_alloc
authorKamal Heib <kamalheib1@gmail.com>
Mon, 25 May 2020 13:03:05 +0000 (16:03 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 25 May 2020 18:48:12 +0000 (15:48 -0300)
can_sleep is always 0 when iboib_mcast_alloc() is called, so remove it and
use GFP_ATOMIC instead of GFP_KERNEL.

Link: https://lore.kernel.org/r/20200525130305.171509-1-kamalheib1@gmail.com
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/ulp/ipoib/ipoib_multicast.c

index 3d5f6b848c9e8a1e11afed89fdd8813f06eca5f1..9bfa514473d5e75b2ed184080092d905dccf2022 100644 (file)
@@ -135,12 +135,11 @@ static void ipoib_mcast_free(struct ipoib_mcast *mcast)
        kfree(mcast);
 }
 
-static struct ipoib_mcast *ipoib_mcast_alloc(struct net_device *dev,
-                                            int can_sleep)
+static struct ipoib_mcast *ipoib_mcast_alloc(struct net_device *dev)
 {
        struct ipoib_mcast *mcast;
 
-       mcast = kzalloc(sizeof(*mcast), can_sleep ? GFP_KERNEL : GFP_ATOMIC);
+       mcast = kzalloc(sizeof(*mcast), GFP_ATOMIC);
        if (!mcast)
                return NULL;
 
@@ -599,7 +598,7 @@ void ipoib_mcast_join_task(struct work_struct *work)
        if (!priv->broadcast) {
                struct ipoib_mcast *broadcast;
 
-               broadcast = ipoib_mcast_alloc(dev, 0);
+               broadcast = ipoib_mcast_alloc(dev);
                if (!broadcast) {
                        ipoib_warn(priv, "failed to allocate broadcast group\n");
                        /*
@@ -782,7 +781,7 @@ void ipoib_mcast_send(struct net_device *dev, u8 *daddr, struct sk_buff *skb)
                        ipoib_dbg_mcast(priv, "setting up send only multicast group for %pI6\n",
                                        mgid);
 
-                       mcast = ipoib_mcast_alloc(dev, 0);
+                       mcast = ipoib_mcast_alloc(dev);
                        if (!mcast) {
                                ipoib_warn(priv, "unable to allocate memory "
                                           "for multicast structure\n");
@@ -936,7 +935,7 @@ void ipoib_mcast_restart_task(struct work_struct *work)
                        ipoib_dbg_mcast(priv, "adding multicast entry for mgid %pI6\n",
                                        mgid.raw);
 
-                       nmcast = ipoib_mcast_alloc(dev, 0);
+                       nmcast = ipoib_mcast_alloc(dev);
                        if (!nmcast) {
                                ipoib_warn(priv, "unable to allocate memory for multicast structure\n");
                                continue;