Skip to content

Commit

Permalink
irqchip: crossbar: Fix sparse and checkpatch warnings
Browse files Browse the repository at this point in the history
There is absolutely no need for crossbar driver to expose functions and
variables into global namespace. So make them all static

Also fix a couple of checkpatch warnings.

Fixes sparse warnings:
drivers/irqchip/irq-crossbar.c:129:29: warning: symbol 'routable_irq_domain_ops' was not declared. Should it be static?
drivers/irqchip/irq-crossbar.c:261:12: warning: symbol 'irqcrossbar_init' was not declared. Should it be static?

Checkpatch warnings:
WARNING: Prefer kcalloc over kzalloc with multiply
+	cb->irq_map = kzalloc(max * sizeof(int), GFP_KERNEL);

WARNING: Prefer kcalloc over kzalloc with multiply
+	cb->register_offsets = kzalloc(max * sizeof(int), GFP_KERNEL);

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sricharan R <r.sricharan@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Link: https://lkml.kernel.org/r/1403766634-18543-8-git-send-email-r.sricharan@ti.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
  • Loading branch information
Nishanth Menon authored and Jason Cooper committed Jun 30, 2014
1 parent d4922a9 commit 4dbf45e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/irqchip/irq-crossbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/of_irq.h>
#include <linux/slab.h>
#include <linux/irqchip/arm-gic.h>
#include <linux/irqchip/irq-crossbar.h>

#define IRQ_FREE -1
#define IRQ_RESERVED -2
Expand Down Expand Up @@ -118,7 +119,7 @@ static int crossbar_domain_xlate(struct irq_domain *d,
return 0;
}

const struct irq_domain_ops routable_irq_domain_ops = {
static const struct irq_domain_ops routable_irq_domain_ops = {
.map = crossbar_domain_map,
.unmap = crossbar_domain_unmap,
.xlate = crossbar_domain_xlate
Expand All @@ -139,7 +140,7 @@ static int __init crossbar_of_init(struct device_node *node)
goto err1;

of_property_read_u32(node, "ti,max-irqs", &max);
cb->irq_map = kzalloc(max * sizeof(int), GFP_KERNEL);
cb->irq_map = kcalloc(max, sizeof(int), GFP_KERNEL);
if (!cb->irq_map)
goto err2;

Expand Down Expand Up @@ -184,7 +185,7 @@ static int __init crossbar_of_init(struct device_node *node)
}


cb->register_offsets = kzalloc(max * sizeof(int), GFP_KERNEL);
cb->register_offsets = kcalloc(max, sizeof(int), GFP_KERNEL);
if (!cb->register_offsets)
goto err3;

Expand Down

0 comments on commit 4dbf45e

Please sign in to comment.