All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: add pf_family_names[] for protocol family
@ 2021-06-18 14:32 Yejune Deng
  2021-06-18 20:04 ` David Miller
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yejune Deng @ 2021-06-18 14:32 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, linux-kernel, Yejune Deng

Modify the pr_info content from int to char *, this looks more readable.

Signed-off-by: Yejune Deng <yejune.deng@gmail.com>
---
 include/uapi/linux/net.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 net/socket.c             |  2 +-
 2 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/net.h b/include/uapi/linux/net.h
index 4dabec6..a28caaf 100644
--- a/include/uapi/linux/net.h
+++ b/include/uapi/linux/net.h
@@ -55,4 +55,52 @@ typedef enum {
 
 #define __SO_ACCEPTCON	(1 << 16)	/* performed a listen		*/
 
+static const char * const pf_family_names[] = {
+	[PF_UNSPEC]	= "PF_UNSPEC",
+	[PF_UNIX]	= "PF_UNIX/PF_LOCAL",
+	[PF_INET]	= "PF_INET",
+	[PF_AX25]	= "PF_AX25",
+	[PF_IPX]	= "PF_IPX",
+	[PF_APPLETALK]	= "PF_APPLETALK",
+	[PF_NETROM]	= "PF_NETROM",
+	[PF_BRIDGE]	= "PF_BRIDGE",
+	[PF_ATMPVC]	= "PF_ATMPVC",
+	[PF_X25]	= "PF_X25",
+	[PF_INET6]	= "PF_INET6",
+	[PF_ROSE]	= "PF_ROSE",
+	[PF_DECnet]	= "PF_DECnet",
+	[PF_NETBEUI]	= "PF_NETBEUI",
+	[PF_SECURITY]	= "PF_SECURITY",
+	[PF_KEY]	= "PF_KEY",
+	[PF_NETLINK]	= "PF_NETLINK/PF_ROUTE",
+	[PF_PACKET]	= "PF_PACKET",
+	[PF_ASH]	= "PF_ASH",
+	[PF_ECONET]	= "PF_ECONET",
+	[PF_ATMSVC]	= "PF_ATMSVC",
+	[PF_RDS]	= "PF_RDS",
+	[PF_SNA]	= "PF_SNA",
+	[PF_IRDA]	= "PF_IRDA",
+	[PF_PPPOX]	= "PF_PPPOX",
+	[PF_WANPIPE]	= "PF_WANPIPE",
+	[PF_LLC]	= "PF_LLC",
+	[PF_IB]		= "PF_IB",
+	[PF_MPLS]	= "PF_MPLS",
+	[PF_CAN]	= "PF_CAN",
+	[PF_TIPC]	= "PF_TIPC",
+	[PF_BLUETOOTH]	= "PF_BLUETOOTH",
+	[PF_IUCV]	= "PF_IUCV",
+	[PF_RXRPC]	= "PF_RXRPC",
+	[PF_ISDN]	= "PF_ISDN",
+	[PF_PHONET]	= "PF_PHONET",
+	[PF_IEEE802154]	= "PF_IEEE802154",
+	[PF_CAIF]	= "PF_CAIF",
+	[PF_ALG]	= "PF_ALG",
+	[PF_NFC]	= "PF_NFC",
+	[PF_VSOCK]	= "PF_VSOCK",
+	[PF_KCM]	= "PF_KCM",
+	[PF_QIPCRTR]	= "PF_QIPCRTR",
+	[PF_SMC]	= "PF_SMC",
+	[PF_XDP]	= "PF_XDP",
+};
+
 #endif /* _UAPI_LINUX_NET_H */
diff --git a/net/socket.c b/net/socket.c
index 27e3e7d..ff544cf 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2988,7 +2988,7 @@ int sock_register(const struct net_proto_family *ops)
 	}
 	spin_unlock(&net_family_lock);
 
-	pr_info("NET: Registered protocol family %d\n", ops->family);
+	pr_info("NET: Registered %s protocol family\n", pf_family_names[ops->family]);
 	return err;
 }
 EXPORT_SYMBOL(sock_register);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: add pf_family_names[] for protocol family
  2021-06-18 14:32 [PATCH] net: add pf_family_names[] for protocol family Yejune Deng
@ 2021-06-18 20:04 ` David Miller
  2021-06-18 21:38 ` kernel test robot
  2021-06-18 22:20 ` kernel test robot
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2021-06-18 20:04 UTC (permalink / raw)
  To: yejune.deng; +Cc: kuba, netdev, linux-kernel


