net: ynl: prefix uAPI header include with uapi/
authorJakub Kicinski <kuba@kernel.org>
Wed, 24 May 2023 17:09:01 +0000 (10:09 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 May 2023 09:30:14 +0000 (10:30 +0100)
To keep things simple we used to include the uAPI header
in the kernel in the #include <linux/$family.h> format.
This works well enough, most of the genl families should
have headers in include/net/ so linux/$family.h ends up
referring to the uAPI header, anyway. And if it doesn't
no big deal, we'll just include more info than we need.

Unless that is there is a naming conflict. Someone recently
created include/linux/psp.h which will be a problem when
supporting the PSP protocol. (I'm talking about
work-in-progress patches, but it's just a proof that assuming
lack of name conflicts was overly optimistic.)

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/netdev-genl-gen.c
net/core/netdev-genl-gen.h
net/handshake/genl.c
net/handshake/genl.h
net/ipv4/fou_nl.c
net/ipv4/fou_nl.h
tools/net/ynl/ynl-gen-c.py

index de17ca2f7dbfec497f31e7568d247a62584ef4dc..ea9231378aa6ffccfb31067080b573624151773c 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "netdev-genl-gen.h"
 
-#include <linux/netdev.h>
+#include <uapi/linux/netdev.h>
 
 /* NETDEV_CMD_DEV_GET - do */
 static const struct nla_policy netdev_dev_get_nl_policy[NETDEV_A_DEV_IFINDEX + 1] = {
index 74d74fc23167988996d56107771e90e9a3cc7e0e..7b370c073e7dd18f340e013b3be6a5ef6e7455b1 100644 (file)
@@ -9,7 +9,7 @@
 #include <net/netlink.h>
 #include <net/genetlink.h>
 
-#include <linux/netdev.h>
+#include <uapi/linux/netdev.h>
 
 int netdev_nl_dev_get_doit(struct sk_buff *skb, struct genl_info *info);
 int netdev_nl_dev_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb);
index 9f29efb1493e90b9e029d47a68a0c1e31ec7430c..233be5cbfec91a02647fad5c5b786b6982e0f33e 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "genl.h"
 
-#include <linux/handshake.h>
+#include <uapi/linux/handshake.h>
 
 /* HANDSHAKE_CMD_ACCEPT - do */
 static const struct nla_policy handshake_accept_nl_policy[HANDSHAKE_A_ACCEPT_HANDLER_CLASS + 1] = {
index 2c1f1aa6a02ad02303c4f2f22af8bb74e73b54d1..ae72a596f6cc3e3f13cec0cf5503a5877a9a0cf0 100644 (file)
@@ -9,7 +9,7 @@
 #include <net/netlink.h>
 #include <net/genetlink.h>
 
-#include <linux/handshake.h>
+#include <uapi/linux/handshake.h>
 
 int handshake_nl_accept_doit(struct sk_buff *skb, struct genl_info *info);
 int handshake_nl_done_doit(struct sk_buff *skb, struct genl_info *info);
index 6c37c4f98ccab403e29740f41003b3696df7250f..98b90107b5abcba02129e8ddef2e446f0699d972 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "fou_nl.h"
 
-#include <linux/fou.h>
+#include <uapi/linux/fou.h>
 
 /* Global operation policy for fou */
 const struct nla_policy fou_nl_policy[FOU_ATTR_IFINDEX + 1] = {
index dbd0780a5d34c3963681c1d7f0aaf579fc186e5e..63a6c4ed803d81427febcf1c1d52e583bc86d972 100644 (file)
@@ -9,7 +9,7 @@
 #include <net/netlink.h>
 #include <net/genetlink.h>
 
-#include <linux/fou.h>
+#include <uapi/linux/fou.h>
 
 /* Global operation policy for fou */
 extern const struct nla_policy fou_nl_policy[FOU_ATTR_IFINDEX + 1];
index cc2f8c94534048b6e6cf1fa9b1a19c2f643144a7..be664510f484e00c46568b5bddb16608960c4b02 100755 (executable)
@@ -2101,7 +2101,9 @@ def main():
             if args.out_file:
                 cw.p(f'#include "{os.path.basename(args.out_file[:-2])}.h"')
             cw.nl()
-    headers = [parsed.uapi_header]
+        headers = ['uapi/' + parsed.uapi_header]
+    else:
+        headers = [parsed.uapi_header]
     for definition in parsed['definitions']:
         if 'header' in definition:
             headers.append(definition['header'])