summaryrefslogtreecommitdiffstats
path: root/kernel/irq
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2021-04-05 12:30:51 +0200
committerMarc Zyngier <maz@kernel.org>2021-06-10 14:09:17 +0200
commit426fa316148bccabf48f9c91a13c387ee911eadc (patch)
treed151df34801f562d9778ac9cda63c75b49e71324 /kernel/irq
parentirqdomain: Make normal and nomap irqdomains exclusive (diff)
downloadlinux-426fa316148bccabf48f9c91a13c387ee911eadc.tar.xz
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')
-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;