socket: Use __u8 instead of u8 in uapi socket.h
Subsystems (3)
PATCH 1/1 socket: Use __u8 instead of u8 in uapi socket.h
Use the uapi variant of the u8 type.
--- include/uapi/linux/socket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/socket.h +1 -1
@@ -31,7 +31,7 @@ struct __kernel_sockaddr_storage {#define SOCK_BUF_LOCK_MASK (SOCK_SNDBUF_LOCK | SOCK_RCVBUF_LOCK) -#define SOCK_TXREHASH_DEFAULT ((u8)-1) +#define SOCK_TXREHASH_DEFAULT ((__u8)-1)#define SOCK_TXREHASH_DISABLED 0#define SOCK_TXREHASH_ENABLED 1
Signature · 1 line
2.36.1
kernel test robot
build botI love your patch! Perhaps something to improve:
Hi Tobias,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
[also build test WARNING on net/master horms-ipvs/master linus/master v5.18 next-20220525] [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/intel-lab-lkp/linux/commits/Tobias-Klauser/socket-Use-__u8-instead-of-u8-in-uapi-socket-h/20220525-170053 base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 57d7becda9c9e612e6b00676f2eecfac3e719e88 config: x86_64-randconfig-a015 (https://download.01.org/0day-ci/archive/20220525/[email protected]/config) compiler: gcc-11 (Debian 11.3.0-1) 11.3.0 reproduce (this is a W=1 build): # https://github.com/intel-lab-lkp/linux/commit/283fe3009b96069f17a813f86db8b48d12b5014e git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Tobias-Klauser/socket-Use-__u8-instead-of-u8-in-uapi-socket-h/20220525-170053 git checkout 283fe3009b96069f17a813f86db8b48d12b5014e # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
All warnings (new ones prefixed by >>):
>> usr/include/linux/socket.h:34: found __[us]{8,16,32,64} type without #include <linux/types.h>Signature · 2 lines
0-DAY CI Kernel Test Service https://01.org/lkp
PATCH v2 1/1 socket: Use __u8 instead of u8 in uapi socket.h
In reply to Tobias KlauserUse the uapi variant of the u8 type.
---
v2: add missing <linux/types.h> include as reported by kernel test robot
include/uapi/linux/socket.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
include/uapi/linux/socket.h +3 -1
@@ -2,6 +2,8 @@#ifndef _UAPI_LINUX_SOCKET_H#define _UAPI_LINUX_SOCKET_H +#include <linux/types.h> +/* * Desired design of maximum size and alignment (see RFC2553) */
@@ -31,7 +33,7 @@ struct __kernel_sockaddr_storage {#define SOCK_BUF_LOCK_MASK (SOCK_SNDBUF_LOCK | SOCK_RCVBUF_LOCK) -#define SOCK_TXREHASH_DEFAULT ((u8)-1) +#define SOCK_TXREHASH_DEFAULT ((__u8)-1)#define SOCK_TXREHASH_DISABLED 0#define SOCK_TXREHASH_ENABLED 1
Signature · 1 line
2.36.1
From: Tobias Klauser
Quoted 26 lines
Sent: 30 May 2022 09:15
Use the uapi variant of the u8 type.
Fixes 26859240e4ee ("txhash: Add socket option to control TX hash rethink behavior")Signed-off-by Tobias Klauser <[email protected]>---
v2: add missing <linux/types.h> include as reported by kernel test robotinclude/uapi/linux/socket.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)include/uapi/linux/socket.h +2
-0@@ -2,6 +2,8 @@#ifndef _UAPI_LINUX_SOCKET_H#define _UAPI_LINUX_SOCKET_H +#include <linux/types.h> +/* * Desired design of maximum size and alignment (see RFC2553) */
include/uapi/linux/socket.h struct __kernel_sockaddr_storage { · line 36
Quoted 5 lines
include/uapi/linux/socket.h +1
-1@@ -31,7 +33,7 @@ struct __kernel_sockaddr_storage {#define SOCK_BUF_LOCK_MASK (SOCK_SNDBUF_LOCK | SOCK_RCVBUF_LOCK) -#define SOCK_TXREHASH_DEFAULT ((u8)-1) +#define SOCK_TXREHASH_DEFAULT ((__u8)-1)
I can't help feeling that 255u (or 0xffu) would be a better way to describe that value.
David
Quoted 5 lines
include/uapi/linux/socket.h +0
-1#define SOCK_TXREHASH_DISABLED 0#define SOCK_TXREHASH_ENABLED 1 --2.36.1
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
Paolo Abeni
maintainerQuoted 28 lines · David Laight
From: Tobias Klauser
Quoted 27 lines
Sent: 30 May 2022 09:15
Use the uapi variant of the u8 type.
Fixes 26859240e4ee ("txhash: Add socket option to control TX hash rethink behavior")Signed-off-by Tobias Klauser <[email protected]>---
v2: add missing <linux/types.h> include as reported by kernel test robotinclude/uapi/linux/socket.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)include/uapi/linux/socket.h +2
-0@@ -2,6 +2,8 @@#ifndef _UAPI_LINUX_SOCKET_H#define _UAPI_LINUX_SOCKET_H +#include <linux/types.h> +/* * Desired design of maximum size and alignment (see RFC2553) */ @@ -31,7 +33,7 @@ struct __kernel_sockaddr_storage {
Quoted 7 lines
include/uapi/linux/socket.h struct __kernel_sockaddr_storage { · line 36
Quoted 4 lines
include/uapi/linux/socket.h +1
-1#define SOCK_BUF_LOCK_MASK (SOCK_SNDBUF_LOCK | SOCK_RCVBUF_LOCK) -#define SOCK_TXREHASH_DEFAULT ((u8)-1) +#define SOCK_TXREHASH_DEFAULT ((__u8)-1)I can't help feeling that 255u (or
0xffu) would be a better way to describe that value.
Even plain '255' would do. Additionally, any of the above will avoid the additional header dependency.
Thanks,
Paolo
Quoted 31 lines · Paolo Abeni
Quoted 30 lines · David Laight
From: Tobias Klauser
Quoted 29 lines
Sent: 30 May 2022 09:15
Use the uapi variant of the u8 type.
Fixes 26859240e4ee ("txhash: Add socket option to control TX hash rethink behavior")Signed-off-by Tobias Klauser <[email protected]>---
v2: add missing <linux/types.h> include as reported by kernel test robotinclude/uapi/linux/socket.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)include/uapi/linux/socket.h +2
-0@@ -2,6 +2,8 @@#ifndef _UAPI_LINUX_SOCKET_H#define _UAPI_LINUX_SOCKET_H +#include <linux/types.h> +/* * Desired design of maximum size and alignment (see RFC2553) */ @@ -31,7 +33,7 @@ struct __kernel_sockaddr_storage {#define SOCK_BUF_LOCK_MASK (SOCK_SNDBUF_LOCK | SOCK_RCVBUF_LOCK)
Quoted 8 lines
Quoted 5 lines
include/uapi/linux/socket.h struct __kernel_sockaddr_storage { · line 36
Quoted 2 lines
include/uapi/linux/socket.h +1
-1-#define SOCK_TXREHASH_DEFAULT ((u8)-1) +#define SOCK_TXREHASH_DEFAULT ((__u8)-1)I can't help feeling that 255u (or
0xffu) would be a better way to describe that value.Even plain '255' would do. Additionally, any of the above will avoid the additional header dependency.
Thanks, I've sent v3 changing it to plain '255'.
PATCH v3 1/1 socket: Don't use u8 type in uapi socket.h
In reply to Tobias KlauserUse plain 255 instead, which also avoid introducing an additional header dependency on <linux/types.h>
---
v3: changed to plain 255 as suggested by David Laight and Paolo Abeni
include/uapi/linux/socket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/socket.h +1 -1
@@ -31,7 +31,7 @@ struct __kernel_sockaddr_storage {#define SOCK_BUF_LOCK_MASK (SOCK_SNDBUF_LOCK | SOCK_RCVBUF_LOCK) -#define SOCK_TXREHASH_DEFAULT ((u8)-1) +#define SOCK_TXREHASH_DEFAULT 255#define SOCK_TXREHASH_DISABLED 0#define SOCK_TXREHASH_ENABLED 1
Signature · 1 line
2.36.1
Re: [PATCH v3] socket: Don't use u8 type in uapi socket.h
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Tue, 31 May 2022 11:43:45 +0200 you wrote:
Use plain 255 instead, which also avoid introducing an additional header dependency on <
linux/types.h>Fixes 26859240e4ee ("txhash: Add socket option to control TX hash rethink behavior")Signed-off-by Tobias Klauser <[email protected]>---
v3: changed to plain 255 as suggested by David Laight and Paolo Abeni[...]
Here is the summary with links:
- [v3] socket: Don't use u8 type in uapi socket.h
https://git.kernel.org/netdev/net/c/8d3398ba2a0d
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html