Patchwork [U-Boot,05/12] microblaze: intc: Coding style cleanup

login
register
mail settings
Submitter Michal Simek
Date July 9, 2012, 9:20 a.m.
Message ID <1341825639-23475-5-git-send-email-monstr@monstr.eu>
Download mbox | patch
Permalink /patch/169722/
State Accepted
Commit 26e6da854e70be8e3fb0dab7bbe41119b701ebe1
Headers show

Comments

Michal Simek - July 9, 2012, 9:20 a.m.
Just coding style cleanup.
Remove unneeded externs.

Signed-off-by: Michal Simek <monstr@monstr.eu>
---
 arch/microblaze/cpu/interrupts.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)
Simon Glass - July 9, 2012, 9:23 p.m.
On Mon, Jul 9, 2012 at 2:20 AM, Michal Simek <monstr@monstr.eu> wrote:

> Just coding style cleanup.
> Remove unneeded externs.
>
> Signed-off-by: Michal Simek <monstr@monstr.eu>
>

Acked-by: Simon Glass <sjg@chromium.org>


> ---
>  arch/microblaze/cpu/interrupts.c |   26 +++++++++++++-------------
>  1 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/arch/microblaze/cpu/interrupts.c
> b/arch/microblaze/cpu/interrupts.c
> index 871cefb..79ee96a 100644
> --- a/arch/microblaze/cpu/interrupts.c
> +++ b/arch/microblaze/cpu/interrupts.c
> @@ -32,15 +32,12 @@
>
>  #undef DEBUG_INT
>
> -extern void microblaze_disable_interrupts (void);
> -extern void microblaze_enable_interrupts (void);
> -
> -void enable_interrupts (void)
> +void enable_interrupts(void)
>  {
>         MSRSET(0x2);
>  }
>
> -int disable_interrupts (void)
> +int disable_interrupts(void)
>  {
>         unsigned int msr;
>
> @@ -58,20 +55,21 @@ microblaze_intc_t *intc;
>  /* default handler */
>  static void def_hdlr(void)
>  {
> -       puts ("def_hdlr\n");
> +       puts("def_hdlr\n");
>  }
>
>  static void enable_one_interrupt(int irq)
>  {
>         int mask;
>         int offset = 1;
> +
>         offset <<= irq;
>         mask = intc->ier;
>         intc->ier = (mask | offset);
>  #ifdef DEBUG_INT
> -       printf ("Enable one interrupt irq %x - mask %x,ier %x\n", offset,
> mask,
> +       printf("Enable one interrupt irq %x - mask %x,ier %x\n", offset,
> mask,
>                 intc->ier);
> -       printf ("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr,
> intc->ier,
> +       printf("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr,
> intc->ier,
>                 intc->iar, intc->mer);
>  #endif
>  }
> @@ -80,13 +78,14 @@ static void disable_one_interrupt(int irq)
>  {
>         int mask;
>         int offset = 1;
> +
>         offset <<= irq;
>         mask = intc->ier;
>         intc->ier = (mask & ~offset);
>  #ifdef DEBUG_INT
> -       printf ("Disable one interrupt irq %x - mask %x,ier %x\n", irq,
> mask,
> +       printf("Disable one interrupt irq %x - mask %x,ier %x\n", irq,
> mask,
>                 intc->ier);
> -       printf ("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr,
> intc->ier,
> +       printf("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr,
> intc->ier,
>                 intc->iar, intc->mer);
>  #endif
>  }
> @@ -95,9 +94,10 @@ static void disable_one_interrupt(int irq)
>  int install_interrupt_handler(int irq, interrupt_handler_t *hdlr, void
> *arg)
>  {
>         struct irq_action *act;
> +
>         /* irq out of range */
>         if ((irq < 0) || (irq > irq_no)) {
> -               puts ("IRQ out of range\n");
> +               puts("IRQ out of range\n");
>                 return -1;
>         }
>         act = &vecs[irq];
> @@ -125,7 +125,7 @@ static void intc_init(void)
>         /* XIntc_Start - hw_interrupt enable and all interrupt enable */
>         intc->mer = 0x3;
>  #ifdef DEBUG_INT
> -       printf ("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr,
> intc->ier,
> +       printf("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr,
> intc->ier,
>                 intc->iar, intc->mer);
>  #endif
>  }
> @@ -160,7 +160,7 @@ int interrupts_init(void)
>         return 0;
>  }
>
> -void interrupt_handler (void)
> +void interrupt_handler(void)
>  {
>         int irqs = intc->ivr;   /* find active interrupt */
>         int mask = 1;
> --
> 1.7.0.4
>
>
Michal Simek - July 10, 2012, 8:55 a.m.
On 07/09/2012 11:23 PM, Simon Glass wrote:
> On Mon, Jul 9, 2012 at 2:20 AM, Michal Simek <monstr@monstr.eu <mailto:monstr@monstr.eu>> wrote:
>
>     Just coding style cleanup.
>     Remove unneeded externs.
>
>     Signed-off-by: Michal Simek <monstr@monstr.eu <mailto:monstr@monstr.eu>>
>
>
> Acked-by: Simon Glass <sjg@chromium.org <mailto:sjg@chromium.org>>
>

It depends on previous patch that's why I will send it in v2 package.

Thanks,
Michal

Patch

diff --git a/arch/microblaze/cpu/interrupts.c b/arch/microblaze/cpu/interrupts.c
index 871cefb..79ee96a 100644
--- a/arch/microblaze/cpu/interrupts.c
+++ b/arch/microblaze/cpu/interrupts.c
@@ -32,15 +32,12 @@ 
 
 #undef DEBUG_INT
 
-extern void microblaze_disable_interrupts (void);
-extern void microblaze_enable_interrupts (void);
-
-void enable_interrupts (void)
+void enable_interrupts(void)
 {
 	MSRSET(0x2);
 }
 
-int disable_interrupts (void)
+int disable_interrupts(void)
 {
 	unsigned int msr;
 
@@ -58,20 +55,21 @@  microblaze_intc_t *intc;
 /* default handler */
 static void def_hdlr(void)
 {
-	puts ("def_hdlr\n");
+	puts("def_hdlr\n");
 }
 
 static void enable_one_interrupt(int irq)
 {
 	int mask;
 	int offset = 1;
+
 	offset <<= irq;
 	mask = intc->ier;
 	intc->ier = (mask | offset);
 #ifdef DEBUG_INT
-	printf ("Enable one interrupt irq %x - mask %x,ier %x\n", offset, mask,
+	printf("Enable one interrupt irq %x - mask %x,ier %x\n", offset, mask,
 		intc->ier);
-	printf ("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
+	printf("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
 		intc->iar, intc->mer);
 #endif
 }
@@ -80,13 +78,14 @@  static void disable_one_interrupt(int irq)
 {
 	int mask;
 	int offset = 1;
+
 	offset <<= irq;
 	mask = intc->ier;
 	intc->ier = (mask & ~offset);
 #ifdef DEBUG_INT
-	printf ("Disable one interrupt irq %x - mask %x,ier %x\n", irq, mask,
+	printf("Disable one interrupt irq %x - mask %x,ier %x\n", irq, mask,
 		intc->ier);
-	printf ("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
+	printf("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
 		intc->iar, intc->mer);
 #endif
 }
@@ -95,9 +94,10 @@  static void disable_one_interrupt(int irq)
 int install_interrupt_handler(int irq, interrupt_handler_t *hdlr, void *arg)
 {
 	struct irq_action *act;
+
 	/* irq out of range */
 	if ((irq < 0) || (irq > irq_no)) {
-		puts ("IRQ out of range\n");
+		puts("IRQ out of range\n");
 		return -1;
 	}
 	act = &vecs[irq];
@@ -125,7 +125,7 @@  static void intc_init(void)
 	/* XIntc_Start - hw_interrupt enable and all interrupt enable */
 	intc->mer = 0x3;
 #ifdef DEBUG_INT
-	printf ("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
+	printf("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
 		intc->iar, intc->mer);
 #endif
 }
@@ -160,7 +160,7 @@  int interrupts_init(void)
 	return 0;
 }
 
-void interrupt_handler (void)
+void interrupt_handler(void)
 {
 	int irqs = intc->ivr;	/* find active interrupt */
 	int mask = 1;