scripts: atomic: check for argument in gen-rust-atomic-helpers.sh
Subsystems (2)
Alice Ryhl
reviewerPATCH 1/1 scripts: atomic: check for argument in gen-rust-atomic-helpers.sh
Currently, running scripts/atomic/gen-rust-atomic-helpers.sh without arguments results in a broken header file and grep errors:
$ scripts/atomic/gen-rust-atomic-helpers.sh
grep: : No such file or directory
grep: : No such file or directoryThe user may do this to re-generate the Rust helpers, not realizing that they called the wrong script [1]. In this scenario, point the user to scripts/atomic/gen-atomics.sh instead of failing in a cryptic way.
$ scripts/atomic/gen-rust-atomic-helpers.sh
call scripts/atomic/gen-atomics.sh instead--- scripts/atomic/gen-rust-atomic-helpers.sh | 5 +++++ 1 file changed, 5 insertions(+)
scripts/atomic/gen-rust-atomic-helpers.sh +5 -0
@@ -5,6 +5,11 @@ ATOMICDIR=$(dirname $0) . ${ATOMICDIR}/atomic-tbl.sh +if [ -z "$1" ]; then + echo "call scripts/atomic/gen-atomics.sh instead" >&2 + exit 1 +fi + #gen_proto_order_variant(meta, pfx, name, sfx, order, atomic, int, arg...) gen_proto_order_variant() {
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20260108-gen-rust-atomic-helpers-msg-3943461645fb
Best regards,
Signature · 1 line
Alice Ryhl <[email protected]>
Quoted 38 lines · On Thu, 08 Jan 2026 13:08:57 +0000 Alice Ryhl <[email protected]> wrote:
Currently, running
scripts/atomic/gen-rust-atomic-helpers.shwithout arguments results in a broken header file and grep errors:$ scripts/atomic/gen-rust-atomic-helpers.sh grep: : No such file or directory grep: : No such file or directoryThe user may do this to re-generate the Rust helpers, not realizing that they called the wrong script [1]. In this scenario, point the user to
scripts/atomic/gen-atomics.shinstead of failing in a cryptic way.$ scripts/atomic/gen-rust-atomic-helpers.sh call scripts/atomic/gen-atomics.sh insteadLink:
https://lore.kernel.org/r/CAH5fLghgm2pPdKen2rv6MeSXAYG_j_eCqvM0b=VbTbUM9eswKg@mail.gmail.comSigned-off-by Alice Ryhl <[email protected]> ---scripts/atomic/gen-rust-atomic-helpers.sh | 5 +++++ 1 file changed, 5 insertions(+)(quoted diff) +0
-0
b/scripts/atomic/gen-rust-atomic-helpers.shindex45b1e100ed7c63108ee6cb07e48a17668f860d47..1c76f8ae731de9ac069d489469b0383f256b1539100755 ---a/scripts/atomic/gen-rust-atomic-helpers.sh+++b/scripts/atomic/gen-rust-atomic-helpers.sh@@ -5,6 +5,11 @@ ATOMICDIR=$(dirname $0)
.${ATOMICDIR}/atomic-tbl.shscripts/atomic/gen-rust-atomic-helpers.sh +5
-0+if [ -z "$1" ]; then + echo "call scripts/atomic/gen-atomics.sh instead" >&2 + exit 1 +fi + #gen_proto_order_variant(meta, pfx, name, sfx, order, atomic, int,arg...)
gen_proto_order_variant()
{
Quoted 5 lines
---
base-commit:8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20260108-gen-rust-atomic-helpers-msg-3943461645fbBest regards,
Makes sense.
thanks,
Onur