2008-07-15 16:57:44

by Dmitri Vorobiev

[permalink] [raw]
Subject: [MIPS] Another small series of cleanups

Hi Ralf,

Following is some janitorial stuff again. Please consider.

Thanks,
Dmitri Vorobiev


2008-07-15 16:58:42

by Dmitri Vorobiev

[permalink] [raw]
Subject: [PATCH 3/3] [MIPS] add missing prototypes to asm/page.h

This patch fixes the following sparse warnings:

>>>>>>>>>>>>>>>>>>
arch/mips/mm/page.c:284:16: warning: symbol
'build_clear_page' was not declared. Should it be static?

arch/mips/mm/page.c:426:16: warning: symbol 'build_copy_page'
was not declared. Should it be static?
>>>>>>>>>>>>>>>>>>

The fix is to add appropriate prototypes to the header
include/asm-mips/page.h.

Build-tested against Malta defconfig.

Signed-off-by: Dmitri Vorobiev <[email protected]>
---
include/asm-mips/page.h | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 8735aa0..494f00b 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -34,6 +34,9 @@
#include <linux/pfn.h>
#include <asm/io.h>

+extern void build_clear_page(void);
+extern void build_copy_page(void);
+
/*
* It's normally defined only for FLATMEM config but it's
* used in our early mem init code for all memory models.
--
1.5.6

2008-07-15 16:57:58

by Dmitri Vorobiev

[permalink] [raw]
Subject: [PATCH 1/3] [MIPS] make the pcibios_max_latency variable static

The pcibios_max_latency variable is needlessly defined global,
and this patch makes it static.

Build-tested using malta_defconfig.

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

diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 358ad62..0187b8c 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -205,7 +205,7 @@ static int pcibios_enable_resources(struct pci_dev *dev, int mask)
* If we set up a device for bus mastering, we need to check the latency
* timer as certain crappy BIOSes forget to set it properly.
*/
-unsigned int pcibios_max_latency = 255;
+static unsigned int pcibios_max_latency = 255;

void pcibios_set_master(struct pci_dev *dev)
{
--
1.5.6

2008-07-15 16:58:24

by Dmitri Vorobiev

[permalink] [raw]
Subject: [PATCH 2/3] [MIPS] fix missing prototypes in asm/fpu.h

While building the Malta defconfig, sparse spat the following
warnings:

>>>>>>>>>>>>>>>>>>
arch/mips/math-emu/kernel_linkage.c:31:6: warning: symbol
'fpu_emulator_init_fpu' was not declared. Should it be static?

arch/mips/math-emu/kernel_linkage.c:54:5: warning: symbol
'fpu_emulator_save_context' was not declared. Should it be
static?

arch/mips/math-emu/kernel_linkage.c:68:5: warning: symbol
'fpu_emulator_restore_context' was not declared. Should it be
static?
>>>>>>>>>>>>>>>>>>

This patch fixes these errors by adding the proper prototypes
to the include/asm-mips/fpu.h header, and actually using this
header in the sparse-spotted source file.

Build-tested with Malta defconfig.

Signed-off-by: Dmitri Vorobiev <[email protected]>
---
arch/mips/math-emu/kernel_linkage.c | 1 +
include/asm-mips/fpu.h | 2 ++
2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/mips/math-emu/kernel_linkage.c b/arch/mips/math-emu/kernel_linkage.c
index ed49ef0..52e6c58 100644
--- a/arch/mips/math-emu/kernel_linkage.c
+++ b/arch/mips/math-emu/kernel_linkage.c
@@ -24,6 +24,7 @@
#include <asm/signal.h>
#include <asm/uaccess.h>

+#include <asm/fpu.h>
#include <asm/fpu_emulator.h>

#define SIGNALLING_NAN 0x7ff800007ff80000LL
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h
index e59d4c0..8a3ef24 100644
--- a/include/asm-mips/fpu.h
+++ b/include/asm-mips/fpu.h
@@ -35,6 +35,8 @@ extern asmlinkage int (*save_fp_context32)(struct sigcontext32 __user *sc);
extern asmlinkage int (*restore_fp_context32)(struct sigcontext32 __user *sc);

extern void fpu_emulator_init_fpu(void);
+extern int fpu_emulator_save_context(struct sigcontext __user *sc);
+extern int fpu_emulator_restore_context(struct sigcontext __user *sc);
extern void _init_fpu(void);
extern void _save_fp(struct task_struct *);
extern void _restore_fp(struct task_struct *);
--
1.5.6

2008-07-16 08:01:59

by Dmitri Vorobiev

[permalink] [raw]
Subject: [PATCH 1/3 part 2] [MIPS] make the pcibios_max_latency variable static

Along with making the pcibios_max_latency variable static,
its declaration needs to be removed from the header file.

Signed-off-by: Dmitri Vorobiev <[email protected]>
---

Hi Ralf,

Forgot about this one yesterday, sorry.

Dmitri

include/asm-mips/pci.h | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
index d3be834..c205875 100644
--- a/include/asm-mips/pci.h
+++ b/include/asm-mips/pci.h
@@ -173,6 +173,5 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
}

