Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Declare various variables & functions static

We currently have various variables & functions which are only used
within a single translation unit, but which we don't declare static.
This causes various sparse warnings of the form:

arch/mips/kernel/mips-r2-to-r6-emul.c:49:1: warning: symbol
'mipsr2emustats' was not declared. Should it be static?

arch/mips/kernel/unaligned.c:1381:11: warning: symbol 'reg16to32st'
was not declared. Should it be static?

arch/mips/mm/mmap.c:146:15: warning: symbol 'arch_mmap_rnd' was not
declared. Should it be static?

Fix these & others by declaring various affected variables & functions
static, avoiding the sparse warnings & redundant symbols.

[ralf@linux-mips.org: Add Marcin's build fix.]

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: trivial@kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/17176/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Paul Burton and committed by
Ralf Baechle
b7fc2cc5 7d630e83

+10 -8
+1 -1
arch/mips/kernel/cpu-probe.c
··· 326 326 327 327 __setup("nofpu", fpu_disable); 328 328 329 - int mips_dsp_disabled; 329 + static int mips_dsp_disabled; 330 330 331 331 static int __init dsp_disable(char *s) 332 332 {
+5 -3
arch/mips/kernel/mips-r2-to-r6-emul.c
··· 46 46 #define LL "ll " 47 47 #define SC "sc " 48 48 49 - DEFINE_PER_CPU(struct mips_r2_emulator_stats, mipsr2emustats); 50 - DEFINE_PER_CPU(struct mips_r2_emulator_stats, mipsr2bdemustats); 51 - DEFINE_PER_CPU(struct mips_r2br_emulator_stats, mipsr2bremustats); 49 + #ifdef CONFIG_DEBUG_FS 50 + static DEFINE_PER_CPU(struct mips_r2_emulator_stats, mipsr2emustats); 51 + static DEFINE_PER_CPU(struct mips_r2_emulator_stats, mipsr2bdemustats); 52 + static DEFINE_PER_CPU(struct mips_r2br_emulator_stats, mipsr2bremustats); 53 + #endif 52 54 53 55 extern const unsigned int fpucondbit[8]; 54 56
+1 -1
arch/mips/kernel/pm-cps.c
··· 49 49 nc_asm_enter); 50 50 51 51 /* Bitmap indicating which states are supported by the system */ 52 - DECLARE_BITMAP(state_support, CPS_PM_STATE_COUNT); 52 + static DECLARE_BITMAP(state_support, CPS_PM_STATE_COUNT); 53 53 54 54 /* 55 55 * Indicates the number of coupled VPEs ready to operate in a non-coherent
+1 -1
arch/mips/kernel/unaligned.c
··· 1378 1378 const int reg16to32[] = { 16, 17, 2, 3, 4, 5, 6, 7 }; 1379 1379 1380 1380 /* Recode table from 16-bit STORE register notation to 32-bit GPR. */ 1381 - const int reg16to32st[] = { 0, 17, 2, 3, 4, 5, 6, 7 }; 1381 + static const int reg16to32st[] = { 0, 17, 2, 3, 4, 5, 6, 7 }; 1382 1382 1383 1383 static void emulate_load_store_microMIPS(struct pt_regs *regs, 1384 1384 void __user *addr)
+2 -2
arch/mips/mm/dma-default.c
··· 373 373 } 374 374 } 375 375 376 - int mips_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) 376 + static int mips_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) 377 377 { 378 378 return 0; 379 379 } 380 380 381 - int mips_dma_supported(struct device *dev, u64 mask) 381 + static int mips_dma_supported(struct device *dev, u64 mask) 382 382 { 383 383 return plat_dma_supported(dev, mask); 384 384 }