Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RDMA/ipoib: Remove can_sleep parameter from iboib_mcast_alloc

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>

authored by

Kamal Heib and committed by
Jason Gunthorpe
ebd6e96b 49ea0c03

+5 -6
+5 -6
drivers/infiniband/ulp/ipoib/ipoib_multicast.c
··· 135 135 kfree(mcast); 136 136 } 137 137 138 - static struct ipoib_mcast *ipoib_mcast_alloc(struct net_device *dev, 139 - int can_sleep) 138 + static struct ipoib_mcast *ipoib_mcast_alloc(struct net_device *dev) 140 139 { 141 140 struct ipoib_mcast *mcast; 142 141 143 - mcast = kzalloc(sizeof(*mcast), can_sleep ? GFP_KERNEL : GFP_ATOMIC); 142 + mcast = kzalloc(sizeof(*mcast), GFP_ATOMIC); 144 143 if (!mcast) 145 144 return NULL; 146 145 ··· 598 599 if (!priv->broadcast) { 599 600 struct ipoib_mcast *broadcast; 600 601 601 - broadcast = ipoib_mcast_alloc(dev, 0); 602 + broadcast = ipoib_mcast_alloc(dev); 602 603 if (!broadcast) { 603 604 ipoib_warn(priv, "failed to allocate broadcast group\n"); 604 605 /* ··· 781 782 ipoib_dbg_mcast(priv, "setting up send only multicast group for %pI6\n", 782 783 mgid); 783 784 784 - mcast = ipoib_mcast_alloc(dev, 0); 785 + mcast = ipoib_mcast_alloc(dev); 785 786 if (!mcast) { 786 787 ipoib_warn(priv, "unable to allocate memory " 787 788 "for multicast structure\n"); ··· 935 936 ipoib_dbg_mcast(priv, "adding multicast entry for mgid %pI6\n", 936 937 mgid.raw); 937 938 938 - nmcast = ipoib_mcast_alloc(dev, 0); 939 + nmcast = ipoib_mcast_alloc(dev); 939 940 if (!nmcast) { 940 941 ipoib_warn(priv, "unable to allocate memory for multicast structure\n"); 941 942 continue;