Skip to contentSkip to conversation

daxctl: Remove unused mem_zone variable

PATCH In review Xiao Yang 2 participants 3 messages Aug 9, 2023 – Aug 11, 2023 libnvdimm: non-volatile memory device

lore
Share & tools
lore

Xiao Yang

author
#0 lore raw

PATCH 1/1 daxctl: Remove unused mem_zone variable

mem_zone variable has never been used so remove it.

---
 daxctl/device.c | 6 ------
 1 file changed, 6 deletions(-)
daxctl/device.c +0 -6
index d2d206b..360ae8b 100644
@@ -59,7 +59,6 @@ enum memory_zone {
 	MEM_ZONE_MOVABLE,
 	MEM_ZONE_NORMAL,
 };
-static enum memory_zone mem_zone = MEM_ZONE_MOVABLE;
 
 enum device_action {
 	ACTION_RECONFIG,
@@ -469,8 +468,6 @@ static const char *parse_device_options(int argc, const char **argv,
 				align = __parse_size64(param.align, &units);
 		} else if (strcmp(param.mode, "system-ram") == 0) {
 			reconfig_mode = DAXCTL_DEV_MODE_RAM;
-			if (param.no_movable)
-				mem_zone = MEM_ZONE_NORMAL;
 		} else if (strcmp(param.mode, "devdax") == 0) {
 			reconfig_mode = DAXCTL_DEV_MODE_DEVDAX;
 			if (param.no_online) {
@@ -494,9 +491,6 @@ static const char *parse_device_options(int argc, const char **argv,
 			align = __parse_size64(param.align, &units);
 		/* fall through */
 	case ACTION_ONLINE:
-		if (param.no_movable)
-			mem_zone = MEM_ZONE_NORMAL;
-		/* fall through */
 	case ACTION_DESTROY:
 	case ACTION_OFFLINE:
 	case ACTION_DISABLE:
Signature · 1 line
2.40.1
#1 lore raw
Quoted 12 lines · Xiao Yang

mem_zone variable has never been used so remove it.

---
 daxctl/device.c | 6 ------
 1 file changed, 6 deletions(-)
daxctl/device.c +0 -0
index d2d206b..360ae8b 100644

daxctl/device.c enum memory_zone { · line 61

Quoted 3 lines
daxctl/device.c +0 -0
@@ -59,7 +59,6 @@ enum memory_zone {
 	MEM_ZONE_MOVABLE,
 	MEM_ZONE_NORMAL,
 };

The enum definition is not used also.

Fan

Quoted 26 lines
daxctl/device.c +0 -7
-static enum memory_zone mem_zone = MEM_ZONE_MOVABLE;
 
 enum device_action {
 	ACTION_RECONFIG,
@@ -469,8 +468,6 @@ static const char *parse_device_options(int argc, const char **argv,
 				align = __parse_size64(param.align, &units);
 		} else if (strcmp(param.mode, "system-ram") == 0) {
 			reconfig_mode = DAXCTL_DEV_MODE_RAM;
-			if (param.no_movable)
-				mem_zone = MEM_ZONE_NORMAL;
 		} else if (strcmp(param.mode, "devdax") == 0) {
 			reconfig_mode = DAXCTL_DEV_MODE_DEVDAX;
 			if (param.no_online) {
@@ -494,9 +491,6 @@ static const char *parse_device_options(int argc, const char **argv,
 			align = __parse_size64(param.align, &units);
 		/* fall through */
 	case ACTION_ONLINE:
-		if (param.no_movable)
-			mem_zone = MEM_ZONE_NORMAL;
-		/* fall through */
 	case ACTION_DESTROY:
 	case ACTION_OFFLINE:
 	case ACTION_DISABLE:
--

2.40.1

author
#2 lore raw
Quoted 1 line · Fan Ni

The enum definition is not used also.

Hi Fan,

Good catch, I will send v2 patch to remove it.

Best Regards,
Xiao Yang

Quoted 2 lines

Fan