diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2017-09-10 05:12:50 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-09-10 12:27:32 -0400 |
commit | eb81b1a4d3f996072e08b790018edd750210a8c1 (patch) | |
tree | 55ca7fbb9c0d4492315dab5f6914c5f7fb832c5d /include | |
parent | 4ccceefb7f0bbbcde849a1886dfb0c45cc2c746e (diff) | |
download | u-boot-eb81b1a4d3f996072e08b790018edd750210a8c1.tar.gz u-boot-eb81b1a4d3f996072e08b790018edd750210a8c1.tar.bz2 u-boot-eb81b1a4d3f996072e08b790018edd750210a8c1.zip |
blk: Use macros for block device vendor/product/rev string size
So far these are using magic numbers. Replace them with macros.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/blk.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/blk.h b/include/blk.h index a106f9ca0e..27abfddb94 100644 --- a/include/blk.h +++ b/include/blk.h @@ -36,6 +36,10 @@ enum if_type { IF_TYPE_COUNT, /* Number of interface types */ }; +#define BLK_VEN_SIZE 40 +#define BLK_PRD_SIZE 20 +#define BLK_REV_SIZE 8 + /* * With driver model (CONFIG_BLK) this is uclass platform data, accessible * with dev_get_uclass_platdata(dev) @@ -60,9 +64,9 @@ struct blk_desc { lbaint_t lba; /* number of blocks */ unsigned long blksz; /* block size */ int log2blksz; /* for convenience: log2(blksz) */ - char vendor[40+1]; /* IDE model, SCSI Vendor */ - char product[20+1]; /* IDE Serial no, SCSI product */ - char revision[8+1]; /* firmware revision */ + char vendor[BLK_VEN_SIZE + 1]; /* device vendor string */ + char product[BLK_PRD_SIZE + 1]; /* device product number */ + char revision[BLK_REV_SIZE + 1]; /* firmware revision */ #if CONFIG_IS_ENABLED(BLK) /* * For now we have a few functions which take struct blk_desc as a |