diff options
Diffstat (limited to 'drivers/of')
| -rw-r--r-- | drivers/of/address.c | 2 | ||||
| -rw-r--r-- | drivers/of/dynamic.c | 6 | ||||
| -rw-r--r-- | drivers/of/irq.c | 2 | ||||
| -rw-r--r-- | drivers/of/of_reserved_mem.c | 2 | ||||
| -rw-r--r-- | drivers/of/overlay.c | 6 | ||||
| -rw-r--r-- | drivers/of/platform.c | 2 | ||||
| -rw-r--r-- | drivers/of/unittest.c | 8 |
7 files changed, 14 insertions, 14 deletions
diff --git a/drivers/of/address.c b/drivers/of/address.c index 4034d798c55a..cf4aab11e9b1 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -929,7 +929,7 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map) if (!num_ranges) return -EINVAL; - r = kcalloc(num_ranges + 1, sizeof(*r), GFP_KERNEL); + r = kzalloc_objs(*r, num_ranges + 1); if (!r) return -ENOMEM; diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c index 2eaaddcb0ec4..1a06175def37 100644 --- a/drivers/of/dynamic.c +++ b/drivers/of/dynamic.c @@ -411,7 +411,7 @@ struct property *__of_prop_dup(const struct property *prop, gfp_t allocflags) { struct property *new; - new = kzalloc(sizeof(*new), allocflags); + new = kzalloc_obj(*new, allocflags); if (!new) return NULL; @@ -454,7 +454,7 @@ struct device_node *__of_node_dup(const struct device_node *np, { struct device_node *node; - node = kzalloc(sizeof(*node), GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return NULL; node->full_name = kstrdup(full_name, GFP_KERNEL); @@ -908,7 +908,7 @@ int of_changeset_action(struct of_changeset *ocs, unsigned long action, if (WARN_ON(action >= ARRAY_SIZE(action_names))) return -EINVAL; - ce = kzalloc(sizeof(*ce), GFP_KERNEL); + ce = kzalloc_obj(*ce); if (!ce) return -ENOMEM; diff --git a/drivers/of/irq.c b/drivers/of/irq.c index f374d8b212b8..6367c67732d2 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -669,7 +669,7 @@ void __init of_irq_init(const struct of_device_id *matches) * Here, we allocate and populate an of_intc_desc with the node * pointer, interrupt-parent device_node etc. */ - desc = kzalloc(sizeof(*desc), GFP_KERNEL); + desc = kzalloc_obj(*desc); if (!desc) { of_node_put(np); goto err; diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 31c5bc751d0d..1fd28f805610 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -646,7 +646,7 @@ int of_reserved_mem_device_init_by_idx(struct device *dev, if (!rmem || !rmem->ops || !rmem->ops->device_init) return -EINVAL; - rd = kmalloc(sizeof(struct rmem_assigned_device), GFP_KERNEL); + rd = kmalloc_obj(struct rmem_assigned_device); if (!rd) return -ENOMEM; diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 5b4f42230e6c..c1c5686fc7b1 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -248,7 +248,7 @@ static struct property *dup_and_fixup_symbol_prop( return NULL; target_path_len = strlen(target_path); - new_prop = kzalloc(sizeof(*new_prop), GFP_KERNEL); + new_prop = kzalloc_obj(*new_prop); if (!new_prop) goto err_free_target_path; @@ -784,7 +784,7 @@ static int init_overlay_changeset(struct overlay_changeset *ovcs, of_node_put(node); } - fragments = kcalloc(cnt, sizeof(*fragments), GFP_KERNEL); + fragments = kzalloc_objs(*fragments, cnt); if (!fragments) { ret = -ENOMEM; goto err_out; @@ -1009,7 +1009,7 @@ int of_overlay_fdt_apply(const void *overlay_fdt, u32 overlay_fdt_size, if (overlay_fdt_size < size) return -EINVAL; - ovcs = kzalloc(sizeof(*ovcs), GFP_KERNEL); + ovcs = kzalloc_obj(*ovcs); if (!ovcs) return -ENOMEM; diff --git a/drivers/of/platform.c b/drivers/of/platform.c index d90b1677d84e..ba591fbceb56 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -111,7 +111,7 @@ struct platform_device *of_device_alloc(struct device_node *np, /* Populate the resource table */ if (num_reg) { - res = kcalloc(num_reg, sizeof(*res), GFP_KERNEL); + res = kzalloc_objs(*res, num_reg); if (!res) { platform_device_put(dev); return NULL; diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index a9cc2c990562..2940295843e6 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -197,7 +197,7 @@ static void __init of_unittest_dynamic(void) } /* Array of 4 properties for the purpose of testing */ - prop = kcalloc(4, sizeof(*prop), GFP_KERNEL); + prop = kzalloc_objs(*prop, 4); if (!prop) { unittest(0, "kzalloc() failed\n"); return; @@ -379,7 +379,7 @@ static void __init of_unittest_check_phandles(void) } } - nh = kzalloc(sizeof(*nh), GFP_KERNEL); + nh = kzalloc_obj(*nh); if (!nh) return; @@ -1136,7 +1136,7 @@ static void __init of_unittest_dma_ranges_one(const char *path, dma_addr_t dma_addr; struct device *dev_bogus; - dev_bogus = kzalloc(sizeof(struct device), GFP_KERNEL); + dev_bogus = kzalloc_obj(struct device); if (!dev_bogus) { unittest(0, "kzalloc() failed\n"); kfree(map); @@ -2275,7 +2275,7 @@ static int unittest_gpio_probe(struct platform_device *pdev) unittest_gpio_probe_count++; - devptr = kzalloc(sizeof(*devptr), GFP_KERNEL); + devptr = kzalloc_obj(*devptr); if (!devptr) return -ENOMEM; |
