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.
Unified · Split
| @@ -59,11 +59,11 @@ specified with a ``sockaddr`` type, with a single-byte endpoint address: · 58 unmodified lines | |||
| 59 | }; | 59 | }; |
| 60 | 60 | ||
| 61 | struct sockaddr_mctp { | 61 | struct sockaddr_mctp { |
| 62 | unsigned short int smctp_family; | 62 | __kernel_sa_family_t smctp_family; |
| 63 | int smctp_network; | 63 | unsigned int smctp_network; |
| 64 | struct mctp_addr smctp_addr; | 64 | struct mctp_addr smctp_addr; |
| 65 | __u8 smctp_type; | 65 | __u8 smctp_type; |
| 66 | __u8 smctp_tag; | 66 | __u8 smctp_tag; |
| 67 | }; | 67 | }; |
| 68 | 68 | ||
| 69 | #define MCTP_NET_ANY 0x0 | 69 | #define MCTP_NET_ANY 0x0 |
| @@ -54,7 +54,7 @@ struct mctp_sock { · 53 unmodified lines | |||
| 54 | struct sock sk; | 54 | struct sock sk; |
| 55 | 55 | ||
| 56 | /* bind() params */ | 56 | /* bind() params */ |
| 57 | int bind_net; | 57 | unsigned int bind_net; |
| 58 | mctp_eid_t bind_addr; | 58 | mctp_eid_t bind_addr; |
| 59 | __u8 bind_type; | 59 | __u8 bind_type; |
| 60 | 60 | ||
| @@ -10,6 +10,7 @@ · 9 unmodified lines | |||
| 10 | #define __UAPI_MCTP_H | 10 | #define __UAPI_MCTP_H |
| 11 | 11 | ||
| 12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
| 13 | #include <linux/socket.h> | ||
| 13 | 14 | ||
| 14 | typedef __u8 mctp_eid_t; | 15 | typedef __u8 mctp_eid_t; |
| 15 | 16 | ||
| @@ -18,8 +19,8 @@ struct mctp_addr { · 2 unmodified lines | |||
| 18 | }; | 19 | }; |
| 19 | 20 | ||
| 20 | struct sockaddr_mctp { | 21 | struct sockaddr_mctp { |
| 21 | unsigned short int smctp_family; | 22 | __kernel_sa_family_t smctp_family; |
| 22 | int smctp_network; | 23 | unsigned int smctp_network; |
| 23 | struct mctp_addr smctp_addr; | 24 | struct mctp_addr smctp_addr; |
| 24 | __u8 smctp_type; | 25 | __u8 smctp_type; |
| 25 | __u8 smctp_tag; | 26 | __u8 smctp_tag; |