Skip to content

Commit

Permalink
irqchip/crossbar: Fix incorrect type of register size
Browse files Browse the repository at this point in the history
The 'size' variable is unsigned according to the dt-bindings.
As this variable is used as integer in other places, create a new variable
that allows to fix the following sparse issue (-Wtypesign):

  drivers/irqchip/irq-crossbar.c:279:52: warning: incorrect type in argument 3 (different signedness)
  drivers/irqchip/irq-crossbar.c:279:52:    expected unsigned int [usertype] *out_value
  drivers/irqchip/irq-crossbar.c:279:52:    got int *<noident>

Signed-off-by: Franck Demathieu <fdemathieu@gmail.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
  • Loading branch information
demathif authored and Marc Zyngier committed Mar 7, 2017
1 parent 90922a2 commit 4b9de5d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/irqchip/irq-crossbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ static const struct irq_domain_ops crossbar_domain_ops = {
static int __init crossbar_of_init(struct device_node *node)
{
int i, size, reserved = 0;
u32 max = 0, entry;
u32 max = 0, entry, reg_size;
const __be32 *irqsr;
int ret = -ENOMEM;

Expand Down Expand Up @@ -276,9 +276,9 @@ static int __init crossbar_of_init(struct device_node *node)
if (!cb->register_offsets)
goto err_irq_map;

of_property_read_u32(node, "ti,reg-size", &size);
of_property_read_u32(node, "ti,reg-size", &reg_size);

switch (size) {
switch (reg_size) {
case 1:
cb->write = crossbar_writeb;
break;
Expand All @@ -304,7 +304,7 @@ static int __init crossbar_of_init(struct device_node *node)
continue;

cb->register_offsets[i] = reserved;
reserved += size;
reserved += reg_size;
}

of_property_read_u32(node, "ti,irqs-safe-map", &cb->safe_map);
Expand Down

0 comments on commit 4b9de5d

Please sign in to comment.