[PATCH 2/3] chmem: do not word a configuration failure as an instruction to the user
Benno Schulenberg <[email protected]> Tue, 9 Dec 2025 16:02:21 +0100
| Newsgroups | org.kernel.vger.util-linux |
|---|---|
| Message-ID | <[email protected]> |
When the current machine does not support configuring/deconfiguring
memory, simply report that it cannot be done, instead of seemingly
telling the user to skip the configuring/deconfiguring.
Also, there is no need to mention `chmem` in the message: mentioning
just the recommended option (-e or -d) is enough. Also, consistently
terminate all four messages with a period.
This improves upon commit ab2e709600 ("chmem: improve messages").
CC: Sumanth Korikkar <[email protected]>
Signed-off-by: Benno Schulenberg <[email protected]>
---
sys-utils/chmem.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sys-utils/chmem.c b/sys-utils/chmem.c
index 6ec66bb6b..dcec888d1 100644
--- a/sys-utils/chmem.c
+++ b/sys-utils/chmem.c
@@ -325,10 +325,10 @@ static int chmem_config_size(struct chmem_desc *desc, int configure)
if (!desc->have_memconfig) {
if (configure)
fprintf(stdout,
- _("Skip configuration. Use chmem -e instead.\n"));
+ _("Cannot configure. Use -e instead.\n"));
else
fprintf(stdout,
- _("Skip deconfiguration. Use chmem -d instead\n"));
+ _("Cannot deconfigure. Use -d instead.\n"));
return -1;
}
size = desc->size;
@@ -363,10 +363,10 @@ static int chmem_config_range(struct chmem_desc *desc, int configure)
if (!desc->have_memconfig) {
if (configure)
fprintf(stdout,
- _("Skip configuration. Use chmem -e instead.\n"));
+ _("Cannot configure. Use -e instead.\n"));
else
fprintf(stdout,
- _("Skip deconfiguration. Use chmem -d instead\n"));
+ _("Cannot deconfigure. Use -d instead.\n"));
return -1;
}
todo = desc->end - desc->start + 1;
--
2.51.2