This patch doers not even compile successfully:

./usr/include/linux/net.h:59:3: error: ‘PF_UNSPEC’ undeclared here (not in a function)
   59 |  [PF_UNSPEC] = "PF_UNSPEC",
      |   ^~~~~~~~~
./usr/include/linux/net.h:59:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:59:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:60:3: error: ‘PF_UNIX’ undeclared here (not in a function)
   60 |  [PF_UNIX] = "PF_UNIX/PF_LOCAL",
      |   ^~~~~~~
./usr/include/linux/net.h:60:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:60:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:61:3: error: ‘PF_INET’ undeclared here (not in a function)
   61 |  [PF_INET] = "PF_INET",
      |   ^~~~~~~
./usr/include/linux/net.h:61:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:61:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:62:3: error: ‘PF_AX25’ undeclared here (not in a function)
   62 |  [PF_AX25] = "PF_AX25",
      |   ^~~~~~~
./usr/include/linux/net.h:62:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:62:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:63:3: error: ‘PF_IPX’ undeclared here (not in a function)
   63 |  [PF_IPX] = "PF_IPX",
      |   ^~~~~~
./usr/include/linux/net.h:63:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:63:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:64:3: error: ‘PF_APPLETALK’ undeclared here (not in a function)
   64 |  [PF_APPLETALK] = "PF_APPLETALK",
      |   ^~~~~~~~~~~~
./usr/include/linux/net.h:64:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:64:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:65:3: error: ‘PF_NETROM’ undeclared here (not in a function)
   65 |  [PF_NETROM] = "PF_NETROM",
      |   ^~~~~~~~~
./usr/include/linux/net.h:65:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:65:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:66:3: error: ‘PF_BRIDGE’ undeclared here (not in a function)
   66 |  [PF_BRIDGE] = "PF_BRIDGE",
      |   ^~~~~~~~~
./usr/include/linux/net.h:66:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:66:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:67:3: error: ‘PF_ATMPVC’ undeclared here (not in a function)
   67 |  [PF_ATMPVC] = "PF_ATMPVC",
      |   ^~~~~~~~~
./usr/include/linux/net.h:67:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:67:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:68:3: error: ‘PF_X25’ undeclared here (not in a function)
   68 |  [PF_X25] = "PF_X25",
      |   ^~~~~~
./usr/include/linux/net.h:68:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:68:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:69:3: error: ‘PF_INET6’ undeclared here (not in a function)
   69 |  [PF_INET6] = "PF_INET6",
      |   ^~~~~~~~
./usr/include/linux/net.h:69:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:69:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:70:3: error: ‘PF_ROSE’ undeclared here (not in a function)
   70 |  [PF_ROSE] = "PF_ROSE",
      |   ^~~~~~~
./usr/include/linux/net.h:70:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:70:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:71:3: error: ‘PF_DECnet’ undeclared here (not in a function)
   71 |  [PF_DECnet] = "PF_DECnet",
      |   ^~~~~~~~~
./usr/include/linux/net.h:71:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:71:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:72:3: error: ‘PF_NETBEUI’ undeclared here (not in a function)
   72 |  [PF_NETBEUI] = "PF_NETBEUI",
      |   ^~~~~~~~~~
./usr/include/linux/net.h:72:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:72:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:73:3: error: ‘PF_SECURITY’ undeclared here (not in a function)
   73 |  [PF_SECURITY] = "PF_SECURITY",
      |   ^~~~~~~~~~~
./usr/include/linux/net.h:73:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:73:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:74:3: error: ‘PF_KEY’ undeclared here (not in a function)
   74 |  [PF_KEY] = "PF_KEY",
      |   ^~~~~~
./usr/include/linux/net.h:74:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:74:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:75:3: error: ‘PF_NETLINK’ undeclared here (not in a function)
   75 |  [PF_NETLINK] = "PF_NETLINK/PF_ROUTE",
      |   ^~~~~~~~~~
./usr/include/linux/net.h:75:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:75:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:76:3: error: ‘PF_PACKET’ undeclared here (not in a function)
   76 |  [PF_PACKET] = "PF_PACKET",
      |   ^~~~~~~~~
