Skip to contentSkip to conversation

mfd: arizona: Remove pointless switch case

PATCH In review Charles Keepax 2 participants 3 messages Jul 22, 2016 – Aug 8, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: arizona: Remove pointless switch case

There is no point in having an explicit case that does nothing but falls through to the default, simply remove the redundant case.

---
 drivers/mfd/arizona-irq.c | 2 --
 1 file changed, 2 deletions(-)
drivers/mfd/arizona-irq.c +0 -2
index 5e18d3c..e54aa55 100644
@@ -286,8 +286,6 @@ int arizona_irq_init(struct arizona *arizona)
 		case IRQF_TRIGGER_RISING:
 		case IRQF_TRIGGER_FALLING:
 			break;
-
-		case IRQ_TYPE_NONE:
 		default:
 			/* Device default */
 			arizona->pdata.irq_flags = IRQF_TRIGGER_LOW;
Signature · 1 line
2.1.4
#1 lore raw

Hi all!

On Fri, 2016-07-22 at 16:58 +0100, Charles Keepax wrote:
[...]

Quoted 6 lines

  case IRQF_TRIGGER_RISING:
  case IRQF_TRIGGER_FALLING:
  break;

drivers/mfd/arizona-irq.c +0 -2
-
-		case IRQ_TYPE_NONE:

  default:

Don't know about the kernels coding rule in that case but personally, I use that style to explicit list all enum/#define values so that it is obvious that none was forgotten.
For the compiler output, it shouldn't matter anyways ...

MfG,
Bernd

Signature · 2 lines
mobile: +43 664 4416156              http://www.sysprog.at/
    Linux Software Development, Consulting and Services
#2 lore raw
Quoted 4 lines · Bernd Petrovitsch

Hi all!

On Fri, 2016-07-22 at 16:58 +0100, Charles Keepax wrote:
[...]

Quoted 12 lines
Quoted 6 lines

  case IRQF_TRIGGER_RISING:
  case IRQF_TRIGGER_FALLING:
  break;

drivers/mfd/arizona-irq.c +0 -2
-
-		case IRQ_TYPE_NONE:

  default:

Don't know about the kernels coding rule in that case but personally, I use that style to explicit list all enum/#define values so that it is obvious that none was forgotten.
For the compiler output, it shouldn't matter anyways ...

I don't have any objection to dropping the patch as you say will generate the same output either way.

Thanks,
Charles