From 4101f6879256720b30df712089a3df18565f9203 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 29 Feb 2016 15:25:34 -0700 Subject: dm: Drop the block_dev_desc_t typedef Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long and causes 80-column violations, rename it to struct blk_desc. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Tested-by: Stephen Warren --- api/api_storage.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'api/api_storage.c') diff --git a/api/api_storage.c b/api/api_storage.c index bc2b4d6b8c..225a6cf10f 100644 --- a/api/api_storage.c +++ b/api/api_storage.c @@ -103,7 +103,7 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di) int i; - block_dev_desc_t *dd; + struct blk_desc *dd; if (first) { di->cookie = (void *)get_dev(specs[type].name, 0); @@ -148,7 +148,7 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di) di->type = specs[type].type; if (di->cookie != NULL) { - dd = (block_dev_desc_t *)di->cookie; + dd = (struct blk_desc *)di->cookie; if (dd->type == DEV_TYPE_UNKNOWN) { debugf("device instance exists, but is not active.."); found = 0; @@ -166,9 +166,9 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di) /* - * returns: ENUM_IDE, ENUM_USB etc. based on block_dev_desc_t + * returns: ENUM_IDE, ENUM_USB etc. based on struct blk_desc */ -static int dev_stor_type(block_dev_desc_t *dd) +static int dev_stor_type(struct blk_desc *dd) { int i, j; @@ -308,7 +308,7 @@ int dev_enum_storage(struct device_info *di) return 0; } -static int dev_stor_is_valid(int type, block_dev_desc_t *dd) +static int dev_stor_is_valid(int type, struct blk_desc *dd) { int i; @@ -328,7 +328,7 @@ int dev_open_stor(void *cookie) if (type == ENUM_MAX) return API_ENODEV; - if (dev_stor_is_valid(type, (block_dev_desc_t *)cookie)) + if (dev_stor_is_valid(type, (struct blk_desc *)cookie)) return 0; return API_ENODEV; @@ -348,7 +348,7 @@ int dev_close_stor(void *cookie) lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start) { int type; - block_dev_desc_t *dd = (block_dev_desc_t *)cookie; + struct blk_desc *dd = (struct blk_desc *)cookie; if ((type = dev_stor_type(dd)) == ENUM_MAX) return 0; -- cgit v1.2.1 From db1d9e78e6f0ea51a698f18abe4cebc5ff39b691 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 29 Feb 2016 15:25:42 -0700 Subject: dm: blk: Rename get_dev() to blk_get_dev() The current name is too generic. Add a 'blk_' prefix to aid searching and make its purpose clearer. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Tested-by: Stephen Warren --- api/api_storage.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'api/api_storage.c') diff --git a/api/api_storage.c b/api/api_storage.c index 225a6cf10f..8c30c56e49 100644 --- a/api/api_storage.c +++ b/api/api_storage.c @@ -106,7 +106,7 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di) struct blk_desc *dd; if (first) { - di->cookie = (void *)get_dev(specs[type].name, 0); + di->cookie = (void *)blk_get_dev(specs[type].name, 0); if (di->cookie == NULL) return 0; else @@ -119,7 +119,8 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di) } else { for (i = 0; i < specs[type].max_dev; i++) - if (di->cookie == (void *)get_dev(specs[type].name, i)) { + if (di->cookie == + (void *)blk_get_dev(specs[type].name, i)) { /* previous cookie found -- advance to the * next device, if possible */ @@ -129,7 +130,8 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di) break; } - di->cookie = (void *)get_dev(specs[type].name, i); + di->cookie = (void *)blk_get_dev( + specs[type].name, i); if (di->cookie == NULL) return 0; else @@ -174,7 +176,7 @@ static int dev_stor_type(struct blk_desc *dd) for (i = ENUM_IDE; i < ENUM_MAX; i++) for (j = 0; j < specs[i].max_dev; j++) - if (dd == get_dev(specs[i].name, j)) + if (dd == blk_get_dev(specs[i].name, j)) return i; return ENUM_MAX; @@ -313,7 +315,7 @@ static int dev_stor_is_valid(int type, struct blk_desc *dd) int i; for (i = 0; i < specs[type].max_dev; i++) - if (dd == get_dev(specs[type].name, i)) + if (dd == blk_get_dev(specs[type].name, i)) if (dd->type != DEV_TYPE_UNKNOWN) return 1; -- cgit v1.2.1