mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
tools: ynl-gen: record extra args for regen
ynl-regen needs to know the arguments used to generate a file. Record excluded ops and, while at it, user headers. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
008bcd6835
commit
33eedb0071
@@ -2281,6 +2281,11 @@ def main():
|
|||||||
cw.p("/* Do not edit directly, auto-generated from: */")
|
cw.p("/* Do not edit directly, auto-generated from: */")
|
||||||
cw.p(f"/*\t{spec_kernel} */")
|
cw.p(f"/*\t{spec_kernel} */")
|
||||||
cw.p(f"/* YNL-GEN {args.mode} {'header' if args.header else 'source'} */")
|
cw.p(f"/* YNL-GEN {args.mode} {'header' if args.header else 'source'} */")
|
||||||
|
if args.exclude_op or args.user_header:
|
||||||
|
line = ''
|
||||||
|
line += ' --user-header '.join([''] + args.user_header)
|
||||||
|
line += ' --exclude-op '.join([''] + args.exclude_op)
|
||||||
|
cw.p(f'/* YNL-ARG{line} */')
|
||||||
cw.nl()
|
cw.nl()
|
||||||
|
|
||||||
if args.mode == 'uapi':
|
if args.mode == 'uapi':
|
||||||
|
@@ -19,6 +19,7 @@ for f in $files; do
|
|||||||
# params: 0 1 2 3
|
# params: 0 1 2 3
|
||||||
# $YAML YNL-GEN kernel $mode
|
# $YAML YNL-GEN kernel $mode
|
||||||
params=( $(git grep -B1 -h '/\* YNL-GEN' $f | sed 's@/\*\(.*\)\*/@\1@') )
|
params=( $(git grep -B1 -h '/\* YNL-GEN' $f | sed 's@/\*\(.*\)\*/@\1@') )
|
||||||
|
args=$(sed -n 's@/\* YNL-ARG \(.*\) \*/@\1@p' $f)
|
||||||
|
|
||||||
if [ $f -nt ${params[0]} -a -z "$force" ]; then
|
if [ $f -nt ${params[0]} -a -z "$force" ]; then
|
||||||
echo -e "\tSKIP $f"
|
echo -e "\tSKIP $f"
|
||||||
@@ -26,5 +27,6 @@ for f in $files; do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "\tGEN ${params[2]}\t$f"
|
echo -e "\tGEN ${params[2]}\t$f"
|
||||||
$TOOL --mode ${params[2]} --${params[3]} --spec $KDIR/${params[0]} -o $f
|
$TOOL --mode ${params[2]} --${params[3]} --spec $KDIR/${params[0]} \
|
||||||
|
$args -o $f
|
||||||
done
|
done
|
||||||
|
Reference in New Issue
Block a user