Skip to content

Commit 39b6f3a

Browse files
Markos Chandrasralfbaechle
authored andcommitted
MIPS: sibyte: Declare the cfe_write() buffer as constant
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>
1 parent 0156915 commit 39b6f3a

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎arch/mips/fw/cfe/cfe_api.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,12 +406,12 @@ int cfe_setenv(char *name, char *val)
406406
return xiocb.xiocb_status;
407407
}
408408

409-
int cfe_write(int handle, unsigned char *buffer, int length)
409+
int cfe_write(int handle, const char *buffer, int length)
410410
{
411411
return cfe_writeblk(handle, 0, buffer, length);
412412
}
413413

414-
int cfe_writeblk(int handle, s64 offset, unsigned char *buffer, int length)
414+
int cfe_writeblk(int handle, s64 offset, const char *buffer, int length)
415415
{
416416
struct cfe_xiocb xiocb;
417417

‎arch/mips/include/asm/fw/cfe/cfe_api.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ int cfe_read(int handle, unsigned char *buffer, int length);
115115
int cfe_readblk(int handle, int64_t offset, unsigned char *buffer,
116116
int length);
117117
int cfe_setenv(char *name, char *val);
118-
int cfe_write(int handle, unsigned char *buffer, int length);
119-
int cfe_writeblk(int handle, int64_t offset, unsigned char *buffer,
118+
int cfe_write(int handle, const char *buffer, int length);
119+
int cfe_writeblk(int handle, int64_t offset, const char *buffer,
120120
int length);
121121

122122
#endif /* CFE_API_H */

0 commit comments

Comments
 (0)