* [PATCH] scripts/checksyscalls.sh: Add usage message, fix -Wno-error
@ 2025-02-20 10:59 ritvikfoss
2025-02-20 11:52 ` Ricardo B. Marlière
2025-02-20 15:14 ` [PATCH v2] " ritvikfoss
0 siblings, 2 replies; 3+ messages in thread
From: ritvikfoss @ 2025-02-20 10:59 UTC (permalink / raw)
To: linux-kernel; +Cc: skhan, linux-kernel-mentees
From: Ritvik Gupta <ritvikfoss@gmail.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@gmail.com>
---
scripts/checksyscalls.sh | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh
index 1e5d2eeb726d..14c04227c96e 100755
--- a/scripts/checksyscalls.sh
+++ b/scripts/checksyscalls.sh
@@ -10,6 +10,21 @@
# 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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scripts/checksyscalls.sh: Add usage message, fix -Wno-error
2025-02-20 10:59 [PATCH] scripts/checksyscalls.sh: Add usage message, fix -Wno-error ritvikfoss
@ 2025-02-20 11:52 ` Ricardo B. Marlière
2025-02-20 15:14 ` [PATCH v2] " ritvikfoss
1 sibling, 0 replies; 3+ messages in thread
From: Ricardo B. Marlière @ 2025-02-20 11:52 UTC (permalink / raw)
To: ritvikfoss, linux-kernel; +Cc: skhan, linux-kernel-mentees
On Thu Feb 20, 2025 at 7:59 AM -03, ritvikfoss wrote:
> From: Ritvik Gupta <ritvikfoss@gmail.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@gmail.com>
> ---
> scripts/checksyscalls.sh | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh
> index 1e5d2eeb726d..14c04227c96e 100755
> --- a/scripts/checksyscalls.sh
> +++ b/scripts/checksyscalls.sh
> @@ -10,6 +10,21 @@
> # checksyscalls.sh gcc gcc-options
> #
>
> +usage() {
> +cat <<EOF
> +Usage: $0 <compiler> [compiler-options]
> +
> +Example:
> + $0 gcc
> +EOF
> +exit 1
> +}
> +
> +if [[ $# -eq 0 ]]; then
[[ is bash, while this script is POSIX #!/bin/sh
> + echo "Error: No compiler provided."
> + usage
> +fi
> +
> ignore_list() {
> cat << EOF
> #include <asm/types.h>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] scripts/checksyscalls.sh: Add usage message, fix -Wno-error
2025-02-20 10:59 [PATCH] scripts/checksyscalls.sh: Add usage message, fix -Wno-error ritvikfoss
2025-02-20 11:52 ` Ricardo B. Marlière
@ 2025-02-20 15:14 ` ritvikfoss
1 sibling, 0 replies; 3+ messages in thread
From: ritvikfoss @ 2025-02-20 15:14 UTC (permalink / raw)
To: linux-kernel, ricardo; +Cc: skhan, linux-kernel-mentees
From: Ritvik Gupta <ritvikfoss@gmail.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@gmail.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
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-20 15:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-20 10:59 [PATCH] scripts/checksyscalls.sh: Add usage message, fix -Wno-error ritvikfoss
2025-02-20 11:52 ` Ricardo B. Marlière
2025-02-20 15:14 ` [PATCH v2] " ritvikfoss
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox