tools/x86/kcpuid: Simplify usage() handling
authorAhmed S. Darwish <darwi@linutronix.de>
Mon, 24 Mar 2025 14:20:24 +0000 (15:20 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 25 Mar 2025 08:53:44 +0000 (09:53 +0100)
commit660c29fe53deeb3b3aef1d666ed3bde7608380bd
treebef81c52037ac27ed30b81dbd2db3edf0312f111
parenta866a6775793a2554585073704b83c4691d80740
tools/x86/kcpuid: Simplify usage() handling

Refactor usage() to accept an exit code parameter and exit the program
after usage output.  This streamlines its callers' code paths.

Remove the "Invalid option" error message since getopt_long(3) already
emits a similar message by default.

Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/20250324142042.29010-4-darwi@linutronix.de
tools/arch/x86/kcpuid/kcpuid.c