Patchwork [U-Boot,2/3] cmd_scsi: use lbaint_t for LBA values instead of u32

login
register
mail settings
Submitter Mark Langsdorf
Date Sept. 10, 2013, 8:19 p.m.
Message ID <1378844357-15389-3-git-send-email-mark.langsdorf@calxeda.com>
Download mbox | patch
Permalink /patch/274039/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Mark Langsdorf - Sept. 10, 2013, 8:19 p.m.
The lbaint_t type exists, and should be used in preference to unsigned long,
which may not be correct when support lba48 compatible drives.

Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
---
 common/cmd_scsi.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Patch

diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
index bbaed41..f5ab14f 100644
--- a/common/cmd_scsi.c
+++ b/common/cmd_scsi.c
@@ -53,10 +53,10 @@  static block_dev_desc_t scsi_dev_desc[CONFIG_SYS_SCSI_MAX_DEVICE];
  *  forward declerations of some Setup Routines
  */
 void scsi_setup_test_unit_ready(ccb * pccb);
-void scsi_setup_read6(ccb * pccb, unsigned long start, unsigned short blocks);
-void scsi_setup_read_ext(ccb * pccb, unsigned long start, unsigned short blocks);
-static void scsi_setup_write_ext(ccb *pccb, unsigned long start,
-			  unsigned short blocks);
+void scsi_setup_read6(ccb * pccb, lbaint_t start, unsigned short blocks);
+void scsi_setup_read_ext(ccb * pccb, lbaint_t start, unsigned short blocks);
+static void scsi_setup_write_ext(ccb *pccb, lbaint_t start,
+				unsigned short blocks);
 void scsi_setup_inquiry(ccb * pccb);
 void scsi_ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len);
 
@@ -583,7 +583,7 @@  void scsi_setup_test_unit_ready(ccb * pccb)
 	pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */
 }
 
-void scsi_setup_read_ext(ccb * pccb, unsigned long start, unsigned short blocks)
+void scsi_setup_read_ext(ccb * pccb, lbaint_t start, unsigned short blocks)
 {
 	pccb->cmd[0] = SCSI_READ10;
 	pccb->cmd[1] = pccb->lun << 5;
@@ -604,7 +604,7 @@  void scsi_setup_read_ext(ccb * pccb, unsigned long start, unsigned short blocks)
 		pccb->cmd[7], pccb->cmd[8]);
 }
 
-void scsi_setup_write_ext(ccb *pccb, unsigned long start, unsigned short blocks)
+void scsi_setup_write_ext(ccb *pccb, lbaint_t start, unsigned short blocks)
 {
 	pccb->cmd[0] = SCSI_WRITE10;
 	pccb->cmd[1] = pccb->lun << 5;
@@ -626,7 +626,7 @@  void scsi_setup_write_ext(ccb *pccb, unsigned long start, unsigned short blocks)
 	      pccb->cmd[7], pccb->cmd[8]);
 }
 
-void scsi_setup_read6(ccb * pccb, unsigned long start, unsigned short blocks)
+void scsi_setup_read6(ccb * pccb, lbaint_t start, unsigned short blocks)
 {
 	pccb->cmd[0] = SCSI_READ6;
 	pccb->cmd[1] = pccb->lun << 5 | (((unsigned char)(start >> 16)) & 0x1f);