Skip to contentSkip to conversation

Fixes q40_irq_startup to return -ENXIO

PATCH In review Nicholas Krause 3 participants 6 messages Jun 30, 2014 – Jul 1, 2014 m68k architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fixes q40_irq_startup to return -ENXIO

Fixes q40_irq_startup to return -ENXIO for cases 11-13 in the switch statement of this function to handle these failure cases.

---
 arch/m68k/q40/q40ints.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/m68k/q40/q40ints.c +1 -1
index 513f9bb..9dfa1ea 100644
@@ -49,7 +49,7 @@ static unsigned int q40_irq_startup(struct irq_data *data)
 	case 1: case 2: case 8: case 9:
 	case 11: case 12: case 13:
 		printk("%s: ISA IRQ %d not implemented by HW\n", __func__, irq);
-		/* FIXME return -ENXIO; */
+		return -ENXIO;
 	}
 	return 0;
 }
Signature · 1 line
1.9.1
#1 lore raw
Quoted 13 lines · Nicholas Krause

Fixes q40_irq_startup to return -ENXIO for cases 11-13 in the switch statement of this function to handle these failure cases.

---
 arch/m68k/q40/q40ints.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/m68k/q40/q40ints.c +0 -0
index 513f9bb..9dfa1ea 100644

arch/m68k/q40/q40ints.c static unsigned int q40_irq_startup(struct irq_data *data) · line 52

Quoted 5 lines
arch/m68k/q40/q40ints.c +1 -1
@@ -49,7 +49,7 @@ static unsigned int q40_irq_startup(struct irq_data *data)
 	case 1: case 2: case 8: case 9:
 	case 11: case 12: case 13:
 		printk("%s: ISA IRQ %d not implemented by HW\n", __func__, irq);
-		/* FIXME return -ENXIO; */
+		return -ENXIO;

There must be more to it, given the FIXME.

Andreas.

Signature · 3 lines
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#2 lore raw
Quoted 10 lines · Andreas Schwab
Quoted 8 lines · Nicholas Krause

Fixes q40_irq_startup to return -ENXIO for cases 11-13 in the switch statement of this function to handle these failure cases.

---
 arch/m68k/q40/q40ints.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

arch/m68k/q40/q40ints.c static unsigned int q40_irq_startup(struct irq_data *data) · line 52

Quoted 10 lines
arch/m68k/q40/q40ints.c +1 -1
index 513f9bb..9dfa1ea 100644
@@ -49,7 +49,7 @@ static unsigned int q40_irq_startup(struct irq_data *data)
      case 1: case 2: case 8: case 9:
      case 11: case 12: case 13:
              printk("%s: ISA IRQ %d not implemented by HW\n", __func__, irq);
-             /* FIXME return -ENXIO; */
+             return -ENXIO;

There must be more to it, given the FIXME.

I think I really just forgot to get rid of it. It was introduced in commit c288bf2533e57174b90b07860c4391bcd1ea269c ("m68k/irq: Rename irq_controller to irq_chip").

I think I added the FIXME because I got puzzled by the return value change from (signed) int to unsigned int, which doesn't match well with a negative error number.

However:
1. While irq_chip.irq_startup() returns unsigned int, irq_startup()
does return
int (why this difference, historical reasons?), so it becomes a negative number again later,
2. The return value of irq_startup() seems to used in kernel/irq/autoprobe.c:probe_irq_on() only, and the actual (non-zero) value doesn't matter, just whether it returns zero or non-zero.

So I'm gonna take this patch, unless someone screams with a very good reason.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#3 lore raw
In reply to Andreas Schwab
Quoted 10 lines · Andreas Schwab
Quoted 8 lines · Nicholas Krause

Fixes q40_irq_startup to return -ENXIO for cases 11-13 in the switch statement of this function to handle these failure cases.

---
 arch/m68k/q40/q40ints.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

arch/m68k/q40/q40ints.c static unsigned int q40_irq_startup(struct irq_data *data) · line 52

Quoted 10 lines
arch/m68k/q40/q40ints.c +1 -1
index 513f9bb..9dfa1ea 100644
@@ -49,7 +49,7 @@ static unsigned int q40_irq_startup(struct irq_data *data)
      case 1: case 2: case 8: case 9:
      case 11: case 12: case 13:
              printk("%s: ISA IRQ %d not implemented by HW\n", __func__, irq);
