diff mbox series

[net,1/2] mctp: unify sockaddr_mctp types

Message ID 20211018032935.2092613-1-jk@codeconstruct.com.au (mailing list archive)
State Accepted
Commit b416beb25d9317499c823aea1522eefd8d72ea36
Delegated to: Netdev Maintainers
Headers show
Series [net,1/2] mctp: unify sockaddr_mctp types | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present success Fixes tag present in non-next series
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers warning 2 maintainers not CCed: linux-doc@vger.kernel.org corbet@lwn.net
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Fixes tag looks correct
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 41 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Jeremy Kerr Oct. 18, 2021, 3:29 a.m. UTC
Use the more precise __kernel_sa_family_t for smctp_family, to match
struct sockaddr.

Also, use an unsigned int for the network member; negative networks
don't make much sense. We're already using unsigned for mctp_dev and
mctp_skb_cb, but need to change mctp_sock to suit.

Fixes: 60fc63981693 ("mctp: Add sockaddr_mctp to uapi")
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
---
 Documentation/networking/mctp.rst | 10 +++++-----
 include/net/mctp.h                |  2 +-
 include/uapi/linux/mctp.h         |  5 +++--
 3 files changed, 9 insertions(+), 8 deletions(-)

Comments

Eugene Syromiatnikov Oct. 18, 2021, noon UTC | #1
On Mon, Oct 18, 2021 at 11:29:34AM +0800, Jeremy Kerr wrote:
> Use the more precise __kernel_sa_family_t for smctp_family, to match
> struct sockaddr.
> 
> Also, use an unsigned int for the network member; negative networks
> don't make much sense. We're already using unsigned for mctp_dev and
> mctp_skb_cb, but need to change mctp_sock to suit.
> 
> Fixes: 60fc63981693 ("mctp: Add sockaddr_mctp to uapi")
> Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>

Acked-by: Eugene Syromiatnikov <esyr@redhat.com>
patchwork-bot+netdevbpf@kernel.org Oct. 18, 2021, 1 p.m. UTC | #2
Hello:

This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Mon, 18 Oct 2021 11:29:34 +0800 you wrote:
> Use the more precise __kernel_sa_family_t for smctp_family, to match
> struct sockaddr.
> 
> Also, use an unsigned int for the network member; negative networks
> don't make much sense. We're already using unsigned for mctp_dev and
> mctp_skb_cb, but need to change mctp_sock to suit.
> 
> [...]

Here is the summary with links:
  - [net,1/2] mctp: unify sockaddr_mctp types
    https://git.kernel.org/netdev/net/c/b416beb25d93
  - [net,2/2] mctp: Be explicit about struct sockaddr_mctp padding
    https://git.kernel.org/netdev/net/c/5a20dd46b8b8

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/Documentation/networking/mctp.rst b/Documentation/networking/mctp.rst
index 6100cdc220f6..fa7730dbf7b9 100644
--- a/Documentation/networking/mctp.rst
+++ b/Documentation/networking/mctp.rst
@@ -59,11 +59,11 @@  specified with a ``sockaddr`` type, with a single-byte endpoint address:
     };
 
     struct sockaddr_mctp {
-            unsigned short int	smctp_family;
-            int			smctp_network;
-            struct mctp_addr	smctp_addr;
-            __u8		smctp_type;
-            __u8		smctp_tag;
+            __kernel_sa_family_t smctp_family;
+            unsigned int         smctp_network;
+            struct mctp_addr     smctp_addr;
+            __u8                 smctp_type;
+            __u8                 smctp_tag;
     };
 
     #define MCTP_NET_ANY	0x0
diff --git a/include/net/mctp.h b/include/net/mctp.h
index a824d47c3c6d..ffd2c23bd76d 100644
--- a/include/net/mctp.h
+++ b/include/net/mctp.h
@@ -54,7 +54,7 @@  struct mctp_sock {
 	struct sock	sk;
 
 	/* bind() params */
-	int		bind_net;
+	unsigned int	bind_net;
 	mctp_eid_t	bind_addr;
 	__u8		bind_type;
 
diff --git a/include/uapi/linux/mctp.h b/include/uapi/linux/mctp.h
index 52b54d13f385..f384962d8ff2 100644
--- a/include/uapi/linux/mctp.h
+++ b/include/uapi/linux/mctp.h
@@ -10,6 +10,7 @@ 
 #define __UAPI_MCTP_H
 
 #include <linux/types.h>
+#include <linux/socket.h>
 
 typedef __u8			mctp_eid_t;
 
@@ -18,8 +19,8 @@  struct mctp_addr {
 };
 
 struct sockaddr_mctp {
-	unsigned short int	smctp_family;
-	int			smctp_network;
+	__kernel_sa_family_t	smctp_family;
+	unsigned int		smctp_network;
 	struct mctp_addr	smctp_addr;
 	__u8			smctp_type;
 	__u8			smctp_tag;