./usr/include/linux/net.h:76:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:76:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:77:3: error: ‘PF_ASH’ undeclared here (not in a function)
   77 |  [PF_ASH] = "PF_ASH",
      |   ^~~~~~
./usr/include/linux/net.h:77:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:77:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:78:3: error: ‘PF_ECONET’ undeclared here (not in a function)
   78 |  [PF_ECONET] = "PF_ECONET",
      |   ^~~~~~~~~
./usr/include/linux/net.h:78:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:78:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:79:3: error: ‘PF_ATMSVC’ undeclared here (not in a function)
   79 |  [PF_ATMSVC] = "PF_ATMSVC",
      |   ^~~~~~~~~
./usr/include/linux/net.h:79:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:79:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:80:3: error: ‘PF_RDS’ undeclared here (not in a function)
   80 |  [PF_RDS] = "PF_RDS",
      |   ^~~~~~
./usr/include/linux/net.h:80:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:80:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:81:3: error: ‘PF_SNA’ undeclared here (not in a function)
   81 |  [PF_SNA] = "PF_SNA",
      |   ^~~~~~
./usr/include/linux/net.h:81:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:81:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:82:3: error: ‘PF_IRDA’ undeclared here (not in a function)
   82 |  [PF_IRDA] = "PF_IRDA",
      |   ^~~~~~~
./usr/include/linux/net.h:82:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:82:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:83:3: error: ‘PF_PPPOX’ undeclared here (not in a function)
   83 |  [PF_PPPOX] = "PF_PPPOX",
      |   ^~~~~~~~
./usr/include/linux/net.h:83:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:83:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:84:3: error: ‘PF_WANPIPE’ undeclared here (not in a function)
   84 |  [PF_WANPIPE] = "PF_WANPIPE",
      |   ^~~~~~~~~~
./usr/include/linux/net.h:84:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:84:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:85:3: error: ‘PF_LLC’ undeclared here (not in a function)
   85 |  [PF_LLC] = "PF_LLC",
      |   ^~~~~~
./usr/include/linux/net.h:85:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:85:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:86:3: error: ‘PF_IB’ undeclared here (not in a function)
   86 |  [PF_IB]  = "PF_IB",
      |   ^~~~~
./usr/include/linux/net.h:86:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:86:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:87:3: error: ‘PF_MPLS’ undeclared here (not in a function)
   87 |  [PF_MPLS] = "PF_MPLS",
      |   ^~~~~~~
./usr/include/linux/net.h:87:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:87:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:88:3: error: ‘PF_CAN’ undeclared here (not in a function)
   88 |  [PF_CAN] = "PF_CAN",
      |   ^~~~~~
./usr/include/linux/net.h:88:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:88:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:89:3: error: ‘PF_TIPC’ undeclared here (not in a function)
   89 |  [PF_TIPC] = "PF_TIPC",
      |   ^~~~~~~
./usr/include/linux/net.h:89:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:89:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:90:3: error: ‘PF_BLUETOOTH’ undeclared here (not in a function)
   90 |  [PF_BLUETOOTH] = "PF_BLUETOOTH",
      |   ^~~~~~~~~~~~
./usr/include/linux/net.h:90:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:90:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:91:3: error: ‘PF_IUCV’ undeclared here (not in a function)
   91 |  [PF_IUCV] = "PF_IUCV",
      |   ^~~~~~~
./usr/include/linux/net.h:91:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:91:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:92:3: error: ‘PF_RXRPC’ undeclared here (not in a function)
   92 |  [PF_RXRPC] = "PF_RXRPC",
      |   ^~~~~~~~
./usr/include/linux/net.h:92:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:92:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:93:3: error: ‘PF_ISDN’ undeclared here (not in a function)
   93 |  [PF_ISDN] = "PF_ISDN",
      |   ^~~~~~~
./usr/include/linux/net.h:93:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:93:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:94:3: error: ‘PF_PHONET’ undeclared here (not in a function)
   94 |  [PF_PHONET] = "PF_PHONET",
      |   ^~~~~~~~~
./usr/include/linux/net.h:94:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:94:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:95:3: error: ‘PF_IEEE802154’ undeclared here (not in a function)
   95 |  [PF_IEEE802154] = "PF_IEEE802154",
      |   ^~~~~~~~~~~~~
