summaryrefslogtreecommitdiffstats
path: root/kernel/irq/irqdomain.c
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2021-04-05 11:30:51 +0100
committerMarc Zyngier <maz@kernel.org>2021-06-10 13:09:17 +0100
commit426fa316148bccabf48f9c91a13c387ee911eadc (patch)
treed151df34801f562d9778ac9cda63c75b49e71324 /kernel/irq/irqdomain.c
parent4f86a06e2d6ece5316e4c42fbf946ee22acb30f3 (diff)
downloadlinux-426fa316148bccabf48f9c91a13c387ee911eadc.tar.gz
linux-426fa316148bccabf48f9c91a13c387ee911eadc.tar.bz2
linux-426fa316148bccabf48f9c91a13c387ee911eadc.zip
irqdomain: Use struct_size() helper when allocating irqdomain
Instead of open-coding the size computation of struct irqdomain, use the struct_size() helper instead. This is going to be handy as we change the type of the revmap array. Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'kernel/irq/irqdomain.c')
-rw-r--r--kernel/irq/irqdomain.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index fa94c86e47d4..cdcb1989cd20 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -150,7 +150,7 @@ struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,
(!IS_ENABLED(CONFIG_IRQ_DOMAIN_NOMAP) && direct_max)))
return NULL;
- domain = kzalloc_node(sizeof(*domain) + (sizeof(unsigned int) * size),
+ domain = kzalloc_node(struct_size(domain, revmap, size),
GFP_KERNEL, of_node_to_nid(to_of_node(fwnode)));
if (!domain)
return NULL;