diff options
author | Johannes Berg <johannes.berg@intel.com> | 2024-12-06 13:30:57 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-12-08 04:27:59 +0300 |
commit | 81d89e6e88d5d592c1792940753d69d9753b3a8a (patch) | |
tree | 73b5d8757fde093dd9a511993f2c26e4108a3016 | |
parent | 00ab246750821b226f14ebc94ad21431dc82820b (diff) | |
download | linux-81d89e6e88d5d592c1792940753d69d9753b3a8a.tar.xz |
tools: ynl-gen-c: don't require -o argument
Without -o the tool currently crashes, but it's not marked
as required. The only thing we can't do without it is to
generate the correct #include for user source files, but
we can put a placeholder instead.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20241206113100.89d35bf124d6.I9228fb704e6d5c9d8e046ef15025a47a48439c1e@changeid
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rwxr-xr-x | tools/net/ynl/ynl-gen-c.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py index 7f6e5157770d..ec2288948795 100755 --- a/tools/net/ynl/ynl-gen-c.py +++ b/tools/net/ynl/ynl-gen-c.py @@ -2761,7 +2761,10 @@ def main(): cw.p('#define ' + hdr_prot) cw.nl() - hdr_file=os.path.basename(args.out_file[:-2]) + ".h" + if args.out_file: + hdr_file = os.path.basename(args.out_file[:-2]) + ".h" + else: + hdr_file = "generated_header_file.h" if args.mode == 'kernel': cw.p('#include <net/netlink.h>') |