./usr/include/linux/net.h:95:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:95:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:96:3: error: ‘PF_CAIF’ undeclared here (not in a function)
   96 |  [PF_CAIF] = "PF_CAIF",
      |   ^~~~~~~
./usr/include/linux/net.h:96:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:96:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:97:3: error: ‘PF_ALG’ undeclared here (not in a function)
   97 |  [PF_ALG] = "PF_ALG",
      |   ^~~~~~
./usr/include/linux/net.h:97:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:97:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:98:3: error: ‘PF_NFC’ undeclared here (not in a function)
   98 |  [PF_NFC] = "PF_NFC",
      |   ^~~~~~
./usr/include/linux/net.h:98:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:98:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:99:3: error: ‘PF_VSOCK’ undeclared here (not in a function)
   99 |  [PF_VSOCK] = "PF_VSOCK",
      |   ^~~~~~~~
./usr/include/linux/net.h:99:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:99:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:100:3: error: ‘PF_KCM’ undeclared here (not in a function)
  100 |  [PF_KCM] = "PF_KCM",
      |   ^~~~~~
./usr/include/linux/net.h:100:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:100:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:101:3: error: ‘PF_QIPCRTR’ undeclared here (not in a function)
  101 |  [PF_QIPCRTR] = "PF_QIPCRTR",
      |   ^~~~~~~~~~
./usr/include/linux/net.h:101:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:101:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:102:3: error: ‘PF_SMC’ undeclared here (not in a function)
  102 |  [PF_SMC] = "PF_SMC",
      |   ^~~~~~
./usr/include/linux/net.h:102:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:102:3: note: (near initialization for ‘pf_family_names’)
./usr/include/linux/net.h:103:3: error: ‘PF_XDP’ undeclared here (not in a function)
  103 |  [PF_XDP] = "PF_XDP",
      |   ^~~~~~
./usr/include/linux/net.h:103:3: error: array index in initializer not of integer type
./usr/include/linux/net.h:103:3: note: (near initialization for ‘pf_family_names’)

