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/thermal | |
| parent | e19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff) | |
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/thermal')
| -rw-r--r-- | drivers/thermal/cpufreq_cooling.c | 2 | ||||
| -rw-r--r-- | drivers/thermal/cpuidle_cooling.c | 2 | ||||
| -rw-r--r-- | drivers/thermal/devfreq_cooling.c | 2 | ||||
| -rw-r--r-- | drivers/thermal/gov_power_allocator.c | 6 | ||||
| -rw-r--r-- | drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c | 6 | ||||
| -rw-r--r-- | drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 4 | ||||
| -rw-r--r-- | drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c | 2 | ||||
| -rw-r--r-- | drivers/thermal/intel/intel_hfi.c | 2 | ||||
| -rw-r--r-- | drivers/thermal/intel/intel_quark_dts_thermal.c | 2 | ||||
| -rw-r--r-- | drivers/thermal/intel/intel_soc_dts_iosf.c | 2 | ||||
| -rw-r--r-- | drivers/thermal/intel/x86_pkg_temp_thermal.c | 4 | ||||
| -rw-r--r-- | drivers/thermal/k3_j72xx_bandgap.c | 2 | ||||
| -rw-r--r-- | drivers/thermal/thermal_core.c | 6 | ||||
| -rw-r--r-- | drivers/thermal/thermal_debugfs.c | 6 | ||||
| -rw-r--r-- | drivers/thermal/thermal_hwmon.c | 4 | ||||
| -rw-r--r-- | drivers/thermal/thermal_sysfs.c | 4 | ||||
| -rw-r--r-- | drivers/thermal/thermal_thresholds.c | 2 |
17 files changed, 29 insertions, 29 deletions
diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c index d0bb782ff734..3b85f077c364 100644 --- a/drivers/thermal/cpufreq_cooling.c +++ b/drivers/thermal/cpufreq_cooling.c @@ -542,7 +542,7 @@ __cpufreq_cooling_register(struct device_node *np, return ERR_PTR(-ENODEV); } - cpufreq_cdev = kzalloc_obj(*cpufreq_cdev, GFP_KERNEL); + cpufreq_cdev = kzalloc_obj(*cpufreq_cdev); if (!cpufreq_cdev) return ERR_PTR(-ENOMEM); diff --git a/drivers/thermal/cpuidle_cooling.c b/drivers/thermal/cpuidle_cooling.c index 5a16d4e7e698..425f596614e8 100644 --- a/drivers/thermal/cpuidle_cooling.c +++ b/drivers/thermal/cpuidle_cooling.c @@ -179,7 +179,7 @@ static int __cpuidle_cooling_register(struct device_node *np, char *name; int ret; - idle_cdev = kzalloc_obj(*idle_cdev, GFP_KERNEL); + idle_cdev = kzalloc_obj(*idle_cdev); if (!idle_cdev) { ret = -ENOMEM; goto out; diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c index 72fb23de5f55..597e86d16a4e 100644 --- a/drivers/thermal/devfreq_cooling.c +++ b/drivers/thermal/devfreq_cooling.c @@ -402,7 +402,7 @@ of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df, int err, num_opps; - dfc = kzalloc_obj(*dfc, GFP_KERNEL); + dfc = kzalloc_obj(*dfc); if (!dfc) return ERR_PTR(-ENOMEM); diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c index 696932ecb489..37f2e22a999e 100644 --- a/drivers/thermal/gov_power_allocator.c +++ b/drivers/thermal/gov_power_allocator.c @@ -622,7 +622,7 @@ static int allocate_actors_buffer(struct power_allocator_params *params, goto clean_state; } - params->power = kzalloc_objs(struct power_actor, num_actors, GFP_KERNEL); + params->power = kzalloc_objs(struct power_actor, num_actors); if (!params->power) { ret = -ENOMEM; goto clean_state; @@ -698,7 +698,7 @@ static int power_allocator_bind(struct thermal_zone_device *tz) struct power_allocator_params *params; int ret; - params = kzalloc_obj(*params, GFP_KERNEL); + params = kzalloc_obj(*params); if (!params) return -ENOMEM; @@ -719,7 +719,7 @@ static int power_allocator_bind(struct thermal_zone_device *tz) } if (!tz->tzp) { - tz->tzp = kzalloc_obj(*tz->tzp, GFP_KERNEL); + tz->tzp = kzalloc_obj(*tz->tzp); if (!tz->tzp) { ret = -ENOMEM; goto free_params; diff --git a/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c b/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c index d1876e76167a..0a548fdc4a7e 100644 --- a/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c +++ b/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c @@ -89,7 +89,7 @@ int acpi_parse_trt(acpi_handle handle, int *trt_count, struct trt **trtp, } *trt_count = p->package.count; - trts = kzalloc_objs(struct trt, *trt_count, GFP_KERNEL); + trts = kzalloc_objs(struct trt, *trt_count); if (!trts) { result = -ENOMEM; goto end; @@ -165,7 +165,7 @@ int acpi_parse_art(acpi_handle handle, int *art_count, struct art **artp, /* ignore p->package.elements[0], as this is _ART Revision field */ *art_count = p->package.count - 1; - arts = kzalloc_objs(struct art, *art_count, GFP_KERNEL); + arts = kzalloc_objs(struct art, *art_count); if (!arts) { result = -ENOMEM; goto end; @@ -253,7 +253,7 @@ static int acpi_parse_psvt(acpi_handle handle, int *psvt_count, struct psvt **ps goto end; } - psvts = kzalloc_objs(*psvts, *psvt_count, GFP_KERNEL); + psvts = kzalloc_objs(*psvts, *psvt_count); if (!psvts) { result = -ENOMEM; goto end; diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index 3a97718e2f5c..6742eaf0a447 100644 --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -382,7 +382,7 @@ static int evaluate_odvp(struct int3400_thermal_priv *priv) if (priv->odvp == NULL) { priv->odvp_count = obj->package.count; - priv->odvp = kmalloc_objs(int, priv->odvp_count, GFP_KERNEL); + priv->odvp = kmalloc_objs(int, priv->odvp_count); if (!priv->odvp) { ret = -ENOMEM; goto out_err; @@ -561,7 +561,7 @@ static int int3400_thermal_probe(struct platform_device *pdev) if (!adev) return -ENODEV; - priv = kzalloc_obj(*priv, GFP_KERNEL); + priv = kzalloc_obj(*priv); if (!priv) return -ENOMEM; diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c index 7db8fd86c4fd..4c8888fb0a8b 100644 --- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c +++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c @@ -123,7 +123,7 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev, acpi_status status; int i, ret; - int34x_zone = kzalloc_obj(*int34x_zone, GFP_KERNEL); + int34x_zone = kzalloc_obj(*int34x_zone); if (!int34x_zone) return ERR_PTR(-ENOMEM); diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/intel_hfi.c index 5100ad1336ed..35df0fd5562f 100644 --- a/drivers/thermal/intel/intel_hfi.c +++ b/drivers/thermal/intel/intel_hfi.c @@ -212,7 +212,7 @@ static void update_capabilities(struct hfi_instance *hfi_instance) if (!cpu_count) goto out; - cpu_caps = kzalloc_objs(*cpu_caps, cpu_count, GFP_KERNEL); + cpu_caps = kzalloc_objs(*cpu_caps, cpu_count); if (!cpu_caps) goto out; diff --git a/drivers/thermal/intel/intel_quark_dts_thermal.c b/drivers/thermal/intel/intel_quark_dts_thermal.c index 38a0ae14b69d..15476699bdda 100644 --- a/drivers/thermal/intel/intel_quark_dts_thermal.c +++ b/drivers/thermal/intel/intel_quark_dts_thermal.c @@ -336,7 +336,7 @@ static struct soc_sensor_entry *alloc_soc_dts(void) int err; u32 out; - aux_entry = kzalloc_obj(*aux_entry, GFP_KERNEL); + aux_entry = kzalloc_obj(*aux_entry); if (!aux_entry) { err = -ENOMEM; return ERR_PTR(-ENOMEM); diff --git a/drivers/thermal/intel/intel_soc_dts_iosf.c b/drivers/thermal/intel/intel_soc_dts_iosf.c index 78123107ac06..93773878398e 100644 --- a/drivers/thermal/intel/intel_soc_dts_iosf.c +++ b/drivers/thermal/intel/intel_soc_dts_iosf.c @@ -320,7 +320,7 @@ intel_soc_dts_iosf_init(enum intel_soc_dts_interrupt_type intr_type, if (tj_max < 0) return ERR_PTR(tj_max); - sensors = kzalloc_obj(*sensors, GFP_KERNEL); + sensors = kzalloc_obj(*sensors); if (!sensors) return ERR_PTR(-ENOMEM); diff --git a/drivers/thermal/intel/x86_pkg_temp_thermal.c b/drivers/thermal/intel/x86_pkg_temp_thermal.c index 64cc0361d440..540109761f0a 100644 --- a/drivers/thermal/intel/x86_pkg_temp_thermal.c +++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c @@ -335,7 +335,7 @@ static int pkg_temp_thermal_device_add(unsigned int cpu) return tj_max; tj_max *= 1000; - zonedev = kzalloc_obj(*zonedev, GFP_KERNEL); + zonedev = kzalloc_obj(*zonedev); if (!zonedev) return -ENOMEM; @@ -492,7 +492,7 @@ static int __init pkg_temp_thermal_init(void) return -ENODEV; max_id = topology_max_packages() * topology_max_dies_per_package(); - zones = kzalloc_objs(struct zone_device *, max_id, GFP_KERNEL); + zones = kzalloc_objs(struct zone_device *, max_id); if (!zones) return -ENOMEM; diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c index 138a8137f790..6aba00d8b8fd 100644 --- a/drivers/thermal/k3_j72xx_bandgap.c +++ b/drivers/thermal/k3_j72xx_bandgap.c @@ -462,7 +462,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev) goto err_alloc; } - ref_table = kzalloc_objs(*ref_table, TABLE_SIZE, GFP_KERNEL); + ref_table = kzalloc_objs(*ref_table, TABLE_SIZE); if (!ref_table) { ret = -ENOMEM; goto err_alloc; diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index daaba832b2a0..f0b2a2a340a3 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -844,7 +844,7 @@ static int thermal_bind_cdev_to_trip(struct thermal_zone_device *tz, if (cool_spec->lower > cool_spec->upper || cool_spec->upper > cdev->max_state) return -EINVAL; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return -ENOMEM; @@ -1070,7 +1070,7 @@ __thermal_cooling_device_register(struct device_node *np, if (!thermal_class) return ERR_PTR(-ENODEV); - cdev = kzalloc_obj(*cdev, GFP_KERNEL); + cdev = kzalloc_obj(*cdev); if (!cdev) return ERR_PTR(-ENOMEM); @@ -1899,7 +1899,7 @@ static int __init thermal_init(void) if (result) goto unregister_netlink; - thermal_class = kzalloc_obj(*thermal_class, GFP_KERNEL); + thermal_class = kzalloc_obj(*thermal_class); if (!thermal_class) { result = -ENOMEM; goto unregister_governors; diff --git a/drivers/thermal/thermal_debugfs.c b/drivers/thermal/thermal_debugfs.c index 19b050cb4f70..d1b5a09ed684 100644 --- a/drivers/thermal/thermal_debugfs.c +++ b/drivers/thermal/thermal_debugfs.c @@ -193,7 +193,7 @@ static struct thermal_debugfs *thermal_debugfs_add_id(struct dentry *d, int id) struct thermal_debugfs *thermal_dbg; char ids[IDSLENGTH]; - thermal_dbg = kzalloc_obj(*thermal_dbg, GFP_KERNEL); + thermal_dbg = kzalloc_obj(*thermal_dbg); if (!thermal_dbg) return NULL; @@ -226,7 +226,7 @@ thermal_debugfs_cdev_record_alloc(struct thermal_debugfs *thermal_dbg, { struct cdev_record *cdev_record; - cdev_record = kzalloc_obj(*cdev_record, GFP_KERNEL); + cdev_record = kzalloc_obj(*cdev_record); if (!cdev_record) return NULL; @@ -876,7 +876,7 @@ void thermal_debug_tz_add(struct thermal_zone_device *tz) tz_dbg->tz = tz; - tz_dbg->trips_crossed = kzalloc_objs(int, tz->num_trips, GFP_KERNEL); + tz_dbg->trips_crossed = kzalloc_objs(int, tz->num_trips); if (!tz_dbg->trips_crossed) { thermal_debugfs_remove_id(thermal_dbg); return; diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c index f377175b2663..b624892bc6d6 100644 --- a/drivers/thermal/thermal_hwmon.c +++ b/drivers/thermal/thermal_hwmon.c @@ -145,7 +145,7 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) goto register_sys_interface; } - hwmon = kzalloc_obj(*hwmon, GFP_KERNEL); + hwmon = kzalloc_obj(*hwmon); if (!hwmon) return -ENOMEM; @@ -160,7 +160,7 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) } register_sys_interface: - temp = kzalloc_obj(*temp, GFP_KERNEL); + temp = kzalloc_obj(*temp); if (!temp) { result = -ENOMEM; goto unregister_name; diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c index 057460b2e7bb..46b3b2df935c 100644 --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -392,7 +392,7 @@ static int create_trip_attrs(struct thermal_zone_device *tz) struct attribute **attrs; int i; - attrs = kzalloc_objs(*attrs, tz->num_trips * 3 + 1, GFP_KERNEL); + attrs = kzalloc_objs(*attrs, tz->num_trips * 3 + 1); if (!attrs) return -ENOMEM; @@ -465,7 +465,7 @@ int thermal_zone_create_device_groups(struct thermal_zone_device *tz) /* we need one extra for trips and the NULL to terminate the array */ size = ARRAY_SIZE(thermal_zone_attribute_groups) + 2; /* This also takes care of API requirement to be NULL terminated */ - groups = kzalloc_objs(*groups, size, GFP_KERNEL); + groups = kzalloc_objs(*groups, size); if (!groups) return -ENOMEM; diff --git a/drivers/thermal/thermal_thresholds.c b/drivers/thermal/thermal_thresholds.c index 421ddf907b6d..970b8fd33847 100644 --- a/drivers/thermal/thermal_thresholds.c +++ b/drivers/thermal/thermal_thresholds.c @@ -181,7 +181,7 @@ int thermal_thresholds_add(struct thermal_zone_device *tz, t->direction |= direction; } else { - t = kmalloc_obj(*t, GFP_KERNEL); + t = kmalloc_obj(*t); if (!t) return -ENOMEM; |
