aboutsummaryrefslogtreecommitdiff
path: root/board-js2x
diff options
context:
space:
mode:
authorThomas Huth <thuth@linux.vnet.ibm.com>2011-11-28 11:35:08 +0100
committerThomas Huth <thuth@linux.vnet.ibm.com>2011-12-20 17:56:34 +0100
commit33bb95bab24d2dca03ee9e641d0e98d9fbd86fdd (patch)
treeeca73c12131b0765e3dfb9fe33a4df2397e932bd /board-js2x
parentec10f8af354266ba2576cfcc7d0c443a0cdbd7e9 (diff)
downloadSLOF-33bb95bab24d2dca03ee9e641d0e98d9fbd86fdd.zip
SLOF-33bb95bab24d2dca03ee9e641d0e98d9fbd86fdd.tar.gz
SLOF-33bb95bab24d2dca03ee9e641d0e98d9fbd86fdd.tar.bz2
Silenced some compiler warnings that occur when compiling with prototype checks
The compiler flags -Wmissing-prototypes and -Wstrict-prototypes generally help to write code with proper prototypes. This way one can avoid some ugly bugs because it helps to identify functions that do not have prototypes in headers. It also helps to improve performance since local functions then have to be declared "static", so the compiler can do better optimizations. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Diffstat (limited to 'board-js2x')
-rw-r--r--board-js2x/rtas/rtas_board.c10
-rw-r--r--board-js2x/rtas/rtas_flash.c2
-rw-r--r--board-js2x/rtas/rtas_flash.h2
-rw-r--r--board-js2x/rtas/rtas_out.c5
4 files changed, 12 insertions, 7 deletions
diff --git a/board-js2x/rtas/rtas_board.c b/board-js2x/rtas/rtas_board.c
index 9b20566..7f7409d 100644
--- a/board-js2x/rtas/rtas_board.c
+++ b/board-js2x/rtas/rtas_board.c
@@ -20,6 +20,8 @@
#include <hw.h>
void io_init(void);
+short reg_get_flashside(void);
+void rtas_init(void);
typedef struct {
uint64_t r3;
@@ -29,7 +31,7 @@ typedef struct {
volatile slave_t rtas_slave_interface;
-void
+static void
rtas_slave_loop(volatile slave_t * pIface)
{
uint64_t mask = pIface->id;
@@ -39,8 +41,8 @@ rtas_slave_loop(volatile slave_t * pIface)
while (dly--);
}
pIface->id = 0;
- asm(" mr 3,%0 ; mtctr %1 ; bctr "::"r"(pIface->r3), "r"(pIface->addr));
-
+ asm volatile (" mr 3,%0 ; mtctr %1 ; bctr "
+ ::"r"(pIface->r3), "r"(pIface->addr));
}
void
@@ -162,7 +164,7 @@ rtas_get_blade_descr(rtas_args_t * pArgs)
}
// for JS20 cannot read blade descr
-uint32_t
+static uint32_t
dummy_get_blade_descr(uint8_t *dst, uint32_t maxlen, uint32_t *len)
{
// to not have a warning we need to do _something_ with *dst and maxlen...
diff --git a/board-js2x/rtas/rtas_flash.c b/board-js2x/rtas/rtas_flash.c
index 7d93343..189878d 100644
--- a/board-js2x/rtas/rtas_flash.c
+++ b/board-js2x/rtas/rtas_flash.c
@@ -216,7 +216,7 @@ write_flash(unsigned long offset, unsigned char *data)
clr_ci();
}
-void
+static void
write_flash_page(unsigned long offset, unsigned short *data)
{
int i = 0;
diff --git a/board-js2x/rtas/rtas_flash.h b/board-js2x/rtas/rtas_flash.h
index 2f79435..3eec45d 100644
--- a/board-js2x/rtas/rtas_flash.h
+++ b/board-js2x/rtas/rtas_flash.h
@@ -16,3 +16,5 @@
#define FLASH SB_FLASH_adr
#define BUFSIZE 4096
#define FLASH_BLOCK_SIZE 0x20000
+
+void write_flash(unsigned long offset, unsigned char *data);
diff --git a/board-js2x/rtas/rtas_out.c b/board-js2x/rtas/rtas_out.c
index ac2b25d..8da1dd4 100644
--- a/board-js2x/rtas/rtas_out.c
+++ b/board-js2x/rtas/rtas_out.c
@@ -15,6 +15,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
+#include <unistd.h>
#include <rtas.h>
#include <hw.h>
@@ -35,7 +36,7 @@ io_init(void)
}
}
-void
+static void
display_char(char ch)
{
volatile int i = 0;
@@ -52,7 +53,7 @@ display_char(char ch)
}
}
-size_t
+ssize_t
write(int fd __attribute((unused)), const void *buf, size_t cnt)
{
while (cnt--) {