Please fix, thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: add pf_family_names[] for protocol family
  2021-06-18 14:32 [PATCH] net: add pf_family_names[] for protocol family Yejune Deng
  2021-06-18 20:04 ` David Miller
@ 2021-06-18 21:38 ` kernel test robot
  2021-06-18 22:20 ` kernel test robot
  2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-06-18 21:38 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 14041 bytes --]

Hi Yejune,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net-next/master]
[also build test ERROR on net/master linus/master v5.13-rc6 next-20210618]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yejune-Deng/net-add-pf_family_names-for-protocol-family/20210618-223434
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 8fe088bd4fd12f4c8899b51d5bc3daad98767d49
config: i386-randconfig-r026-20210618 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/f385a306caae1deea33a32795753f9cb883fb7d0
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yejune-Deng/net-add-pf_family_names-for-protocol-family/20210618-223434
        git checkout f385a306caae1deea33a32795753f9cb883fb7d0
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from <command-line>:32:
>> ./usr/include/linux/net.h:59:3: error: 'PF_UNSPEC' undeclared here (not in a function)
      59 |  [PF_UNSPEC] = "PF_UNSPEC",
         |   ^~~~~~~~~
>> ./usr/include/linux/net.h:59:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:59:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:60:3: error: 'PF_UNIX' undeclared here (not in a function)
      60 |  [PF_UNIX] = "PF_UNIX/PF_LOCAL",
         |   ^~~~~~~
   ./usr/include/linux/net.h:60:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:60:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:61:3: error: 'PF_INET' undeclared here (not in a function)
      61 |  [PF_INET] = "PF_INET",
         |   ^~~~~~~
   ./usr/include/linux/net.h:61:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:61:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:62:3: error: 'PF_AX25' undeclared here (not in a function)
      62 |  [PF_AX25] = "PF_AX25",
         |   ^~~~~~~
   ./usr/include/linux/net.h:62:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:62:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:63:3: error: 'PF_IPX' undeclared here (not in a function)
      63 |  [PF_IPX] = "PF_IPX",
         |   ^~~~~~
   ./usr/include/linux/net.h:63:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:63:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:64:3: error: 'PF_APPLETALK' undeclared here (not in a function)
      64 |  [PF_APPLETALK] = "PF_APPLETALK",
         |   ^~~~~~~~~~~~
   ./usr/include/linux/net.h:64:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:64:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:65:3: error: 'PF_NETROM' undeclared here (not in a function)
      65 |  [PF_NETROM] = "PF_NETROM",
         |   ^~~~~~~~~
   ./usr/include/linux/net.h:65:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:65:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:66:3: error: 'PF_BRIDGE' undeclared here (not in a function)
      66 |  [PF_BRIDGE] = "PF_BRIDGE",
         |   ^~~~~~~~~
   ./usr/include/linux/net.h:66:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:66:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:67:3: error: 'PF_ATMPVC' undeclared here (not in a function)
      67 |  [PF_ATMPVC] = "PF_ATMPVC",
         |   ^~~~~~~~~
   ./usr/include/linux/net.h:67:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:67:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:68:3: error: 'PF_X25' undeclared here (not in a function)
      68 |  [PF_X25] = "PF_X25",
         |   ^~~~~~
   ./usr/include/linux/net.h:68:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:68:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:69:3: error: 'PF_INET6' undeclared here (not in a function)
      69 |  [PF_INET6] = "PF_INET6",
         |   ^~~~~~~~
   ./usr/include/linux/net.h:69:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:69:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:70:3: error: 'PF_ROSE' undeclared here (not in a function)
      70 |  [PF_ROSE] = "PF_ROSE",
         |   ^~~~~~~
   ./usr/include/linux/net.h:70:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:70:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:71:3: error: 'PF_DECnet' undeclared here (not in a function)
      71 |  [PF_DECnet] = "PF_DECnet",
         |   ^~~~~~~~~
   ./usr/include/linux/net.h:71:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:71:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:72:3: error: 'PF_NETBEUI' undeclared here (not in a function)
      72 |  [PF_NETBEUI] = "PF_NETBEUI",
         |   ^~~~~~~~~~
   ./usr/include/linux/net.h:72:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:72:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:73:3: error: 'PF_SECURITY' undeclared here (not in a function)
      73 |  [PF_SECURITY] = "PF_SECURITY",
         |   ^~~~~~~~~~~
   ./usr/include/linux/net.h:73:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:73:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:74:3: error: 'PF_KEY' undeclared here (not in a function)
      74 |  [PF_KEY] = "PF_KEY",
         |   ^~~~~~
   ./usr/include/linux/net.h:74:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:74:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:75:3: error: 'PF_NETLINK' undeclared here (not in a function)
      75 |  [PF_NETLINK] = "PF_NETLINK/PF_ROUTE",
         |   ^~~~~~~~~~
   ./usr/include/linux/net.h:75:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:75:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:76:3: error: 'PF_PACKET' undeclared here (not in a function)
      76 |  [PF_PACKET] = "PF_PACKET",
         |   ^~~~~~~~~
   ./usr/include/linux/net.h:76:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:76:3: note: (near initialization for 'pf_family_names')
>> ./usr/include/linux/net.h:77:3: error: 'PF_ASH' undeclared here (not in a function)
      77 |  [PF_ASH] = "PF_ASH",
         |   ^~~~~~
   ./usr/include/linux/net.h:77:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:77:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:78:3: error: 'PF_ECONET' undeclared here (not in a function)
      78 |  [PF_ECONET] = "PF_ECONET",
         |   ^~~~~~~~~
   ./usr/include/linux/net.h:78:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:78:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:79:3: error: 'PF_ATMSVC' undeclared here (not in a function)
      79 |  [PF_ATMSVC] = "PF_ATMSVC",
         |   ^~~~~~~~~
   ./usr/include/linux/net.h:79:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:79:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:80:3: error: 'PF_RDS' undeclared here (not in a function)
      80 |  [PF_RDS] = "PF_RDS",
         |   ^~~~~~
   ./usr/include/linux/net.h:80:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:80:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:81:3: error: 'PF_SNA' undeclared here (not in a function)
      81 |  [PF_SNA] = "PF_SNA",
         |   ^~~~~~
   ./usr/include/linux/net.h:81:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:81:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:82:3: error: 'PF_IRDA' undeclared here (not in a function)
      82 |  [PF_IRDA] = "PF_IRDA",
         |   ^~~~~~~
   ./usr/include/linux/net.h:82:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:82:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:83:3: error: 'PF_PPPOX' undeclared here (not in a function)
      83 |  [PF_PPPOX] = "PF_PPPOX",
         |   ^~~~~~~~
   ./usr/include/linux/net.h:83:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:83:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:84:3: error: 'PF_WANPIPE' undeclared here (not in a function)
      84 |  [PF_WANPIPE] = "PF_WANPIPE",
         |   ^~~~~~~~~~
   ./usr/include/linux/net.h:84:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:84:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:85:3: error: 'PF_LLC' undeclared here (not in a function)
      85 |  [PF_LLC] = "PF_LLC",
         |   ^~~~~~
   ./usr/include/linux/net.h:85:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:85:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:86:3: error: 'PF_IB' undeclared here (not in a function)
      86 |  [PF_IB]  = "PF_IB",
         |   ^~~~~
   ./usr/include/linux/net.h:86:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:86:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:87:3: error: 'PF_MPLS' undeclared here (not in a function)
      87 |  [PF_MPLS] = "PF_MPLS",
         |   ^~~~~~~
   ./usr/include/linux/net.h:87:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:87:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:88:3: error: 'PF_CAN' undeclared here (not in a function)
      88 |  [PF_CAN] = "PF_CAN",
         |   ^~~~~~
   ./usr/include/linux/net.h:88:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:88:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:89:3: error: 'PF_TIPC' undeclared here (not in a function)
      89 |  [PF_TIPC] = "PF_TIPC",
         |   ^~~~~~~
   ./usr/include/linux/net.h:89:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:89:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:90:3: error: 'PF_BLUETOOTH' undeclared here (not in a function)
      90 |  [PF_BLUETOOTH] = "PF_BLUETOOTH",
         |   ^~~~~~~~~~~~
   ./usr/include/linux/net.h:90:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:90:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:91:3: error: 'PF_IUCV' undeclared here (not in a function)
      91 |  [PF_IUCV] = "PF_IUCV",
         |   ^~~~~~~
   ./usr/include/linux/net.h:91:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:91:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:92:3: error: 'PF_RXRPC' undeclared here (not in a function)
      92 |  [PF_RXRPC] = "PF_RXRPC",
         |   ^~~~~~~~
   ./usr/include/linux/net.h:92:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:92:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:93:3: error: 'PF_ISDN' undeclared here (not in a function)
      93 |  [PF_ISDN] = "PF_ISDN",
         |   ^~~~~~~
   ./usr/include/linux/net.h:93:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:93:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:94:3: error: 'PF_PHONET' undeclared here (not in a function)
      94 |  [PF_PHONET] = "PF_PHONET",
         |   ^~~~~~~~~
   ./usr/include/linux/net.h:94:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:94:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:95:3: error: 'PF_IEEE802154' undeclared here (not in a function)
      95 |  [PF_IEEE802154] = "PF_IEEE802154",
         |   ^~~~~~~~~~~~~
   ./usr/include/linux/net.h:95:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:95:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:96:3: error: 'PF_CAIF' undeclared here (not in a function)
      96 |  [PF_CAIF] = "PF_CAIF",
         |   ^~~~~~~
   ./usr/include/linux/net.h:96:3: error: array index in initializer not of integer type
   ./usr/include/linux/net.h:96:3: note: (near initialization for 'pf_family_names')
   ./usr/include/linux/net.h:97:3: error: 'PF_ALG' undeclared here (not in a function)

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 43877 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: add pf_family_names[] for protocol family
  2021-06-18 14:32 [PATCH] net: add pf_family_names[] for protocol family Yejune Deng
  2021-06-18 20:04 ` David Miller
  2021-06-18 21:38 ` kernel test robot
@ 2021-06-18 22:20 ` kernel test robot
  2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-06-18 22:20 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4940 bytes --]

