Skip to contentSkip to conversation

scsi: Correct types of scsi_read/write()

PATCH In review Simon Glass 2 participants 2 messages Jul 3, 2013 – Jul 16, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: Correct types of scsi_read/write()

The block device expects to see lbaint_t for the blknr parameter. Change the SCSI read/write functions to suit.

This fixes the following build warnings for coreboot:

cmd_scsi.c: In function ?scsi_scan?:
cmd_scsi.c:119:30: error: assignment from incompatible pointer type [-Werror] cmd_scsi.c:120:32: error: assignment from incompatible pointer type [-Werror]

---
 common/cmd_scsi.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
common/cmd_scsi.c +6 -4
index 294d9f5..3b59944 100644
@@ -82,8 +82,9 @@ void scsi_ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len);
 
 static int scsi_read_capacity(ccb *pccb, lbaint_t *capacity,
 			      unsigned long *blksz);
-static ulong scsi_read(int device, ulong blknr, lbaint_t blkcnt, void *buffer);
-static ulong scsi_write(int device, ulong blknr,
+static ulong scsi_read(int device, lbaint_t blknr, lbaint_t blkcnt,
+		       void *buffer);
+static ulong scsi_write(int device, lbaint_t blknr,
 			lbaint_t blkcnt, const void *buffer);
 
 
@@ -372,7 +373,8 @@ int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #define SCSI_MAX_READ_BLK 0xFFFF /* almost the maximum amount of the scsi_ext command.. */
 
-static ulong scsi_read(int device, ulong blknr, lbaint_t blkcnt, void *buffer)
+static ulong scsi_read(int device, lbaint_t blknr, lbaint_t blkcnt,
+		       void *buffer)
 {
 	lbaint_t start, blks;
 	uintptr_t buf_addr;
@@ -427,7 +429,7 @@ static ulong scsi_read(int device, ulong blknr, lbaint_t blkcnt, void *buffer)
 /* Almost the maximum amount of the scsi_ext command.. */
 #define SCSI_MAX_WRITE_BLK 0xFFFF
 
-static ulong scsi_write(int device, ulong blknr,
+static ulong scsi_write(int device, lbaint_t blknr,
 			lbaint_t blkcnt, const void *buffer)
 {
 	lbaint_t start, blks;
Signature · 1 line
1.8.3
#1 lore raw
Quoted 10 lines · Simon Glass

The block device expects to see lbaint_t for the blknr parameter. Change the SCSI read/write functions to suit.

This fixes the following build warnings for coreboot:

cmd_scsi.c: In function ???scsi_scan???:
cmd_scsi.c:119:30: error: assignment from incompatible pointer type [-Werror] cmd_scsi.c:120:32: error: assignment from incompatible pointer type [-Werror]

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130716/364ea09b/attachment.pgp>