public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] genirq: fix unnecessary automatic type conversion
@ 2015-05-03  8:48 Nicholas Mc Guire
  2015-05-05  8:49 ` [tip:irq/core] genirq: Fix " tip-bot for Nicholas Mc Guire
  0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Mc Guire @ 2015-05-03  8:48 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: linux-kernel, Nicholas Mc Guire

kstat_irqs is unsigned int and the return type of kstat_irqs() is also
unsigned int so sum should be unsigned int as well even if the result
is correct due to automatic type conversion.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

This also helps make static code checkers happy.

Patch was compile tested with x86_64_defconfig

Patch is against 4.1-rc1 (localversion-next is -next-20150501)

 kernel/irq/irqdesc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 996ab1c..73a76e2 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -619,7 +619,7 @@ unsigned int kstat_irqs(unsigned int irq)
 {
 	struct irq_desc *desc = irq_to_desc(irq);
 	int cpu;
-	int sum = 0;
+	unsigned int sum = 0;
 
 	if (!desc || !desc->kstat_irqs)
 		return 0;
-- 
1.7.10.4


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

end of thread, other threads:[~2015-05-05  8:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-03  8:48 [PATCH] genirq: fix unnecessary automatic type conversion Nicholas Mc Guire
2015-05-05  8:49 ` [tip:irq/core] genirq: Fix " tip-bot for Nicholas Mc Guire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox