diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-22 03:37:42 +0300 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-22 04:09:51 +0300 |
| commit | bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch) | |
| tree | 01fdd9d27f1b272bef0127966e08eac44d134d0a /drivers/net/can/usb | |
| parent | e19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff) | |
| download | linux-bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43.tar.xz | |
Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
This was done entirely with mindless brute force, using
git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'
to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.
Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.
For the same reason the 'flex' versions will be done as a separate
conversion.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/net/can/usb')
| -rw-r--r-- | drivers/net/can/usb/esd_usb.c | 12 | ||||
| -rw-r--r-- | drivers/net/can/usb/f81604.c | 4 | ||||
| -rw-r--r-- | drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 18 | ||||
| -rw-r--r-- | drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 12 | ||||
| -rw-r--r-- | drivers/net/can/usb/nct6694_canfd.c | 6 | ||||
| -rw-r--r-- | drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 2 | ||||
| -rw-r--r-- | drivers/net/can/usb/peak_usb/pcan_usb_pro.c | 6 |
7 files changed, 30 insertions, 30 deletions
diff --git a/drivers/net/can/usb/esd_usb.c b/drivers/net/can/usb/esd_usb.c index 029a321bac10..2892a68f510a 100644 --- a/drivers/net/can/usb/esd_usb.c +++ b/drivers/net/can/usb/esd_usb.c @@ -726,7 +726,7 @@ static int esd_usb_start(struct esd_usb_net_priv *priv) union esd_usb_msg *msg; int err, i; - msg = kmalloc_obj(*msg, GFP_KERNEL); + msg = kmalloc_obj(*msg); if (!msg) { err = -ENOMEM; goto out; @@ -962,7 +962,7 @@ static int esd_usb_stop(struct esd_usb_net_priv *priv) int err; int i; - msg = kmalloc_obj(*msg, GFP_KERNEL); + msg = kmalloc_obj(*msg); if (!msg) return -ENOMEM; @@ -1068,7 +1068,7 @@ static int esd_usb_2_set_bittiming(struct net_device *netdev) if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES) canbtr |= ESD_USB_TRIPLE_SAMPLES; - msg = kmalloc_obj(*msg, GFP_KERNEL); + msg = kmalloc_obj(*msg); if (!msg) return -ENOMEM; @@ -1130,7 +1130,7 @@ static int esd_usb_3_set_bittiming(struct net_device *netdev) u16 flags = 0; int err; - msg = kmalloc_obj(*msg, GFP_KERNEL); + msg = kmalloc_obj(*msg); if (!msg) return -ENOMEM; @@ -1302,7 +1302,7 @@ static int esd_usb_probe(struct usb_interface *intf, union esd_usb_msg *msg; int i, err; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) { err = -ENOMEM; goto done; @@ -1314,7 +1314,7 @@ static int esd_usb_probe(struct usb_interface *intf, usb_set_intfdata(intf, dev); - msg = kmalloc_obj(*msg, GFP_KERNEL); + msg = kmalloc_obj(*msg); if (!msg) { err = -ENOMEM; goto free_msg; diff --git a/drivers/net/can/usb/f81604.c b/drivers/net/can/usb/f81604.c index 435c7d878138..76578063ac82 100644 --- a/drivers/net/can/usb/f81604.c +++ b/drivers/net/can/usb/f81604.c @@ -678,7 +678,7 @@ static int f81604_register_urbs(struct f81604_port_priv *priv) break; } - frame = kmalloc_obj(*frame, GFP_KERNEL); + frame = kmalloc_obj(*frame); if (!frame) { usb_free_urb(rx_urb); ret = -ENOMEM; @@ -717,7 +717,7 @@ static int f81604_register_urbs(struct f81604_port_priv *priv) goto error; } - int_data = kmalloc_obj(*int_data, GFP_KERNEL); + int_data = kmalloc_obj(*int_data); if (!int_data) { usb_free_urb(int_urb); ret = -ENOMEM; diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c index e765210626ce..e09d663e362f 100644 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c @@ -580,7 +580,7 @@ static int kvaser_usb_hydra_send_simple_cmd(struct kvaser_usb *dev, size_t cmd_len; int err; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -742,7 +742,7 @@ static int kvaser_usb_hydra_map_channel(struct kvaser_usb *dev, u16 transid, struct kvaser_cmd *cmd; int err; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -784,7 +784,7 @@ static int kvaser_usb_hydra_get_single_capability(struct kvaser_usb *dev, int err; int i; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -1610,7 +1610,7 @@ static int kvaser_usb_hydra_get_busparams(struct kvaser_usb_net_priv *priv, if (!hydra) return -EINVAL; - cmd = kzalloc_objs(struct kvaser_cmd, 1, GFP_KERNEL); + cmd = kzalloc_objs(struct kvaser_cmd, 1); if (!cmd) return -ENOMEM; @@ -1655,7 +1655,7 @@ static int kvaser_usb_hydra_set_bittiming(const struct net_device *netdev, size_t cmd_len; int err; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -1685,7 +1685,7 @@ static int kvaser_usb_hydra_set_data_bittiming(const struct net_device *netdev, size_t cmd_len; int err; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -1842,7 +1842,7 @@ static int kvaser_usb_hydra_get_software_details(struct kvaser_usb *dev) u32 fw_version; struct kvaser_usb_dev_card_data *card_data = &dev->card_data; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -1985,7 +1985,7 @@ static int kvaser_usb_hydra_set_led(struct kvaser_usb_net_priv *priv, size_t cmd_len; int ret; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -2021,7 +2021,7 @@ static int kvaser_usb_hydra_set_opt_mode(const struct kvaser_usb_net_priv *priv) return -EINVAL; } - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c index 8e32d98ab0a3..fd191ec5738b 100644 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c @@ -723,7 +723,7 @@ static int kvaser_usb_leaf_send_simple_cmd(const struct kvaser_usb *dev, struct kvaser_cmd *cmd; int rc; - cmd = kmalloc_obj(*cmd, GFP_KERNEL); + cmd = kmalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -873,7 +873,7 @@ static int kvaser_usb_leaf_get_single_capability(struct kvaser_usb *dev, int err; int i; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -970,7 +970,7 @@ static int kvaser_usb_leaf_set_led(struct kvaser_usb_net_priv *priv, struct kvaser_cmd *cmd; int ret; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -1752,7 +1752,7 @@ static int kvaser_usb_leaf_set_opt_mode(const struct kvaser_usb_net_priv *priv) struct kvaser_cmd *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -1824,7 +1824,7 @@ static int kvaser_usb_leaf_flush_queue(struct kvaser_usb_net_priv *priv) struct kvaser_cmd *cmd; int rc; - cmd = kzalloc_obj(*cmd, GFP_KERNEL); + cmd = kzalloc_obj(*cmd); if (!cmd) return -ENOMEM; @@ -1881,7 +1881,7 @@ static int kvaser_usb_leaf_set_bittiming(const struct net_device *netdev, struct kvaser_cmd *cmd; int rc; - cmd = kmalloc_obj(*cmd, GFP_KERNEL); + cmd = kmalloc_obj(*cmd); if (!cmd) return -ENOMEM; diff --git a/drivers/net/can/usb/nct6694_canfd.c b/drivers/net/can/usb/nct6694_canfd.c index de60c2d1cdd1..e5f7f8849a73 100644 --- a/drivers/net/can/usb/nct6694_canfd.c +++ b/drivers/net/can/usb/nct6694_canfd.c @@ -527,7 +527,7 @@ static int nct6694_canfd_start(struct net_device *ndev) u32 en_tdc; int ret; - setting = kzalloc_obj(*setting, GFP_KERNEL); + setting = kzalloc_obj(*setting); if (!setting) return -ENOMEM; @@ -596,7 +596,7 @@ static void nct6694_canfd_stop(struct net_device *ndev) * mode allows the device to monitor bus activity without actively * participating in communication. */ - setting = kzalloc_obj(*setting, GFP_KERNEL); + setting = kzalloc_obj(*setting); if (!setting) return; @@ -707,7 +707,7 @@ static int nct6694_canfd_get_clock(struct nct6694_canfd_priv *priv) }; int ret; - info = kzalloc_obj(*info, GFP_KERNEL); + info = kzalloc_obj(*info); if (!info) return -ENOMEM; diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c index fbdc9b644241..eb4f5884ad73 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c @@ -939,7 +939,7 @@ static int pcan_usb_fd_init(struct peak_usb_device *dev) /* do this for 1st channel only */ if (!dev->prev_siblings) { /* allocate netdevices common structure attached to first one */ - pdev->usb_if = kzalloc_obj(*pdev->usb_if, GFP_KERNEL); + pdev->usb_if = kzalloc_obj(*pdev->usb_if); if (!pdev->usb_if) goto err_out; diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c index db5d43bd4220..4bfa8d0fbb32 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c @@ -870,9 +870,9 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev) /* do this for 1st channel only */ if (!dev->prev_siblings) { /* allocate netdevices common structure attached to first one */ - usb_if = kzalloc_obj(struct pcan_usb_pro_interface, GFP_KERNEL); - fi = kmalloc_obj(struct pcan_usb_pro_fwinfo, GFP_KERNEL); - bi = kmalloc_obj(struct pcan_usb_pro_blinfo, GFP_KERNEL); + usb_if = kzalloc_obj(struct pcan_usb_pro_interface); + fi = kmalloc_obj(struct pcan_usb_pro_fwinfo); + bi = kmalloc_obj(struct pcan_usb_pro_blinfo); if (!usb_if || !fi || !bi) { err = -ENOMEM; goto err_out; |
