Patchwork [U-Boot] IDE: fix compiler warnings

login
register
mail settings
Submitter Wolfgang Denk
Date April 30, 2011, 9:32 p.m.
Message ID <1304199175-1638-1-git-send-email-wd@denx.de>
Download mbox | patch
Permalink /patch/93525/
State Accepted
Commit 96d04c3150ae9284500aef48803d7d132968f2b2
Headers show

Comments

Wolfgang Denk - April 30, 2011, 9:32 p.m.
The changes introduced by commit 0abddf8 ``cmd_ide: enhance new
feature "CONFIG_IDE_AHB"'' caused compiler warnings like

cmd_ide.c: In function 'ide_init':
cmd_ide.c:716: warning: assignment from incompatible pointer type

Constify the respective function arguments to fix this.

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 common/cmd_ide.c |    8 ++++----
 include/ide.h    |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
Wolfgang Denk - May 1, 2011, 2:05 p.m.
Dear Wolfgang Denk,

In message <1304199175-1638-1-git-send-email-wd@denx.de> you wrote:
> The changes introduced by commit 0abddf8 ``cmd_ide: enhance new
> feature "CONFIG_IDE_AHB"'' caused compiler warnings like
> 
> cmd_ide.c: In function 'ide_init':
> cmd_ide.c:716: warning: assignment from incompatible pointer type
> 
> Constify the respective function arguments to fix this.
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
>  common/cmd_ide.c |    8 ++++----
>  include/ide.h    |    2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)

Applied.

Best regards,

Wolfgang Denk
Macpaul Lin - May 1, 2011, 4:18 p.m.
Hi Wolfgang,

> The changes introduced by commit 0abddf8 ``cmd_ide: enhance new
> feature "CONFIG_IDE_AHB"'' caused compiler warnings like
>
> cmd_ide.c: In function 'ide_init':
> cmd_ide.c:716: warning: assignment from incompatible pointer type

Thanks!

Patch

diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index e7952ff..21fe1ea 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -160,7 +160,7 @@  static uchar ide_wait  (int dev, ulong t);
 #define IDE_SPIN_UP_TIME_OUT 5000 /* 5 sec spin-up timeout */
 
 static void input_data(int dev, ulong *sect_buf, int words);
-static void output_data(int dev, ulong *sect_buf, int words);
+static void output_data(int dev, const ulong *sect_buf, int words);
 static void ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len);
 
 #ifndef CONFIG_SYS_ATA_PORT_ADDR
@@ -875,7 +875,7 @@  input_swap_data(int dev, ulong *sect_buf, int words)
 
 #if defined(CONFIG_IDE_SWAP_IO)
 static void
-output_data(int dev, ulong *sect_buf, int words)
+output_data(int dev, const ulong *sect_buf, int words)
 {
 #if defined(CONFIG_CPC45)
 	uchar	*dbuf;
@@ -919,7 +919,7 @@  output_data(int dev, ulong *sect_buf, int words)
 }
 #else	/* ! CONFIG_IDE_SWAP_IO */
 static void
-output_data(int dev, ulong *sect_buf, int words)
+output_data(int dev, const ulong *sect_buf, int words)
 {
 #if defined(CONFIG_IDE_AHB)
 	ide_write_data(dev, sect_buf, words);
@@ -1348,7 +1348,7 @@  IDE_READ_E:
 /* ------------------------------------------------------------------------- */
 
 
-ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, void *buffer)
+ulong ide_write (int device, lbaint_t blknr, ulong blkcnt, const void *buffer)
 {
 	ulong n = 0;
 	unsigned char c;
diff --git a/include/ide.h b/include/ide.h
index 80a10f4..8ecc9dd 100644
--- a/include/ide.h
+++ b/include/ide.h
@@ -52,7 +52,7 @@  typedef ulong lbaint_t;
 
 void ide_init(void);
 ulong ide_read(int device, lbaint_t blknr, ulong blkcnt, void *buffer);
-ulong ide_write(int device, lbaint_t blknr, ulong blkcnt, void *buffer);
+ulong ide_write(int device, lbaint_t blknr, ulong blkcnt, const void *buffer);
 
 #if defined(CONFIG_OF_IDE_FIXUP)
 int ide_device_present(int dev);