diff mbox series

[ndctl,08/11] cxl/set-partition: Accept 'ram' as an alias for 'volatile'

Message ID 165765288979.435671.2636624998478988147.stgit@dwillia2-xfh
State Superseded
Headers show
Series cxl: Region provisioning foundation | expand

Commit Message

Dan Williams July 12, 2022, 7:08 p.m. UTC
'ram' is a more convenient shorthand for volatile memory.

Cc: Alison Schofield <alison.schofield@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 Documentation/cxl/cxl-set-partition.txt |    2 +-
 cxl/memdev.c                            |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Davidlohr Bueso July 13, 2022, 7:06 p.m. UTC | #1
On Tue, 12 Jul 2022, Dan Williams wrote:

>'ram' is a more convenient shorthand for volatile memory.

Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>

>
>Cc: Alison Schofield <alison.schofield@intel.com>
>Signed-off-by: Dan Williams <dan.j.williams@intel.com>
>---
> Documentation/cxl/cxl-set-partition.txt |    2 +-
> cxl/memdev.c                            |    4 +++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/Documentation/cxl/cxl-set-partition.txt b/Documentation/cxl/cxl-set-partition.txt
>index 1e548af77da2..f0126daf808b 100644
>--- a/Documentation/cxl/cxl-set-partition.txt
>+++ b/Documentation/cxl/cxl-set-partition.txt
>@@ -37,7 +37,7 @@ include::memdev-option.txt[]
>
> -t::
> --type=::
>-	Type of partition, 'pmem' or 'volatile', to modify.
>+	Type of partition, 'pmem' or 'ram' (volatile), to modify.
>	Default: 'pmem'
>
> -s::
>diff --git a/cxl/memdev.c b/cxl/memdev.c
>index 9fcd8ae5724b..1cecad2dba4b 100644
>--- a/cxl/memdev.c
>+++ b/cxl/memdev.c
>@@ -65,7 +65,7 @@ OPT_BOOLEAN('f', "force", &param.force,                                \
>
> #define SET_PARTITION_OPTIONS() \
> OPT_STRING('t', "type",  &param.type, "type",			\
>-	"'pmem' or 'volatile' (Default: 'pmem')"),		\
>+	"'pmem' or 'ram' (volatile) (Default: 'pmem')"),		\
> OPT_STRING('s', "size",  &param.size, "size",			\
>	"size in bytes (Default: all available capacity)"),	\
> OPT_BOOLEAN('a', "align",  &param.align,			\
>@@ -355,6 +355,8 @@ static int action_setpartition(struct cxl_memdev *memdev,
>			/* default */;
>		else if (strcmp(param.type, "volatile") == 0)
>			type = CXL_SETPART_VOLATILE;
>+		else if (strcmp(param.type, "ram") == 0)
>+			type = CXL_SETPART_VOLATILE;
>		else {
>			log_err(&ml, "invalid type '%s'\n", param.type);
>			return -EINVAL;
>
diff mbox series

Patch

diff --git a/Documentation/cxl/cxl-set-partition.txt b/Documentation/cxl/cxl-set-partition.txt
index 1e548af77da2..f0126daf808b 100644
--- a/Documentation/cxl/cxl-set-partition.txt
+++ b/Documentation/cxl/cxl-set-partition.txt
@@ -37,7 +37,7 @@  include::memdev-option.txt[]
 
 -t::
 --type=::
-	Type of partition, 'pmem' or 'volatile', to modify.
+	Type of partition, 'pmem' or 'ram' (volatile), to modify.
 	Default: 'pmem'
 
 -s::
diff --git a/cxl/memdev.c b/cxl/memdev.c
index 9fcd8ae5724b..1cecad2dba4b 100644
--- a/cxl/memdev.c
+++ b/cxl/memdev.c
@@ -65,7 +65,7 @@  OPT_BOOLEAN('f', "force", &param.force,                                \
 
 #define SET_PARTITION_OPTIONS() \
 OPT_STRING('t', "type",  &param.type, "type",			\
-	"'pmem' or 'volatile' (Default: 'pmem')"),		\
+	"'pmem' or 'ram' (volatile) (Default: 'pmem')"),		\
 OPT_STRING('s', "size",  &param.size, "size",			\
 	"size in bytes (Default: all available capacity)"),	\
 OPT_BOOLEAN('a', "align",  &param.align,			\
@@ -355,6 +355,8 @@  static int action_setpartition(struct cxl_memdev *memdev,
 			/* default */;
 		else if (strcmp(param.type, "volatile") == 0)
 			type = CXL_SETPART_VOLATILE;
+		else if (strcmp(param.type, "ram") == 0)
+			type = CXL_SETPART_VOLATILE;
 		else {
 			log_err(&ml, "invalid type '%s'\n", param.type);
 			return -EINVAL;