Skip to content

Commit 4b9de5d

Browse files
demathifMarc Zyngier
authored andcommitted
irqchip/crossbar: Fix incorrect type of register size
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 <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent 90922a2 commit 4b9de5d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/irqchip/irq-crossbar.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static const struct irq_domain_ops crossbar_domain_ops = {
199199
static int __init crossbar_of_init(struct device_node *node)
200200
{
201201
int i, size, reserved = 0;
202-
u32 max = 0, entry;
202+
u32 max = 0, entry, reg_size;
203203
const __be32 *irqsr;
204204
int ret = -ENOMEM;
205205

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

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

281-
switch (size) {
281+
switch (reg_size) {
282282
case 1:
283283
cb->write = crossbar_writeb;
284284
break;
@@ -304,7 +304,7 @@ static int __init crossbar_of_init(struct device_node *node)
304304
continue;
305305

306306
cb->register_offsets[i] = reserved;
307-
reserved += size;
307+
reserved += reg_size;
308308
}
309309

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

0 commit comments

Comments
 (0)