linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] irqchip: crossbar: Fix incorrect type of register size
@ 2017-03-06 13:41 Franck Demathieu
  2017-03-06 14:56 ` Marc Zyngier
  0 siblings, 1 reply; 3+ messages in thread
From: Franck Demathieu @ 2017-03-06 13:41 UTC (permalink / raw)
  To: tglx, jason, marc.zyngier; +Cc: linux-kernel

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>
---
 drivers/irqchip/irq-crossbar.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-crossbar.c b/drivers/irqchip/irq-crossbar.c
index 05bbf17..1070b7b 100644
--- a/drivers/irqchip/irq-crossbar.c
+++ b/drivers/irqchip/irq-crossbar.c
@@ -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;
 
@@ -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;
@@ -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);
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] irqchip: crossbar: Fix incorrect type of register size
  2017-03-06 13:41 [PATCH] irqchip: crossbar: Fix incorrect type of register size Franck Demathieu
@ 2017-03-06 14:56 ` Marc Zyngier
  2017-03-06 15:52   ` Franck Demathieu
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Zyngier @ 2017-03-06 14:56 UTC (permalink / raw)
  To: Franck Demathieu; +Cc: tglx, jason, linux-kernel

On Mon, Mar 06 2017 at  1:41:06 pm GMT, Franck Demathieu <fdemathieu@gmail.com> wrote:
> 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>

Are you sitting on more of these patches? If so, could you send them as
a series instead of one a week? It would make a lot more sense to merge
them in one go.

Thanks,

	M.
-- 
Jazz is not dead, it just smell funny.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] irqchip: crossbar: Fix incorrect type of register size
  2017-03-06 14:56 ` Marc Zyngier
@ 2017-03-06 15:52   ` Franck Demathieu
  0 siblings, 0 replies; 3+ messages in thread
From: Franck Demathieu @ 2017-03-06 15:52 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: tglx, jason, linux-kernel

On Mon, Mar 06, 2017 at 02:56:14PM +0000, Marc Zyngier wrote:
> On Mon, Mar 06 2017 at  1:41:06 pm GMT, Franck Demathieu <fdemathieu@gmail.com> wrote:
> > 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>
> 
> Are you sitting on more of these patches? If so, could you send them as
> a series instead of one a week? It would make a lot more sense to merge
> them in one go.
> 
> Thanks,
> 
> 	M.
> -- 
> Jazz is not dead, it just smell funny.

irq-crossbar.c is now clean from sparse point-of-view, do not expect
more patches there.

Regards,
F.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-06 16:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-06 13:41 [PATCH] irqchip: crossbar: Fix incorrect type of register size Franck Demathieu
2017-03-06 14:56 ` Marc Zyngier
2017-03-06 15:52   ` Franck Demathieu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).