MIPS: sibyte: Declare the cfe_write() buffer as constant
authorMarkos Chandras <markos.chandras@imgtec.com>
Mon, 17 Jun 2013 13:00:36 +0000 (13:00 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 21 Jun 2013 16:07:02 +0000 (18:07 +0200)
The write() prototype expects a const char * as argument so declare
it as such.

Fixes the following build problem:

arch/mips/sibyte/common/cfe_console.c:23:5: error: passing argument 2 of
'cfe_write' discards 'const' qualifier from pointer target type [-Werror]
arch/mips/sibyte/common/cfe_console.c:34:4: error: passing argument 2 of
'cfe_write' makes pointer from integer without a cast [-Werror]

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Acked-by: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: sibyte-users@bitmover.com
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5485/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/fw/cfe/cfe_api.c
arch/mips/include/asm/fw/cfe/cfe_api.h

index d06dc5a6b8d398ec5e4f6947277af6f589d06376..cf84f01931c53e550b46ec1dec8729f8ae39c780 100644 (file)
@@ -406,12 +406,12 @@ int cfe_setenv(char *name, char *val)
        return xiocb.xiocb_status;
 }
 
-int cfe_write(int handle, unsigned char *buffer, int length)
+int cfe_write(int handle, const char *buffer, int length)
 {
        return cfe_writeblk(handle, 0, buffer, length);
 }
 
-int cfe_writeblk(int handle, s64 offset, unsigned char *buffer, int length)
+int cfe_writeblk(int handle, s64 offset, const char *buffer, int length)
 {
        struct cfe_xiocb xiocb;
 
index 17347551a1b2afd930340f0ea99b973d230594b5..a0ea69e91e2eb78f12ac1c8e4f5e2028697f965d 100644 (file)
@@ -115,8 +115,8 @@ int cfe_read(int handle, unsigned char *buffer, int length);
 int cfe_readblk(int handle, int64_t offset, unsigned char *buffer,
                int length);
 int cfe_setenv(char *name, char *val);
-int cfe_write(int handle, unsigned char *buffer, int length);
-int cfe_writeblk(int handle, int64_t offset, unsigned char *buffer,
+int cfe_write(int handle, const char *buffer, int length);
+int cfe_writeblk(int handle, int64_t offset, const char *buffer,
                 int length);
 
 #endif                         /* CFE_API_H */