diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 16:37:42 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 17:09:51 -0800 |
| commit | bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch) | |
| tree | 01fdd9d27f1b272bef0127966e08eac44d134d0a /drivers/thunderbolt | |
| parent | e19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff) | |
| download | lwn-bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43.tar.gz lwn-bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43.zip | |
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/thunderbolt')
| -rw-r--r-- | drivers/thunderbolt/ctl.c | 6 | ||||
| -rw-r--r-- | drivers/thunderbolt/debugfs.c | 2 | ||||
| -rw-r--r-- | drivers/thunderbolt/dma_port.c | 2 | ||||
| -rw-r--r-- | drivers/thunderbolt/dma_test.c | 4 | ||||
| -rw-r--r-- | drivers/thunderbolt/domain.c | 4 | ||||
| -rw-r--r-- | drivers/thunderbolt/icm.c | 6 | ||||
| -rw-r--r-- | drivers/thunderbolt/nhi.c | 2 | ||||
| -rw-r--r-- | drivers/thunderbolt/nvm.c | 2 | ||||
| -rw-r--r-- | drivers/thunderbolt/path.c | 8 | ||||
| -rw-r--r-- | drivers/thunderbolt/property.c | 6 | ||||
| -rw-r--r-- | drivers/thunderbolt/retimer.c | 2 | ||||
| -rw-r--r-- | drivers/thunderbolt/switch.c | 6 | ||||
| -rw-r--r-- | drivers/thunderbolt/tb.c | 4 | ||||
| -rw-r--r-- | drivers/thunderbolt/tunnel.c | 4 | ||||
| -rw-r--r-- | drivers/thunderbolt/usb4_port.c | 2 | ||||
| -rw-r--r-- | drivers/thunderbolt/xdomain.c | 6 |
16 files changed, 33 insertions, 33 deletions
diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c index 3108727c4ef2..b2fd60fc7bcc 100644 --- a/drivers/thunderbolt/ctl.c +++ b/drivers/thunderbolt/ctl.c @@ -89,7 +89,7 @@ struct tb_cfg_request *tb_cfg_request_alloc(void) { struct tb_cfg_request *req; - req = kzalloc_obj(*req, GFP_KERNEL); + req = kzalloc_obj(*req); if (!req) return NULL; @@ -333,7 +333,7 @@ static void tb_ctl_pkg_free(struct ctl_pkg *pkg) static struct ctl_pkg *tb_ctl_pkg_alloc(struct tb_ctl *ctl) { - struct ctl_pkg *pkg = kzalloc_obj(*pkg, GFP_KERNEL); + struct ctl_pkg *pkg = kzalloc_obj(*pkg); if (!pkg) return NULL; pkg->ctl = ctl; @@ -654,7 +654,7 @@ struct tb_ctl *tb_ctl_alloc(struct tb_nhi *nhi, int index, int timeout_msec, event_cb cb, void *cb_data) { int i; - struct tb_ctl *ctl = kzalloc_obj(*ctl, GFP_KERNEL); + struct tb_ctl *ctl = kzalloc_obj(*ctl); if (!ctl) return NULL; diff --git a/drivers/thunderbolt/debugfs.c b/drivers/thunderbolt/debugfs.c index 7e2a59dddbbd..042f6a0d0f7f 100644 --- a/drivers/thunderbolt/debugfs.c +++ b/drivers/thunderbolt/debugfs.c @@ -1657,7 +1657,7 @@ static struct tb_margining *margining_alloc(struct tb_port *port, return NULL; } - margining = kzalloc_obj(*margining, GFP_KERNEL); + margining = kzalloc_obj(*margining); if (!margining) return NULL; diff --git a/drivers/thunderbolt/dma_port.c b/drivers/thunderbolt/dma_port.c index ddbf5f9971fb..334fefe21255 100644 --- a/drivers/thunderbolt/dma_port.c +++ b/drivers/thunderbolt/dma_port.c @@ -209,7 +209,7 @@ struct tb_dma_port *dma_port_alloc(struct tb_switch *sw) if (port < 0) return NULL; - dma = kzalloc_obj(*dma, GFP_KERNEL); + dma = kzalloc_obj(*dma); if (!dma) return NULL; diff --git a/drivers/thunderbolt/dma_test.c b/drivers/thunderbolt/dma_test.c index 8298f25ef6bd..b4aa79d482a0 100644 --- a/drivers/thunderbolt/dma_test.c +++ b/drivers/thunderbolt/dma_test.c @@ -267,7 +267,7 @@ static int dma_test_submit_rx(struct dma_test *dt, size_t npackets) struct dma_test_frame *tf; dma_addr_t dma_addr; - tf = kzalloc_obj(*tf, GFP_KERNEL); + tf = kzalloc_obj(*tf); if (!tf) return -ENOMEM; @@ -318,7 +318,7 @@ static int dma_test_submit_tx(struct dma_test *dt, size_t npackets) struct dma_test_frame *tf; dma_addr_t dma_addr; - tf = kzalloc_obj(*tf, GFP_KERNEL); + tf = kzalloc_obj(*tf); if (!tf) return -ENOMEM; diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c index 1e7268e26fc2..317780b99992 100644 --- a/drivers/thunderbolt/domain.c +++ b/drivers/thunderbolt/domain.c @@ -126,7 +126,7 @@ static ssize_t boot_acl_show(struct device *dev, struct device_attribute *attr, ssize_t ret; int i; - uuids = kzalloc_objs(uuid_t, tb->nboot_acl, GFP_KERNEL); + uuids = kzalloc_objs(uuid_t, tb->nboot_acl); if (!uuids) return -ENOMEM; @@ -181,7 +181,7 @@ static ssize_t boot_acl_store(struct device *dev, struct device_attribute *attr, if (!str) return -ENOMEM; - acl = kzalloc_objs(uuid_t, tb->nboot_acl, GFP_KERNEL); + acl = kzalloc_objs(uuid_t, tb->nboot_acl); if (!acl) { ret = -ENOMEM; goto err_free_str; diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c index fda1471c7ef8..9d95bf3ab44c 100644 --- a/drivers/thunderbolt/icm.c +++ b/drivers/thunderbolt/icm.c @@ -427,7 +427,7 @@ static int icm_fr_get_route(struct tb *tb, u8 link, u8 depth, u64 *route) int ret, index; u8 i; - switches = kzalloc_objs(*switches, npackets, GFP_KERNEL); + switches = kzalloc_objs(*switches, npackets); if (!switches) return -ENOMEM; @@ -1769,7 +1769,7 @@ static void icm_handle_event(struct tb *tb, enum tb_cfg_pkg_type type, { struct icm_notification *n; - n = kmalloc_obj(*n, GFP_KERNEL); + n = kmalloc_obj(*n); if (!n) return; @@ -2246,7 +2246,7 @@ static int icm_usb4_switch_nvm_authenticate(struct tb *tb, u64 route) struct tb_cfg_request *req; int ret; - auth = kzalloc_obj(*auth, GFP_KERNEL); + auth = kzalloc_obj(*auth); if (!auth) return -ENOMEM; diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c index 6431c411fb17..ccce020a2432 100644 --- a/drivers/thunderbolt/nhi.c +++ b/drivers/thunderbolt/nhi.c @@ -587,7 +587,7 @@ static struct tb_ring *tb_ring_alloc(struct tb_nhi *nhi, u32 hop, int size, dev_dbg(&nhi->pdev->dev, "allocating %s ring %d of size %d\n", transmit ? "TX" : "RX", hop, size); - ring = kzalloc_obj(*ring, GFP_KERNEL); + ring = kzalloc_obj(*ring); if (!ring) return NULL; diff --git a/drivers/thunderbolt/nvm.c b/drivers/thunderbolt/nvm.c index ac9c5504cfc1..3dfa70ea6570 100644 --- a/drivers/thunderbolt/nvm.c +++ b/drivers/thunderbolt/nvm.c @@ -330,7 +330,7 @@ struct tb_nvm *tb_nvm_alloc(struct device *dev) return ERR_PTR(-EOPNOTSUPP); } - nvm = kzalloc_obj(*nvm, GFP_KERNEL); + nvm = kzalloc_obj(*nvm); if (!nvm) return ERR_PTR(-ENOMEM); diff --git a/drivers/thunderbolt/path.c b/drivers/thunderbolt/path.c index 88311c6e599b..22fb4a1e1acd 100644 --- a/drivers/thunderbolt/path.c +++ b/drivers/thunderbolt/path.c @@ -150,7 +150,7 @@ struct tb_path *tb_path_discover(struct tb_port *src, int src_hopid, num_hops++; } - path = kzalloc_obj(*path, GFP_KERNEL); + path = kzalloc_obj(*path); if (!path) return NULL; @@ -160,7 +160,7 @@ struct tb_path *tb_path_discover(struct tb_port *src, int src_hopid, path->activated = true; path->alloc_hopid = alloc_hopid; - path->hops = kzalloc_objs(*path->hops, num_hops, GFP_KERNEL); + path->hops = kzalloc_objs(*path->hops, num_hops); if (!path->hops) { kfree(path); return NULL; @@ -245,7 +245,7 @@ struct tb_path *tb_path_alloc(struct tb *tb, struct tb_port *src, int src_hopid, size_t num_hops; int i, ret; - path = kzalloc_obj(*path, GFP_KERNEL); + path = kzalloc_obj(*path); if (!path) return NULL; @@ -267,7 +267,7 @@ struct tb_path *tb_path_alloc(struct tb *tb, struct tb_port *src, int src_hopid, /* Each hop takes two ports */ num_hops = i / 2; - path->hops = kzalloc_objs(*path->hops, num_hops, GFP_KERNEL); + path->hops = kzalloc_objs(*path->hops, num_hops); if (!path->hops) { kfree(path); return NULL; diff --git a/drivers/thunderbolt/property.c b/drivers/thunderbolt/property.c index a274c02d71c0..50cbfc92fe65 100644 --- a/drivers/thunderbolt/property.c +++ b/drivers/thunderbolt/property.c @@ -81,7 +81,7 @@ tb_property_alloc(const char *key, enum tb_property_type type) { struct tb_property *property; - property = kzalloc_obj(*property, GFP_KERNEL); + property = kzalloc_obj(*property); if (!property) return NULL; @@ -166,7 +166,7 @@ static struct tb_property_dir *__tb_property_parse_dir(const u32 *block, unsigned int content_offset; struct tb_property_dir *dir; - dir = kzalloc_obj(*dir, GFP_KERNEL); + dir = kzalloc_obj(*dir); if (!dir) return NULL; @@ -247,7 +247,7 @@ struct tb_property_dir *tb_property_create_dir(const uuid_t *uuid) { struct tb_property_dir *dir; - dir = kzalloc_obj(*dir, GFP_KERNEL); + dir = kzalloc_obj(*dir); if (!dir) return NULL; diff --git a/drivers/thunderbolt/retimer.c b/drivers/thunderbolt/retimer.c index b95f5c19cca5..b1e8d9d6454d 100644 --- a/drivers/thunderbolt/retimer.c +++ b/drivers/thunderbolt/retimer.c @@ -410,7 +410,7 @@ static int tb_retimer_add(struct tb_port *port, u8 index, u32 auth_status, } - rt = kzalloc_obj(*rt, GFP_KERNEL); + rt = kzalloc_obj(*rt); if (!rt) return -ENOMEM; diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index 90d62141ecd8..b86ccb5b53fd 100644 --- a/drivers/thunderbolt/switch.c +++ b/drivers/thunderbolt/switch.c @@ -69,7 +69,7 @@ static void nvm_set_auth_status(const struct tb_switch *sw, u32 status) st = __nvm_get_auth_status(sw); if (!st) { - st = kzalloc_obj(*st, GFP_KERNEL); + st = kzalloc_obj(*st); if (!st) goto unlock; @@ -2475,7 +2475,7 @@ struct tb_switch *tb_switch_alloc(struct tb *tb, struct device *parent, if (upstream_port < 0) return ERR_PTR(upstream_port); - sw = kzalloc_obj(*sw, GFP_KERNEL); + sw = kzalloc_obj(*sw); if (!sw) return ERR_PTR(-ENOMEM); @@ -2577,7 +2577,7 @@ tb_switch_alloc_safe_mode(struct tb *tb, struct device *parent, u64 route) { struct tb_switch *sw; - sw = kzalloc_obj(*sw, GFP_KERNEL); + sw = kzalloc_obj(*sw); if (!sw) return ERR_PTR(-ENOMEM); diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index 4c3b2d48c4a0..c69c323e6952 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c @@ -94,7 +94,7 @@ static void tb_queue_hotplug(struct tb *tb, u64 route, u8 port, bool unplug) { struct tb_hotplug_event *ev; - ev = kmalloc_obj(*ev, GFP_KERNEL); + ev = kmalloc_obj(*ev); if (!ev) return; @@ -2862,7 +2862,7 @@ static void tb_queue_dp_bandwidth_request(struct tb *tb, u64 route, u8 port, { struct tb_hotplug_event *ev; - ev = kmalloc_obj(*ev, GFP_KERNEL); + ev = kmalloc_obj(*ev); if (!ev) return; diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c index 2d537ada98e1..89676acf1290 100644 --- a/drivers/thunderbolt/tunnel.c +++ b/drivers/thunderbolt/tunnel.c @@ -180,11 +180,11 @@ static struct tb_tunnel *tb_tunnel_alloc(struct tb *tb, size_t npaths, { struct tb_tunnel *tunnel; - tunnel = kzalloc_obj(*tunnel, GFP_KERNEL); + tunnel = kzalloc_obj(*tunnel); if (!tunnel) return NULL; - tunnel->paths = kzalloc_objs(tunnel->paths[0], npaths, GFP_KERNEL); + tunnel->paths = kzalloc_objs(tunnel->paths[0], npaths); if (!tunnel->paths) { kfree(tunnel); return NULL; diff --git a/drivers/thunderbolt/usb4_port.c b/drivers/thunderbolt/usb4_port.c index 642822b58b42..c32d3516e780 100644 --- a/drivers/thunderbolt/usb4_port.c +++ b/drivers/thunderbolt/usb4_port.c @@ -305,7 +305,7 @@ struct usb4_port *usb4_port_device_add(struct tb_port *port) struct usb4_port *usb4; int ret; - usb4 = kzalloc_obj(*usb4, GFP_KERNEL); + usb4 = kzalloc_obj(*usb4); if (!usb4) return ERR_PTR(-ENOMEM); diff --git a/drivers/thunderbolt/xdomain.c b/drivers/thunderbolt/xdomain.c index 384afd16af72..754808c43f00 100644 --- a/drivers/thunderbolt/xdomain.c +++ b/drivers/thunderbolt/xdomain.c @@ -858,7 +858,7 @@ tb_xdp_schedule_request(struct tb *tb, const struct tb_xdp_header *hdr, { struct xdomain_request_work *xw; - xw = kmalloc_obj(*xw, GFP_KERNEL); + xw = kmalloc_obj(*xw); if (!xw) return false; @@ -1094,7 +1094,7 @@ static void enumerate_services(struct tb_xdomain *xd) continue; } - svc = kzalloc_obj(*svc, GFP_KERNEL); + svc = kzalloc_obj(*svc); if (!svc) break; @@ -1974,7 +1974,7 @@ struct tb_xdomain *tb_xdomain_alloc(struct tb *tb, struct device *parent, down = tb_port_at(route, parent_sw); tb_port_unlock(down); - xd = kzalloc_obj(*xd, GFP_KERNEL); + xd = kzalloc_obj(*xd); if (!xd) return NULL; |
