[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250220151414.8003-1-ritvikfoss@gmail.com>
Date: Thu, 20 Feb 2025 20:44:14 +0530
From: ritvikfoss@...il.com
To: linux-kernel@...r.kernel.org,
ricardo@...liere.net
Cc: skhan@...uxfoundation.org,
linux-kernel-mentees@...ts.linuxfoundation.org
Subject: [PATCH v2] scripts/checksyscalls.sh: Add usage message, fix -Wno-error
From: Ritvik Gupta <ritvikfoss@...il.com>
Currently 'scripts/checksyscalls.sh' does not
provide guidance when executed without specifying
a compiler, instead it attempts to execute
'-Wno-error' parameter as a command,
resulting in 'Wno-error: Command not found' error.
This patch adds a usage message that is displayed
when no compiler is provided as parameter to
improve clarity.
Signed-off-by: Ritvik Gupta <ritvikfoss@...il.com>
---
Changes in v2:
- Make the script posix compliant
- Fixed formatting
Thanks for reviewing!
scripts/checksyscalls.sh | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh
index 1e5d2eeb726d..96cba9f79249 100755
--- a/scripts/checksyscalls.sh
+++ b/scripts/checksyscalls.sh
@@ -10,6 +10,22 @@
# checksyscalls.sh gcc gcc-options
#
+usage() {
+cat << EOF
+Usage: $0 <compiler> [compiler-options]
+
+Example:
+ $0 gcc
+EOF
+
+exit 1
+}
+
+if [ $# -eq 0 ]; then
+ echo "Error: No compiler provided."
+ usage
+fi
+
ignore_list() {
cat << EOF
#include <asm/types.h>
--
2.48.1
Powered by blists - more mailing lists