Skip to content

Commit

Permalink
sparc: fix sparse warnings in cpu_*.c
Browse files Browse the repository at this point in the history
o declare variables from cpu_*.c
o declare function from cpu_32.c

To do this introduce a new header "kernel.h" which is local to kernel/

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sam Ravnborg authored and David S. Miller committed Dec 7, 2008
1 parent 7e7e93a commit 53ae341
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions arch/sparc/kernel/cpu_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <asm/mbus.h>
#include <asm/cpudata.h>

#include "kernel.h"

DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 };

struct cpu_iu_info {
Expand Down Expand Up @@ -125,8 +127,8 @@ static struct cpu_iu_info linux_sparc_chips[] = {

#define NSPARCCHIPS ARRAY_SIZE(linux_sparc_chips)

char *sparc_cpu_type;
char *sparc_fpu_type;
const char *sparc_cpu_type;
const char *sparc_fpu_type;

unsigned int fsr_storage;

Expand Down
1 change: 1 addition & 0 deletions arch/sparc/kernel/cpu_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <asm/oplib.h>

#include "entry.h"
#include "kernel.h"

DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 };

Expand Down
3 changes: 0 additions & 3 deletions arch/sparc/kernel/entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
#include <linux/types.h>
#include <linux/init.h>

extern const char *sparc_cpu_type;
extern const char *sparc_fpu_type;

extern void __init per_cpu_patch(void);
extern void __init sun4v_patch(void);
extern void __init boot_cpu_id_too_large(int cpu);
Expand Down
8 changes: 8 additions & 0 deletions arch/sparc/kernel/kernel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* cpu.c */
extern const char *sparc_cpu_type;
extern const char *sparc_fpu_type;

extern unsigned int fsr_storage;

extern void cpu_probe(void);

5 changes: 2 additions & 3 deletions arch/sparc/kernel/setup_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
#include <asm/cpudata.h>
#include <asm/setup.h>

#include "kernel.h"

struct screen_info screen_info = {
0, 0, /* orig-x, orig-y */
0, /* unused */
Expand Down Expand Up @@ -308,9 +310,6 @@ void __init setup_arch(char **cmdline_p)
smp_setup_cpu_possible_map();
}

extern char *sparc_cpu_type;
extern char *sparc_fpu_type;

static int ncpus_probed;

static int show_cpuinfo(struct seq_file *m, void *__unused)
Expand Down
1 change: 1 addition & 0 deletions arch/sparc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#endif

#include "entry.h"
#include "kernel.h"

/* Used to synchronize accesses to NatSemi SUPER I/O chip configure
* operations in asm/ns87303.h
Expand Down

0 comments on commit 53ae341

Please sign in to comment.