Blame SOURCES/0098-cxl-list-Cleanup-options-definitions.patch

2eb93d
From 5d20a4d2cca923e63cb1604da51788c0fd078ce1 Mon Sep 17 00:00:00 2001
2eb93d
From: Dan Williams <dan.j.williams@intel.com>
2eb93d
Date: Sun, 23 Jan 2022 16:52:52 -0800
2eb93d
Subject: [PATCH 098/217] cxl/list: Cleanup options definitions
2eb93d
2eb93d
Clarify which options take lists by adding a "(s)" to the object name, and
2eb93d
move the option block out of cmd_list() to reduce the column-80 collisions.
2eb93d
2eb93d
Link: https://lore.kernel.org/r/164298557263.3021641.8121105326167408001.stgit@dwillia2-desk3.amr.corp.intel.com
2eb93d
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2eb93d
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
2eb93d
---
2eb93d
 cxl/list.c | 30 ++++++++++++++++--------------
2eb93d
 1 file changed, 16 insertions(+), 14 deletions(-)
2eb93d
2eb93d
diff --git a/cxl/list.c b/cxl/list.c
2eb93d
index 6bc48df..7e2744d 100644
2eb93d
--- a/cxl/list.c
2eb93d
+++ b/cxl/list.c
2eb93d
@@ -19,22 +19,24 @@ static int num_list_flags(void)
2eb93d
 	return param.memdevs;
2eb93d
 }
2eb93d
 
2eb93d
+static const struct option options[] = {
2eb93d
+	OPT_STRING('m', "memdev", &param.memdev_filter, "memory device name(s)",
2eb93d
+		   "filter by CXL memory device name(s)"),
2eb93d
+	OPT_STRING('s', "serial", &param.serial_filter,
2eb93d
+		   "memory device serial(s)",
2eb93d
+		   "filter by CXL memory device serial number(s)"),
2eb93d
+	OPT_BOOLEAN('M', "memdevs", &param.memdevs,
2eb93d
+		    "include CXL memory device info"),
2eb93d
+	OPT_BOOLEAN('i', "idle", &param.idle, "include disabled devices"),
2eb93d
+	OPT_BOOLEAN('u', "human", &param.human,
2eb93d
+		    "use human friendly number formats "),
2eb93d
+	OPT_BOOLEAN('H', "health", &param.health,
2eb93d
+		    "include memory device health information "),
2eb93d
+	OPT_END(),
2eb93d
+};
2eb93d
+
2eb93d
 int cmd_list(int argc, const char **argv, struct cxl_ctx *ctx)
2eb93d
 {
2eb93d
-	const struct option options[] = {
2eb93d
-		OPT_STRING('m', "memdev", &param.memdev_filter, "memory device name",
2eb93d
-			   "filter by CXL memory device name"),
2eb93d
-		OPT_STRING('s', "serial", &param.serial_filter, "memory device serial",
2eb93d
-			   "filter by CXL memory device serial number"),
2eb93d
-		OPT_BOOLEAN('M', "memdevs", &param.memdevs,
2eb93d
-			    "include CXL memory device info"),
2eb93d
-		OPT_BOOLEAN('i', "idle", &param.idle, "include disabled devices"),
2eb93d
-		OPT_BOOLEAN('u', "human", &param.human,
2eb93d
-				"use human friendly number formats "),
2eb93d
-		OPT_BOOLEAN('H', "health", &param.health,
2eb93d
-				"include memory device health information "),
2eb93d
-		OPT_END(),
2eb93d
-	};
2eb93d
 	const char * const u[] = {
2eb93d
 		"cxl list [<options>]",
2eb93d
 		NULL
2eb93d
-- 
2eb93d
2.27.0
2eb93d