-             /* FIXME return -ENXIO; */
+             return -ENXIO;

There must be more to it, given the FIXME.

I think I really just forgot to get rid of it. It was introduced in commit c288bf2533e57174b90b07860c4391bcd1ea269c ("m68k/irq: Rename irq_controller to irq_chip").

I think I added the FIXME because I got puzzled by the return value change from (signed) int to unsigned int, which doesn't match well with a negative error number.

However:
1. While irq_chip.irq_startup() returns unsigned int, irq_startup()
does return
int (why this difference, historical reasons?), so it becomes a negative number again later,
2. The return value of irq_startup() seems to used in kernel/irq/autoprobe.c:probe_irq_on() only, and the actual (non-zero) value doesn't matter, just whether it returns zero or non-zero.

So I'm gonna take this patch, unless someone screams with a very good reason.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#4 lore raw

Seems fair if there is another way of doing it then I will rewrite this patch. Cheers Nick

Quoted 53 lines · Geert Uytterhoeven
Quoted 10 lines · Andreas Schwab
Quoted 8 lines · Nicholas Krause

Fixes q40_irq_startup to return -ENXIO for cases 11-13 in the switch statement of this function to handle these failure cases.

---
 arch/m68k/q40/q40ints.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

arch/m68k/q40/q40ints.c static unsigned int q40_irq_startup(struct irq_data *data) · line 52

Quoted 10 lines
arch/m68k/q40/q40ints.c +1 -1
index 513f9bb..9dfa1ea 100644
@@ -49,7 +49,7 @@ static unsigned int q40_irq_startup(struct irq_data *data)
      case 1: case 2: case 8: case 9:
      case 11: case 12: case 13:
              printk("%s: ISA IRQ %d not implemented by HW\n", __func__, irq);
-             /* FIXME return -ENXIO; */
+             return -ENXIO;

There must be more to it, given the FIXME.

I think I really just forgot to get rid of it. It was introduced in commit c288bf2533e57174b90b07860c4391bcd1ea269c ("m68k/irq: Rename irq_controller to irq_chip").

I think I added the FIXME because I got puzzled by the return value change from (signed) int to unsigned int, which doesn't match well with a negative error number.

However:
1. While irq_chip.irq_startup() returns unsigned int, irq_startup()
does return
int (why this difference, historical reasons?), so it becomes a negative number again later,
2. The return value of irq_startup() seems to used in kernel/irq/autoprobe.c:probe_irq_on() only, and the actual (non-zero) value doesn't matter, just whether it returns zero or non-zero.

So I'm gonna take this patch, unless someone screams with a very good reason.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#5 lore raw
In reply to Geert Uytterhoeven

Seems fair if there is another way of doing it then I will rewrite this patch. Cheers Nick

Quoted 53 lines · Geert Uytterhoeven
Quoted 10 lines · Andreas Schwab
Quoted 8 lines · Nicholas Krause

Fixes q40_irq_startup to return -ENXIO for cases 11-13 in the switch statement of this function to handle these failure cases.

---
 arch/m68k/q40/q40ints.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

arch/m68k/q40/q40ints.c static unsigned int q40_irq_startup(struct irq_data *data) · line 52

Quoted 10 lines
arch/m68k/q40/q40ints.c +1 -1
index 513f9bb..9dfa1ea 100644
@@ -49,7 +49,7 @@ static unsigned int q40_irq_startup(struct irq_data *data)
      case 1: case 2: case 8: case 9:
      case 11: case 12: case 13:
              printk("%s: ISA IRQ %d not implemented by HW\n", __func__, irq);
-             /* FIXME return -ENXIO; */
+             return -ENXIO;

There must be more to it, given the FIXME.

I think I really just forgot to get rid of it. It was introduced in commit c288bf2533e57174b90b07860c4391bcd1ea269c ("m68k/irq: Rename irq_controller to irq_chip").

I think I added the FIXME because I got puzzled by the return value change from (signed) int to unsigned int, which doesn't match well with a negative error number.

However:
1. While irq_chip.irq_startup() returns unsigned int, irq_startup()
does return
int (why this difference, historical reasons?), so it becomes a negative number again later,
2. The return value of irq_startup() seems to used in kernel/irq/autoprobe.c:probe_irq_on() only, and the actual (non-zero) value doesn't matter, just whether it returns zero or non-zero.

So I'm gonna take this patch, unless someone screams with a very good reason.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds