From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: Petr Vorel <pvorel@suse.cz>, Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v5 1/3] Refactor regen.sh script to generate syscalls
Date: Wed, 30 Oct 2024 16:34:01 +0100 [thread overview]
Message-ID: <fa37b53b-51c8-4ea2-b95a-c6248b5bc4a3@suse.com> (raw)
In-Reply-To: <20241030144908.GA915191@pevik>
Hi Petr,
On 10/30/24 15:49, Petr Vorel wrote:
> Hi Andrea,
>
>> +++ b/include/lapi/syscalls/generate_syscalls.sh
>> @@ -0,0 +1,115 @@
>> +#!/bin/sh
>> +# SPDX-License-Identifier: GPL-2.0-or-later
>> +#
>> +# Generate the syscalls.h file, merging all architectures syscalls input file
>> +# which are in the current folder and defined inside supported-arch.txt file.
>> +
>> +SYSCALLS_FILE="$1"
>> +
>> +if [ -z "${SYSCALLS_FILE}" ]; then
> nit: I would still replace ${...} with $... (e.g. ${SYSCALLS_FILE} =>
> $SYSCALLS_FILE) as I noted in v4 - readability. IMHO there is no need to use
> ${...} in whole script.
>
> The same applies to include/lapi/syscalls/generate_arch.sh in the second commit.
This is a bit debatable. The reason why using ${VAR} over $VAR is the
readability in the first place (i.e. when you have `${PATH}/bin` instead
`$PATH/bin` or when you use characters which could mix with PATH var
name and it might create debug issues), but also the fact it provides
${VAR:-default} syntax which can always added afterwards.
I usually prefer this method for these reasons.
>
>> + echo "Please provide the syscalls.h directory:"
>> + echo ""
>> + echo "$0 path/of/syscalls.h"
>> + echo ""
>> + exit 1
>> +fi
>> +
>> +SCRIPT_DIR="$(realpath $(dirname "$0"))"
>> +SUPPORTED_ARCH="${SCRIPT_DIR}/supported-arch.txt"
>> +
>> +echo '
>> +/************************************************
>> +* GENERATED FILE: DO NOT EDIT/PATCH THIS FILE *
>> +* change your arch specific .in file instead *
>> +************************************************/
>> +
>> +/*
>> +* Here we stick all the ugly *fallback* logic for linux
>> +* system call numbers (those __NR_ thingies).
>> +*
>> +* Licensed under the GPLv2 or later, see the COPYING file.
>> +*/
>
> nit: fixing space in /* */ comments (correct in the original regen.sh)
> + replacing old note about COPYING with SPDX in generated header:
Thanks you seen that. Now I know I can't fully trust auto-refactoring.
>
> +++ include/lapi/syscalls/generate_syscalls.sh
> @@ -17,18 +17,16 @@ fi
> SCRIPT_DIR="$(realpath $(dirname "$0"))"
> SUPPORTED_ARCH="${SCRIPT_DIR}/supported-arch.txt"
>
> -echo '
> +echo '// SPDX-License-Identifier: GPL-2.0-or-later
> /************************************************
> -* GENERATED FILE: DO NOT EDIT/PATCH THIS FILE *
> -* change your arch specific .in file instead *
> -************************************************/
> + * GENERATED FILE: DO NOT EDIT/PATCH THIS FILE *
> + * change your arch specific .in file instead *
> + ************************************************/
>
> /*
> -* Here we stick all the ugly *fallback* logic for linux
> -* system call numbers (those __NR_ thingies).
> -*
> -* Licensed under the GPLv2 or later, see the COPYING file.
> -*/
> + * Here we stick all the ugly *fallback* logic for linux
> + * system call numbers (those __NR_ thingies).
> + */
>
> #ifndef LAPI_SYSCALLS_H__
> #define LAPI_SYSCALLS_H__
> ---
>
> Kind regards,
> Petr
Andrea
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-10-30 15:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-30 8:52 [LTP] [PATCH v5 0/3] Automatically generate syscalls.h Andrea Cervesato
2024-10-30 8:53 ` [LTP] [PATCH v5 1/3] Refactor regen.sh script to generate syscalls Andrea Cervesato
2024-10-30 13:47 ` Cyril Hrubis
2024-10-30 14:20 ` Andrea Cervesato via ltp
2024-10-30 17:43 ` Cyril Hrubis
2024-10-30 14:49 ` Petr Vorel
2024-10-30 15:34 ` Andrea Cervesato via ltp [this message]
2024-10-30 16:49 ` Petr Vorel
2024-10-30 8:53 ` [LTP] [PATCH v5 2/3] Add script to generate arch(s) dependant syscalls Andrea Cervesato
2024-10-30 14:04 ` Cyril Hrubis
2024-10-30 15:15 ` Petr Vorel
2024-10-30 15:24 ` Andrea Cervesato via ltp
2024-10-30 8:53 ` [LTP] [PATCH v5 3/3] Delete obsolete strip_syscall.awk file Andrea Cervesato
2024-10-30 14:04 ` Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fa37b53b-51c8-4ea2-b95a-c6248b5bc4a3@suse.com \
--to=ltp@lists.linux.it \
--cc=andrea.cervesato@suse.com \
--cc=andrea.cervesato@suse.de \
--cc=pvorel@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox