2008-10-24 23:10:47

by Dmitri Vorobiev

[permalink] [raw]
Subject: [PATCH] [MIPS] IP22: Small cleanups

The following functions

disable_local1_irq()
disable_local2_irq()
disable_local3_irq()

are needlessly defined global, so make them static. While at
it, fix a couple of coding style errors in the same file.

Signed-off-by: Dmitri Vorobiev <[email protected]>
---
arch/mips/sgi-ip22/ip22-int.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/mips/sgi-ip22/ip22-int.c b/arch/mips/sgi-ip22/ip22-int.c
index f6d9bf4..5b9b4f3 100644
--- a/arch/mips/sgi-ip22/ip22-int.c
+++ b/arch/mips/sgi-ip22/ip22-int.c
@@ -16,6 +16,7 @@
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
+#include <linux/time.h>

#include <asm/mipsregs.h>
#include <asm/addrspace.h>
@@ -23,7 +24,6 @@
#include <asm/sgi/ioc.h>
#include <asm/sgi/hpc3.h>
#include <asm/sgi/ip22.h>
-#include <asm/time.h>

/* #define DEBUG_SGINT */

@@ -68,7 +68,7 @@ static void enable_local1_irq(unsigned int irq)
sgint->imask1 |= (1 << (irq - SGINT_LOCAL1));
}

-void disable_local1_irq(unsigned int irq)
+static void disable_local1_irq(unsigned int irq)
{
sgint->imask1 &= ~(1 << (irq - SGINT_LOCAL1));
}
@@ -87,7 +87,7 @@ static void enable_local2_irq(unsigned int irq)
sgint->cmeimask0 |= (1 << (irq - SGINT_LOCAL2));
}

-void disable_local2_irq(unsigned int irq)
+static void disable_local2_irq(unsigned int irq)
{
sgint->cmeimask0 &= ~(1 << (irq - SGINT_LOCAL2));
if (!sgint->cmeimask0)
@@ -108,7 +108,7 @@ static void enable_local3_irq(unsigned int irq)
sgint->cmeimask1 |= (1 << (irq - SGINT_LOCAL3));
}

-void disable_local3_irq(unsigned int irq)
+static void disable_local3_irq(unsigned int irq)
{
sgint->cmeimask1 &= ~(1 << (irq - SGINT_LOCAL3));
if (!sgint->cmeimask1)
@@ -344,6 +344,6 @@ void __init arch_init_irq(void)

#ifdef CONFIG_EISA
if (ip22_is_fullhouse()) /* Only Indigo-2 has EISA stuff */
- ip22_eisa_init();
+ ip22_eisa_init();
#endif
}
--
1.5.4.3


2008-10-24 23:10:23

by Dmitri Vorobiev

[permalink] [raw]
Subject: [PATCH] [MIPS] sgi_btns: add license specification

The SGI Volume Button interface driver uses GPL-only symbols
platform_driver_unregister and platform_driver_register, but
lacks license specification. Thus, when compiled as a module,
this driver cannot be installed. This patch fixes this by
adding the MODULE_LICENSE() specification.

Signed-off-by: Dmitri Vorobiev <[email protected]>
---
drivers/input/misc/sgi_btns.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/input/misc/sgi_btns.c b/drivers/input/misc/sgi_btns.c
index ce238f5..be3a15f 100644
--- a/drivers/input/misc/sgi_btns.c
+++ b/drivers/input/misc/sgi_btns.c
@@ -174,5 +174,6 @@ static void __exit sgi_buttons_exit(void)
platform_driver_unregister(&sgi_buttons_driver);
}

+MODULE_LICENSE("GPL");
module_init(sgi_buttons_init);
module_exit(sgi_buttons_exit);
--
1.5.4.3

2008-10-25 14:28:15

by Ralf Baechle

[permalink] [raw]
Subject: Re: [PATCH] [MIPS] IP22: Small cleanups

On Sat, Oct 25, 2008 at 01:46:56AM +0300, Dmitri Vorobiev wrote:

> diff --git a/arch/mips/sgi-ip22/ip22-int.c b/arch/mips/sgi-ip22/ip22-int.c
> index f6d9bf4..5b9b4f3 100644
> --- a/arch/mips/sgi-ip22/ip22-int.c
> +++ b/arch/mips/sgi-ip22/ip22-int.c
> @@ -16,6 +16,7 @@
> #include <linux/sched.h>
> #include <linux/interrupt.h>
> #include <linux/irq.h>
> +#include <linux/time.h>
>
> #include <asm/mipsregs.h>
> #include <asm/addrspace.h>
> @@ -23,7 +24,6 @@
> #include <asm/sgi/ioc.h>
> #include <asm/sgi/hpc3.h>
> #include <asm/sgi/ip22.h>
> -#include <asm/time.h>

<linux/time.h> does not include <asm/time.h>. This sort of stuff happens
if you believe checkpatch.pl. You only got away because the header isn't
needed anyway. I'll apply the patch with this bit dropped.

Ralf

PS: Suspicion breeds confidence. At least in case of checkpatch ;-)

2008-10-25 14:45:25

by Ralf Baechle

[permalink] [raw]
Subject: Re: [PATCH] [MIPS] sgi_btns: add license specification

On Sat, Oct 25, 2008 at 01:46:57AM +0300, Dmitri Vorobiev wrote:

> The SGI Volume Button interface driver uses GPL-only symbols
> platform_driver_unregister and platform_driver_register, but
> lacks license specification. Thus, when compiled as a module,
> this driver cannot be installed. This patch fixes this by
> adding the MODULE_LICENSE() specification.
>
> Signed-off-by: Dmitri Vorobiev <[email protected]>

Patch is correct - but it stumped my nose at another bug.

A platform driver is supposed to be safe if loaded into a kernel for another
machine. With the #ifdef'ed sections of this driver, a crash would be
likely if the module built for IP22 would be loaded into an IP32 kernel or
vice versa.

Ralf