File use-irq_noref-in-code.patch of Package irqbalance.2192
From: Yong Yang <yangoliver@gmail.com>
Subject: Use IRQ_NODEF instead of -1 in code
References: bsc#949276
Patch-Mainline: v1.0.9
Git-commit: a41974c6fd9b84a1017620f289d89cc4ac6e8f7e
Git-repo: github.com/Irqbalance/irqbalance.git
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Yong Yang <yangoliver@gmail.com>
Index: irqbalance-1.0.7/classify.c
===================================================================
--- irqbalance-1.0.7.orig/classify.c 2016-04-06 12:22:41.253892580 +0200
+++ irqbalance-1.0.7/classify.c 2016-04-06 12:22:41.985934120 +0200
@@ -45,12 +45,12 @@ static int get_pci_irq_class(int pci_cla
{
int major = pci_class >> 16;
int sub = (pci_class & 0xFF00) >> 8;
- short irq_class = IRQ_OTHER;
+ short irq_class = IRQ_NODEF;
/*
* Class codes lifted from pci spec, appendix D.
* and mapped to irqbalance types here.
*
- * -1 indicates that needs PCI sub-class code.
+ * IRQ_NODEF will go through classification by PCI sub-class code.
*/
static short major_class_codes[PCI_MAX_CLASS] = {
IRQ_OTHER,
@@ -65,7 +65,7 @@ static int get_pci_irq_class(int pci_cla
IRQ_LEGACY,
IRQ_OTHER,
IRQ_OTHER,
- -1,
+ IRQ_NODEF,
IRQ_ETH,
IRQ_SCSI,
IRQ_OTHER,
@@ -95,12 +95,12 @@ static int get_pci_irq_class(int pci_cla
*/
if (major >= PCI_MAX_CLASS)
- return -1;
+ return IRQ_NODEF;
switch (major) {
case 0xc: /* Serial bus class */
if (sub >= PCI_MAX_SERIAL_SUBCLASS)
- return -1;
+ return IRQ_NODEF;
irq_class = serial_sub_codes[sub];
break;
default: /* All other PCI classes */
Index: irqbalance-1.0.7/types.h
===================================================================
--- irqbalance-1.0.7.orig/types.h 2016-04-06 12:22:39.657801999 +0200
+++ irqbalance-1.0.7/types.h 2016-04-06 12:22:41.989934324 +0200
@@ -13,6 +13,7 @@
/*
* IRQ Classes
*/
+#define IRQ_NODEF -1
#define IRQ_OTHER 0
#define IRQ_LEGACY 1
#define IRQ_SCSI 2