提交 8ea0de4b 编写于 作者: N Nicolas Pitre 提交者: Nicolas Pitre

ARM: zImage: remove the static qualifier from global data variables

To be able to relocate the .bss section at run time independently from
the rest of the code, we must make sure that no GOTOFF relocations are
used with .bss symbols.  This usually means that no global variables can
be marked static unless they're also const.

Let's remove the static qualifier from current offenders, or turn them
into const variables when possible.  Next commit will ensure the build
fails if one of those is reintroduced due to otherwise enforced coding
standards for the kernel.
Signed-off-by: NNicolas Pitre <nicolas.pitre@linaro.org>
Tested-by: NTony Lindgren <tony@atomide.com>
上级 ccc1c7c6
...@@ -25,8 +25,7 @@ ...@@ -25,8 +25,7 @@
#include <mach/serial.h> #include <mach/serial.h>
static u32 *uart; u32 *uart;
static u32 *uart_info = (u32 *)(DAVINCI_UART_INFO);
/* PORT_16C550A, in polled non-fifo mode */ /* PORT_16C550A, in polled non-fifo mode */
static void putc(char c) static void putc(char c)
...@@ -44,6 +43,8 @@ static inline void flush(void) ...@@ -44,6 +43,8 @@ static inline void flush(void)
static inline void set_uart_info(u32 phys, void * __iomem virt) static inline void set_uart_info(u32 phys, void * __iomem virt)
{ {
u32 *uart_info = (u32 *)(DAVINCI_UART_INFO);
uart = (u32 *)phys; uart = (u32 *)phys;
uart_info[0] = phys; uart_info[0] = phys;
uart_info[1] = (u32)virt; uart_info[1] = (u32)virt;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <linux/serial_reg.h> #include <linux/serial_reg.h>
#include <mach/hardware.h> #include <mach/hardware.h>
static volatile unsigned long *UART = (unsigned long *)GEMINI_UART_BASE; static volatile unsigned long * const UART = (unsigned long *)GEMINI_UART_BASE;
/* /*
* The following code assumes the serial port has already been * The following code assumes the serial port has already been
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <linux/serial_reg.h> #include <linux/serial_reg.h>
#include <mach/hardware.h> #include <mach/hardware.h>
static volatile u8 *uart_base; volatile u8 *uart_base;
#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE) #define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <linux/serial_reg.h> #include <linux/serial_reg.h>
#include <mach/hardware.h> #include <mach/hardware.h>
static volatile u32 *uart_base; volatile u32 *uart_base;
#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE) #define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE) #define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE)
static volatile u32* uart_base; volatile u32* uart_base;
static inline void putc(int c) static inline void putc(int c)
{ {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define UART2_BASE (APB_PHYS_BASE + 0x17000) #define UART2_BASE (APB_PHYS_BASE + 0x17000)
#define UART3_BASE (APB_PHYS_BASE + 0x18000) #define UART3_BASE (APB_PHYS_BASE + 0x18000)
static volatile unsigned long *UART; volatile unsigned long *UART;
static inline void putc(char c) static inline void putc(char c)
{ {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <asm/mach-types.h> #include <asm/mach-types.h>
static unsigned long mxs_duart_base; unsigned long mxs_duart_base;
#define MXS_DUART(x) (*(volatile unsigned long *)(mxs_duart_base + (x))) #define MXS_DUART(x) (*(volatile unsigned long *)(mxs_duart_base + (x)))
......
...@@ -20,7 +20,7 @@ static void putc_dummy(char c, void __iomem *base) ...@@ -20,7 +20,7 @@ static void putc_dummy(char c, void __iomem *base)
/* nothing */ /* nothing */
} }
static int timeout; int timeout;
static void putc_ns9360(char c, void __iomem *base) static void putc_ns9360(char c, void __iomem *base)
{ {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#define arch_decomp_wdog() #define arch_decomp_wdog()
#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE) #define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
static u32 * uart_base = (u32 *)UART0_PA; static u32 * const uart_base = (u32 *)UART0_PA;
static void putc(int ch) static void putc(int ch)
{ {
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
#define BTUART_BASE (0x40200000) #define BTUART_BASE (0x40200000)
#define STUART_BASE (0x40700000) #define STUART_BASE (0x40700000)
static unsigned long uart_base; unsigned long uart_base;
static unsigned int uart_shift; unsigned int uart_shift;
static unsigned int uart_is_pxa; unsigned int uart_is_pxa;
static inline unsigned char uart_read(int offset) static inline unsigned char uart_read(int offset)
{ {
......
...@@ -66,12 +66,12 @@ extern __attribute__((pure)) struct param_struct *params(void); ...@@ -66,12 +66,12 @@ extern __attribute__((pure)) struct param_struct *params(void);
#define params (params()) #define params (params())
#ifndef STANDALONE_DEBUG #ifndef STANDALONE_DEBUG
static unsigned long video_num_cols; unsigned long video_num_cols;
static unsigned long video_num_rows; unsigned long video_num_rows;
static unsigned long video_x; unsigned long video_x;
static unsigned long video_y; unsigned long video_y;
static unsigned char bytes_per_char_v; unsigned char bytes_per_char_v;
static int white; int white;
/* /*
* This does not append a newline * This does not append a newline
......
...@@ -24,8 +24,8 @@ typedef unsigned int upf_t; /* cannot include linux/serial_core.h */ ...@@ -24,8 +24,8 @@ typedef unsigned int upf_t; /* cannot include linux/serial_core.h */
/* uart setup */ /* uart setup */
static unsigned int fifo_mask; unsigned int fifo_mask;
static unsigned int fifo_max; unsigned int fifo_max;
/* forward declerations */ /* forward declerations */
...@@ -43,7 +43,7 @@ static void arch_detect_cpu(void); ...@@ -43,7 +43,7 @@ static void arch_detect_cpu(void);
/* how many bytes we allow into the FIFO at a time in FIFO mode */ /* how many bytes we allow into the FIFO at a time in FIFO mode */
#define FIFO_MAX (14) #define FIFO_MAX (14)
static unsigned long uart_base; unsigned long uart_base;
static __inline__ void get_uart_base(void) static __inline__ void get_uart_base(void)
{ {
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <linux/amba/serial.h> #include <linux/amba/serial.h>
#include <mach/hardware.h> #include <mach/hardware.h>
static u32 ux500_uart_base; u32 ux500_uart_base;
static void putc(const char c) static void putc(const char c)
{ {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#define arch_decomp_wdog() #define arch_decomp_wdog()
#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE) #define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
static volatile u32 * uart_base = (u32 *)UART0_PA; static volatile u32 * const uart_base = (u32 *)UART0_PA;
static void putc(int ch) static void putc(int ch)
{ {
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <asm/mach-types.h> #include <asm/mach-types.h>
static unsigned long uart_base; unsigned long uart_base;
#define UART(x) (*(volatile unsigned long *)(uart_base + (x))) #define UART(x) (*(volatile unsigned long *)(uart_base + (x)))
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
#define MDR1_MODE_MASK 0x07 #define MDR1_MODE_MASK 0x07
static volatile u8 *uart_base; volatile u8 *uart_base;
static int uart_shift; int uart_shift;
/* /*
* Store the DEBUG_LL uart number into memory. * Store the DEBUG_LL uart number into memory.
......
...@@ -18,8 +18,8 @@ typedef unsigned int upf_t; /* cannot include linux/serial_core.h */ ...@@ -18,8 +18,8 @@ typedef unsigned int upf_t; /* cannot include linux/serial_core.h */
/* uart setup */ /* uart setup */
static unsigned int fifo_mask; unsigned int fifo_mask;
static unsigned int fifo_max; unsigned int fifo_max;
/* forward declerations */ /* forward declerations */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册