extern int pci_probe_only;
-extern unsigned int pcibios_max_latency;

#endif /* _ASM_PCI_H */
--
1.5.6

2008-07-16 08:43:25

by Ralf Baechle

[permalink] [raw]
Subject: Re: [PATCH 1/3 part 2] [MIPS] make the pcibios_max_latency variable static

On Wed, Jul 16, 2008 at 11:01:49AM +0300, Dmitri Vorobiev wrote:

> Along with making the pcibios_max_latency variable static,
> its declaration needs to be removed from the header file.
>
> Signed-off-by: Dmitri Vorobiev <[email protected]>
> ---
>
> Hi Ralf,
>
> Forgot about this one yesterday, sorry.

No big deal, lmo's internet connection was down for part of the afternoon
so I wasn't doing as much patch stuff as I was hoping to ...

I folded part 2 into part 1 of your patch and applied the result.

Thanks,

Ralf

2008-07-16 08:45:03

by Dmitri Vorobiev

[permalink] [raw]
Subject: Re: [PATCH 1/3 part 2] [MIPS] make the pcibios_max_latency variable static

Ralf Baechle wrote:
> On Wed, Jul 16, 2008 at 11:01:49AM +0300, Dmitri Vorobiev wrote:
>
>> Along with making the pcibios_max_latency variable static,
>> its declaration needs to be removed from the header file.
>>
>> Signed-off-by: Dmitri Vorobiev <[email protected]>
>> ---
>>
>> Hi Ralf,
>>
>> Forgot about this one yesterday, sorry.
>
> No big deal, lmo's internet connection was down for part of the afternoon
> so I wasn't doing as much patch stuff as I was hoping to ...
>
> I folded part 2 into part 1 of your patch and applied the result.

Thank you, Ralf.

Regards,
Dmitri

>
> Thanks,
>
> Ralf
>

2008-07-16 08:45:37

by Ralf Baechle

[permalink] [raw]
Subject: Re: [PATCH 2/3] [MIPS] fix missing prototypes in asm/fpu.h

On Tue, Jul 15, 2008 at 07:57:31PM +0300, Dmitri Vorobiev wrote:

> While building the Malta defconfig, sparse spat the following
> warnings:
>
> >>>>>>>>>>>>>>>>>>
> arch/mips/math-emu/kernel_linkage.c:31:6: warning: symbol
> 'fpu_emulator_init_fpu' was not declared. Should it be static?
>
> arch/mips/math-emu/kernel_linkage.c:54:5: warning: symbol
> 'fpu_emulator_save_context' was not declared. Should it be
> static?
>
> arch/mips/math-emu/kernel_linkage.c:68:5: warning: symbol
> 'fpu_emulator_restore_context' was not declared. Should it be
> static?
> >>>>>>>>>>>>>>>>>>
>
> This patch fixes these errors by adding the proper prototypes
> to the include/asm-mips/fpu.h header, and actually using this
> header in the sparse-spotted source file.

I'm not terribly fond of exporting these private prototypes by making
their prototypes widely available. I see it's need to make sparse a more
productive tool, so I applied the patch though.

Thanks,

Ralf

2008-07-16 08:46:19

by Ralf Baechle

[permalink] [raw]
Subject: Re: [PATCH 3/3] [MIPS] add missing prototypes to asm/page.h

On Tue, Jul 15, 2008 at 07:57:32PM +0300, Dmitri Vorobiev wrote:

> This patch fixes the following sparse warnings:
>
> >>>>>>>>>>>>>>>>>>
> arch/mips/mm/page.c:284:16: warning: symbol
> 'build_clear_page' was not declared. Should it be static?
>
> arch/mips/mm/page.c:426:16: warning: symbol 'build_copy_page'
> was not declared. Should it be static?
> >>>>>>>>>>>>>>>>>>
>
> The fix is to add appropriate prototypes to the header
> include/asm-mips/page.h.

Same comment as for 2/3 applies. Patch applied. Thanks,

Ralf