From: Tomohiro Kusumi Date: Wed, 18 Jan 2017 17:38:25 +0000 (+0900) Subject: Refactor fio_show_ioengine_help() X-Git-Tag: fio-2.18~53 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=755dcbbdec670a0c2e83561070d5fd1462c75dc6;ds=sidebyside Refactor fio_show_ioengine_help() Since td is there only to call load_ioengine(), ioengine ops doesn't need to be refered to as td.io_ops. Signed-off-by: Tomohiro Kusumi Signed-off-by: Jens Axboe --- diff --git a/ioengines.c b/ioengines.c index 315432da..95013d1d 100644 --- a/ioengines.c +++ b/ioengines.c @@ -618,15 +618,15 @@ int fio_show_ioengine_help(const char *engine) { struct flist_head *entry; struct thread_data td; + struct ioengine_ops *io_ops; char *sep; int ret = 1; if (!engine || !*engine) { log_info("Available IO engines:\n"); flist_for_each(entry, &engine_list) { - td.io_ops = flist_entry(entry, struct ioengine_ops, - list); - log_info("\t%s\n", td.io_ops->name); + io_ops = flist_entry(entry, struct ioengine_ops, list); + log_info("\t%s\n", io_ops->name); } return 0; } @@ -638,16 +638,16 @@ int fio_show_ioengine_help(const char *engine) memset(&td, 0, sizeof(td)); - td.io_ops = load_ioengine(&td, engine); - if (!td.io_ops) { + io_ops = load_ioengine(&td, engine); + if (!io_ops) { log_info("IO engine %s not found\n", engine); return 1; } - if (td.io_ops->options) - ret = show_cmd_help(td.io_ops->options, sep); + if (io_ops->options) + ret = show_cmd_help(io_ops->options, sep); else - log_info("IO engine %s has no options\n", td.io_ops->name); + log_info("IO engine %s has no options\n", io_ops->name); free_ioengine(&td);