Hi Yejune,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net-next/master]
[also build test ERROR on net/master linus/master sparc-next/master v5.13-rc6 next-20210618]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yejune-Deng/net-add-pf_family_names-for-protocol-family/20210618-223434
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 8fe088bd4fd12f4c8899b51d5bc3daad98767d49
config: sparc64-randconfig-r032-20210618 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/f385a306caae1deea33a32795753f9cb883fb7d0
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yejune-Deng/net-add-pf_family_names-for-protocol-family/20210618-223434
        git checkout f385a306caae1deea33a32795753f9cb883fb7d0
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sparc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/net.h:27,
                    from include/linux/skbuff.h:26,
                    from include/linux/filter.h:13,
                    from arch/sparc/kernel/sys_sparc32.c:29:
>> include/uapi/linux/net.h:58:27: error: 'pf_family_names' defined but not used [-Werror=unused-const-variable=]
      58 | static const char * const pf_family_names[] = {
         |                           ^~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors
--
   arch/sparc/kernel/setup_64.c:615:13: error: no previous prototype for 'alloc_irqstack_bootmem' [-Werror=missing-prototypes]
     615 | void __init alloc_irqstack_bootmem(void)
         |             ^~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/net.h:27,
                    from include/linux/skbuff.h:26,
                    from include/net/net_namespace.h:39,
                    from include/linux/inet.h:42,
                    from arch/sparc/kernel/setup_64.c:27:
>> include/uapi/linux/net.h:58:27: error: 'pf_family_names' defined but not used [-Werror=unused-const-variable=]
      58 | static const char * const pf_family_names[] = {
         |                           ^~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for LOCKDEP
   Depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT && (FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86)
   Selected by
   - DEBUG_LOCK_ALLOC && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT


vim +/pf_family_names +58 include/uapi/linux/net.h

    57	
  > 58	static const char * const pf_family_names[] = {
    59		[PF_UNSPEC]	= "PF_UNSPEC",
    60		[PF_UNIX]	= "PF_UNIX/PF_LOCAL",
    61		[PF_INET]	= "PF_INET",
    62		[PF_AX25]	= "PF_AX25",
    63		[PF_IPX]	= "PF_IPX",
    64		[PF_APPLETALK]	= "PF_APPLETALK",
    65		[PF_NETROM]	= "PF_NETROM",
    66		[PF_BRIDGE]	= "PF_BRIDGE",
    67		[PF_ATMPVC]	= "PF_ATMPVC",
    68		[PF_X25]	= "PF_X25",
    69		[PF_INET6]	= "PF_INET6",
    70		[PF_ROSE]	= "PF_ROSE",
    71		[PF_DECnet]	= "PF_DECnet",
    72		[PF_NETBEUI]	= "PF_NETBEUI",
    73		[PF_SECURITY]	= "PF_SECURITY",
    74		[PF_KEY]	= "PF_KEY",
    75		[PF_NETLINK]	= "PF_NETLINK/PF_ROUTE",
    76		[PF_PACKET]	= "PF_PACKET",
    77		[PF_ASH]	= "PF_ASH",
    78		[PF_ECONET]	= "PF_ECONET",
    79		[PF_ATMSVC]	= "PF_ATMSVC",
    80		[PF_RDS]	= "PF_RDS",
    81		[PF_SNA]	= "PF_SNA",
    82		[PF_IRDA]	= "PF_IRDA",
    83		[PF_PPPOX]	= "PF_PPPOX",
    84		[PF_WANPIPE]	= "PF_WANPIPE",
    85		[PF_LLC]	= "PF_LLC",
    86		[PF_IB]		= "PF_IB",
    87		[PF_MPLS]	= "PF_MPLS",
    88		[PF_CAN]	= "PF_CAN",
    89		[PF_TIPC]	= "PF_TIPC",
    90		[PF_BLUETOOTH]	= "PF_BLUETOOTH",
    91		[PF_IUCV]	= "PF_IUCV",
    92		[PF_RXRPC]	= "PF_RXRPC",
    93		[PF_ISDN]	= "PF_ISDN",
    94		[PF_PHONET]	= "PF_PHONET",
    95		[PF_IEEE802154]	= "PF_IEEE802154",
    96		[PF_CAIF]	= "PF_CAIF",
    97		[PF_ALG]	= "PF_ALG",
    98		[PF_NFC]	= "PF_NFC",
    99		[PF_VSOCK]	= "PF_VSOCK",
   100		[PF_KCM]	= "PF_KCM",
   101		[PF_QIPCRTR]	= "PF_QIPCRTR",
   102		[PF_SMC]	= "PF_SMC",
   103		[PF_XDP]	= "PF_XDP",
   104	};
   105	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31031 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-18 22:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18 14:32 [PATCH] net: add pf_family_names[] for protocol family Yejune Deng
2021-06-18 20:04 ` David Miller
2021-06-18 21:38 ` kernel test robot
2021-06-18 22:20 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.