diff options
author | Egbert Eich <eich@suse.com> | 2013-04-09 21:11:56 +0000 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2013-05-01 16:24:02 -0400 |
commit | 0472fbfd3250d1a33d3de78afdcbf24f78ac026b (patch) | |
tree | 1d5f822e2d95f800121368bba96a185ae6f7b0fb /common/cmd_scsi.c | |
parent | bc8d98713f10582f4e35b9208f1b967c6a9f9953 (diff) | |
download | u-boot-imx-0472fbfd3250d1a33d3de78afdcbf24f78ac026b.zip u-boot-imx-0472fbfd3250d1a33d3de78afdcbf24f78ac026b.tar.gz u-boot-imx-0472fbfd3250d1a33d3de78afdcbf24f78ac026b.tar.bz2 |
part/dev_desc: Add log2 of blocksize to block_dev_desc data struct
log2 of the device block size serves as the shift value used to calculate
the block number to read in file systems when implementing avaiable block
sizes.
It is needed quite often in file systems thus it is pre-calculated and
stored in the block device descriptor.
Signed-off-by: Egbert Eich <eich@suse.com>
Diffstat (limited to 'common/cmd_scsi.c')
-rw-r--r-- | common/cmd_scsi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c index 13b3d99..294d9f5 100644 --- a/common/cmd_scsi.c +++ b/common/cmd_scsi.c @@ -106,6 +106,8 @@ void scsi_scan(int mode) scsi_dev_desc[i].lun=0xff; scsi_dev_desc[i].lba=0; scsi_dev_desc[i].blksz=0; + scsi_dev_desc[i].log2blksz = + LOG2_INVALID(typeof(scsi_dev_desc[i].log2blksz)); scsi_dev_desc[i].type=DEV_TYPE_UNKNOWN; scsi_dev_desc[i].vendor[0]=0; scsi_dev_desc[i].product[0]=0; @@ -166,6 +168,8 @@ void scsi_scan(int mode) } scsi_dev_desc[scsi_max_devs].lba=capacity; scsi_dev_desc[scsi_max_devs].blksz=blksz; + scsi_dev_desc[scsi_max_devs].log2blksz = + LOG2(scsi_dev_desc[scsi_max_devs].blksz); scsi_dev_desc[scsi_max_devs].type=perq; init_part(&scsi_dev_desc[scsi_max_devs]); removable: |