Commit 8ea0de4b authored by Nicolas Pitre's avatar Nicolas Pitre Committed by 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: default avatarNicolas Pitre <nicolas.pitre@linaro.org>
Tested-by: default avatarTony Lindgren <tony@atomide.com>
parent ccc1c7c6
......@@ -25,8 +25,7 @@
#include <mach/serial.h>
static u32 *uart;
static u32 *uart_info = (u32 *)(DAVINCI_UART_INFO);
u32 *uart;
/* PORT_16C550A, in polled non-fifo mode */
static void putc(char c)
......@@ -44,6 +43,8 @@ static inline void flush(void)
static inline void set_uart_info(u32 phys, void * __iomem virt)
{
u32 *uart_info = (u32 *)(DAVINCI_UART_INFO);
uart = (u32 *)phys;
uart_info[0] = phys;
uart_info[1] = (u32)virt;
......
......@@ -16,7 +16,7 @@
#include <linux/serial_reg.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
......
......@@ -7,7 +7,7 @@
#include <linux/serial_reg.h>
#include <mach/hardware.h>
static volatile u8 *uart_base;
volatile u8 *uart_base;
#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
......
......@@ -7,7 +7,7 @@
#include <linux/serial_reg.h>
#include <mach/hardware.h>
static volatile u32 *uart_base;
volatile u32 *uart_base;
#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
......
......@@ -19,7 +19,7 @@
#define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE)
static volatile u32* uart_base;
volatile u32* uart_base;
static inline void putc(int c)
{
......
......@@ -14,7 +14,7 @@
#define UART2_BASE (APB_PHYS_BASE + 0x17000)
#define UART3_BASE (APB_PHYS_BASE + 0x18000)
static volatile unsigned long *UART;
volatile unsigned long *UART;
static inline void putc(char c)
{
......
......@@ -20,7 +20,7 @@
#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)))
......
......@@ -20,7 +20,7 @@ static void putc_dummy(char c, void __iomem *base)
/* nothing */
}
static int timeout;
int timeout;
static void putc_ns9360(char c, void __iomem *base)
{
......
......@@ -27,7 +27,7 @@
#define arch_decomp_wdog()
#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)
{
......
......@@ -16,9 +16,9 @@
#define BTUART_BASE (0x40200000)
#define STUART_BASE (0x40700000)
static unsigned long uart_base;
static unsigned int uart_shift;
static unsigned int uart_is_pxa;
unsigned long uart_base;
unsigned int uart_shift;
unsigned int uart_is_pxa;
static inline unsigned char uart_read(int offset)
{
......
......@@ -66,12 +66,12 @@ extern __attribute__((pure)) struct param_struct *params(void);
#define params (params())
#ifndef STANDALONE_DEBUG
static unsigned long video_num_cols;
static unsigned long video_num_rows;
static unsigned long video_x;
static unsigned long video_y;
static unsigned char bytes_per_char_v;
static int white;
unsigned long video_num_cols;
unsigned long video_num_rows;
unsigned long video_x;
unsigned long video_y;
unsigned char bytes_per_char_v;
int white;
/*
* This does not append a newline
......
......@@ -24,8 +24,8 @@ typedef unsigned int upf_t; /* cannot include linux/serial_core.h */
/* uart setup */
static unsigned int fifo_mask;
static unsigned int fifo_max;
unsigned int fifo_mask;
unsigned int fifo_max;
/* forward declerations */
......@@ -43,7 +43,7 @@ static void arch_detect_cpu(void);
/* how many bytes we allow into the FIFO at a time in FIFO mode */
#define FIFO_MAX (14)
static unsigned long uart_base;
unsigned long uart_base;
static __inline__ void get_uart_base(void)
{
......
......@@ -24,7 +24,7 @@
#include <linux/amba/serial.h>
#include <mach/hardware.h>
static u32 ux500_uart_base;
u32 ux500_uart_base;
static void putc(const char c)
{
......
......@@ -27,7 +27,7 @@
#define arch_decomp_wdog()
#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)
{
......
......@@ -21,7 +21,7 @@
#include <asm/mach-types.h>
static unsigned long uart_base;
unsigned long uart_base;
#define UART(x) (*(volatile unsigned long *)(uart_base + (x)))
......
......@@ -27,8 +27,8 @@
#define MDR1_MODE_MASK 0x07
static volatile u8 *uart_base;
static int uart_shift;
volatile u8 *uart_base;
int uart_shift;
/*
* Store the DEBUG_LL uart number into memory.
......
......@@ -18,8 +18,8 @@ typedef unsigned int upf_t; /* cannot include linux/serial_core.h */
/* uart setup */
static unsigned int fifo_mask;
static unsigned int fifo_max;
unsigned int fifo_mask;
unsigned int fifo_max;
/* forward declerations */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment