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

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