summaryrefslogtreecommitdiff
path: root/drivers/thermal/testing/zone.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/testing/zone.c')
-rw-r--r--drivers/thermal/testing/zone.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/thermal/testing/zone.c b/drivers/thermal/testing/zone.c
index c12c405225bb..014e6e5f0e83 100644
--- a/drivers/thermal/testing/zone.c
+++ b/drivers/thermal/testing/zone.c
@@ -186,12 +186,13 @@ int tt_add_tz(void)
{
int ret;
- struct tt_thermal_zone *tt_zone __free(kfree) = kzalloc(sizeof(*tt_zone),
- GFP_KERNEL);
+ struct tt_thermal_zone *tt_zone __free(kfree) = kzalloc_obj(*tt_zone,
+ GFP_KERNEL);
if (!tt_zone)
return -ENOMEM;
- struct tt_work *tt_work __free(kfree) = kzalloc(sizeof(*tt_work), GFP_KERNEL);
+ struct tt_work *tt_work __free(kfree) = kzalloc_obj(*tt_work,
+ GFP_KERNEL);
if (!tt_work)
return -ENOMEM;
@@ -244,7 +245,8 @@ int tt_del_tz(const char *arg)
if (ret != 1)
return -EINVAL;
- struct tt_work *tt_work __free(kfree) = kzalloc(sizeof(*tt_work), GFP_KERNEL);
+ struct tt_work *tt_work __free(kfree) = kzalloc_obj(*tt_work,
+ GFP_KERNEL);
if (!tt_work)
return -ENOMEM;
@@ -330,11 +332,13 @@ int tt_zone_add_trip(const char *arg)
{
int id;
- struct tt_work *tt_work __free(kfree) = kzalloc(sizeof(*tt_work), GFP_KERNEL);
+ struct tt_work *tt_work __free(kfree) = kzalloc_obj(*tt_work,
+ GFP_KERNEL);
if (!tt_work)
return -ENOMEM;
- struct tt_trip *tt_trip __free(kfree) = kzalloc(sizeof(*tt_trip), GFP_KERNEL);
+ struct tt_trip *tt_trip __free(kfree) = kzalloc_obj(*tt_trip,
+ GFP_KERNEL);
if (!tt_trip)
return -ENOMEM;
@@ -391,8 +395,9 @@ static int tt_zone_register_tz(struct tt_thermal_zone *tt_zone)
if (tt_zone->tz)
return -EINVAL;
- struct thermal_trip *trips __free(kfree) = kcalloc(tt_zone->num_trips,
- sizeof(*trips), GFP_KERNEL);
+ struct thermal_trip *trips __free(kfree) = kzalloc_objs(*trips,
+ tt_zone->num_trips,
+ GFP_KERNEL);
if (!trips)
return -ENOMEM;