[PATCH v2 2/3] losetup: remove the --verbose flag, as it doesn't actually do anything

Benno Schulenberg <[email protected]> Wed, 5 Nov 2025 08:15:43 +0100
Newsgroups org.kernel.vger.util-linux
Message-ID <[email protected]>
Fourteen years ago, commit c7e0925def rewrote the `losetup` tool,
removing all references to the 'verbose' variable.  Three years
later, commit 60cb2c3720 removed the line 'verbose = 1' because
the compiler complained that the variable was set but never used.

Signed-off-by: Benno Schulenberg <[email protected]>

---
V2: Remove --verbose also from bash-completion and getopt_long() call.

---
 bash-completion/losetup  | 1 -
 sys-utils/losetup.8.adoc | 3 ---
 sys-utils/losetup.c      | 6 +-----
 3 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/bash-completion/losetup b/bash-completion/losetup
index 783d966c7..2eedcd767 100644
--- a/bash-completion/losetup
+++ b/bash-completion/losetup
@@ -59,7 +59,6 @@ _losetup_module()
 				--read-only
 				--remove
 				--show
-				--verbose
 				--json
 				--list
 				--noheadings
diff --git a/sys-utils/losetup.8.adoc b/sys-utils/losetup.8.adoc
index f51710af8..131ebfa56 100644
--- a/sys-utils/losetup.8.adoc
+++ b/sys-utils/losetup.8.adoc
@@ -106,9 +106,6 @@ Set up a read-only loop device.
 *--direct-io*[**=on**|*off*]::
 Enable or disable direct I/O for the backing file. The default is *off*. Specifying either *--direct-io* or *--direct-io=on* will enable it. But, *--direct-io=off* can be provided to explicitly turn it off.
 
-*-v*, *--verbose*::
-Verbose mode.
-
 *-l*, *--list*::
 If a loop device or the *-a* option is specified, print the default columns for either the specified loop device or all loop devices; the default is to print info about all devices. See also *--output*, *--noheadings*, *--raw*, and *--json*.
 
diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c
index 2a3257473..fe30d70da 100644
--- a/sys-utils/losetup.c
+++ b/sys-utils/losetup.c
@@ -501,7 +501,6 @@ static void __attribute__((__noreturn__)) usage(void)
 	fputs(_("     --direct-io[=<on|off>]    open backing file with O_DIRECT\n"), out);
 	fputs(_("     --loop-ref <string>       loop device reference\n"), out);
 	fputs(_("     --show                    print device name after setup (with -f)\n"), out);
-	fputs(_(" -v, --verbose                 verbose mode\n"), out);
 
 	/* output options */
 	fputs(USAGE_SEPARATOR, out);
@@ -730,7 +729,6 @@ int main(int argc, char **argv)
 		{ "raw",          no_argument,       NULL, OPT_RAW       },
 		{ "loop-ref",     required_argument, NULL, OPT_REF,      },
 		{ "show",         no_argument,       NULL, OPT_SHOW      },
-		{ "verbose",      no_argument,       NULL, 'v'           },
 		{ "version",      no_argument,       NULL, 'V'           },
 		{ "remove",       no_argument,       NULL, OPT_REMOVE    },
 		{ NULL, 0, NULL, 0 }
@@ -753,7 +751,7 @@ int main(int argc, char **argv)
 	if (loopcxt_init(&lc, 0))
 		err(EXIT_FAILURE, _("failed to initialize loopcxt"));
 
-	while ((c = getopt_long(argc, argv, "ab:cdDfhj:JlLno:O:PrvV",
+	while ((c = getopt_long(argc, argv, "ab:cdDfhj:JlLno:O:PrV",
 				longopts, NULL)) != -1) {
 
 		err_exclusive_options(c, longopts, excl, excl_st);
@@ -829,8 +827,6 @@ int main(int argc, char **argv)
 			if (use_dio)
 				lo_flags |= LO_FLAGS_DIRECT_IO;
 			break;
-		case 'v':
-			break;
 		case OPT_SIZELIMIT:			/* --sizelimit */
 			sizelimit = strtosize_or_err(optarg, _("failed to parse size"));
 			flags |= LOOPDEV_FL_SIZELIMIT;
-- 
2.51.2