From 6383602952785b87cf05e47e78f2ac7e482f1df3 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Fri, 28 Feb 2020 01:16:33 -0500 Subject: [PATCH] lib/scsi: Remove workaround for astyle format check about break-after-return-type To avoid the starnge formatting, typedef has been used. But this comment is hard to get the meaning. So stop breaking after return type for this case. The strange formating is struct spdk_scsi_dev * spdk_scsi_dev_construct(const char *name, const char *bdev_name_list[], int *lun_id_list, int num_luns, uint8_t protocol_id, void (*hotremove_cb)(const struct spdk_scsi_lun *, void *), void *hotremove_ctx) Signed-off-by: Shuhei Matsumoto Change-Id: I20c30b225b3b96fa9207b4a89e3210c8a97fb1d8 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1050 Tested-by: SPDK CI Jenkins Reviewed-by: Darek Stojaczyk Reviewed-by: Tomasz Zawadzki --- lib/scsi/dev.c | 14 ++++---------- lib/scsi/lun.c | 7 +++---- lib/scsi/scsi_internal.h | 11 +++-------- test/unit/lib/scsi/dev.c/dev_ut.c | 7 +++---- test/unit/lib/scsi/lun.c/lun_ut.c | 3 +-- 5 files changed, 14 insertions(+), 28 deletions(-) diff --git a/lib/scsi/dev.c b/lib/scsi/dev.c index 8ab5f4ad3..2117bf6a1 100644 --- a/lib/scsi/dev.c +++ b/lib/scsi/dev.c @@ -191,16 +191,10 @@ spdk_scsi_dev_delete_lun(struct spdk_scsi_dev *dev, } } -/* This typedef exists to work around an astyle 2.05 bug. - * Remove it when astyle is fixed. - */ -typedef struct spdk_scsi_dev _spdk_scsi_dev; - -_spdk_scsi_dev * -spdk_scsi_dev_construct(const char *name, const char *bdev_name_list[], - int *lun_id_list, int num_luns, uint8_t protocol_id, - void (*hotremove_cb)(const struct spdk_scsi_lun *, void *), - void *hotremove_ctx) +struct spdk_scsi_dev *spdk_scsi_dev_construct(const char *name, const char *bdev_name_list[], + int *lun_id_list, int num_luns, uint8_t protocol_id, + void (*hotremove_cb)(const struct spdk_scsi_lun *, void *), + void *hotremove_ctx) { struct spdk_scsi_dev *dev; size_t name_len; diff --git a/lib/scsi/lun.c b/lib/scsi/lun.c index e6d06952b..b97d37122 100644 --- a/lib/scsi/lun.c +++ b/lib/scsi/lun.c @@ -387,10 +387,9 @@ scsi_lun_hot_remove(void *remove_ctx) * \return NULL if bdev == NULL * \return pointer to the new spdk_scsi_lun object otherwise */ -_spdk_scsi_lun * -spdk_scsi_lun_construct(struct spdk_bdev *bdev, - void (*hotremove_cb)(const struct spdk_scsi_lun *, void *), - void *hotremove_ctx) +struct spdk_scsi_lun *spdk_scsi_lun_construct(struct spdk_bdev *bdev, + void (*hotremove_cb)(const struct spdk_scsi_lun *, void *), + void *hotremove_ctx) { struct spdk_scsi_lun *lun; int rc; diff --git a/lib/scsi/scsi_internal.h b/lib/scsi/scsi_internal.h index cbab5df02..8aae512b5 100644 --- a/lib/scsi/scsi_internal.h +++ b/lib/scsi/scsi_internal.h @@ -171,14 +171,9 @@ struct spdk_lun_db_entry { extern struct spdk_lun_db_entry *spdk_scsi_lun_list_head; -/* This typedef exists to work around an astyle 2.05 bug. - * Remove it when astyle is fixed. - */ -typedef struct spdk_scsi_lun _spdk_scsi_lun; - -_spdk_scsi_lun *spdk_scsi_lun_construct(struct spdk_bdev *bdev, - void (*hotremove_cb)(const struct spdk_scsi_lun *, void *), - void *hotremove_ctx); +struct spdk_scsi_lun *spdk_scsi_lun_construct(struct spdk_bdev *bdev, + void (*hotremove_cb)(const struct spdk_scsi_lun *, void *), + void *hotremove_ctx); void spdk_scsi_lun_destruct(struct spdk_scsi_lun *lun); void spdk_scsi_lun_append_task(struct spdk_scsi_lun *lun, struct spdk_scsi_task *task); diff --git a/test/unit/lib/scsi/dev.c/dev_ut.c b/test/unit/lib/scsi/dev.c/dev_ut.c index 922f4dd94..022c1e0e5 100644 --- a/test/unit/lib/scsi/dev.c/dev_ut.c +++ b/test/unit/lib/scsi/dev.c/dev_ut.c @@ -81,10 +81,9 @@ spdk_scsi_task_put(struct spdk_scsi_task *task) free(task); } -_spdk_scsi_lun * -spdk_scsi_lun_construct(struct spdk_bdev *bdev, - void (*hotremove_cb)(const struct spdk_scsi_lun *, void *), - void *hotremove_ctx) +struct spdk_scsi_lun *spdk_scsi_lun_construct(struct spdk_bdev *bdev, + void (*hotremove_cb)(const struct spdk_scsi_lun *, void *), + void *hotremove_ctx) { struct spdk_scsi_lun *lun; diff --git a/test/unit/lib/scsi/lun.c/lun_ut.c b/test/unit/lib/scsi/lun.c/lun_ut.c index d67d60861..59243c4ca 100644 --- a/test/unit/lib/scsi/lun.c/lun_ut.c +++ b/test/unit/lib/scsi/lun.c/lun_ut.c @@ -138,8 +138,7 @@ spdk_bdev_scsi_execute(struct spdk_scsi_task *task) DEFINE_STUB(spdk_bdev_get_io_channel, struct spdk_io_channel *, (struct spdk_bdev_desc *desc), NULL); -static _spdk_scsi_lun * -lun_construct(void) +static struct spdk_scsi_lun *lun_construct(void) { struct spdk_scsi_lun *lun; struct spdk_bdev bdev;