diff mbox series

[net-next,2/3] bridge: mrp: Add br_mrp_fill_info

Message ID 20200630134424.4114086-3-horatiu.vultur@microchip.com
State Changes Requested
Delegated to: David Miller
Headers show
Series bridge: mrp: Add support for getting the status | expand

Commit Message

Horatiu Vultur June 30, 2020, 1:44 p.m. UTC
Add the function br_mrp_fill_info which populates the MRP attributes
regarding the status of each MRP instance.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 net/bridge/br_mrp_netlink.c | 57 +++++++++++++++++++++++++++++++++++++
 net/bridge/br_private.h     |  7 +++++
 2 files changed, 64 insertions(+)

Comments

Jakub Kicinski June 30, 2020, 4:12 p.m. UTC | #1
On Tue, 30 Jun 2020 15:44:23 +0200 Horatiu Vultur wrote:
> Add the function br_mrp_fill_info which populates the MRP attributes
> regarding the status of each MRP instance.
> 
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>

This adds warnings when built with W=1 C=1:

net/bridge/br_mrp_netlink.c:316:9: warning: dereference of noderef expression
net/bridge/br_mrp_netlink.c:325:36: warning: dereference of noderef expression
net/bridge/br_mrp_netlink.c:328:36: warning: dereference of noderef expression
net/bridge/br_mrp_netlink.c:316:9: warning: dereference of noderef expression
Horatiu Vultur June 30, 2020, 6:45 p.m. UTC | #2
The 06/30/2020 09:12, Jakub Kicinski wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On Tue, 30 Jun 2020 15:44:23 +0200 Horatiu Vultur wrote:
> > Add the function br_mrp_fill_info which populates the MRP attributes
> > regarding the status of each MRP instance.
> >
> > Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> 
> This adds warnings when built with W=1 C=1:

The warnings at line 316 will be fixed once net will be merged into
net-next. But I need to fix the others.

> 
> net/bridge/br_mrp_netlink.c:316:9: warning: dereference of noderef expression
> net/bridge/br_mrp_netlink.c:325:36: warning: dereference of noderef expression
> net/bridge/br_mrp_netlink.c:328:36: warning: dereference of noderef expression
> net/bridge/br_mrp_netlink.c:316:9: warning: dereference of noderef expression
kernel test robot June 30, 2020, 7:42 p.m. UTC | #3
Hi Horatiu,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Horatiu-Vultur/bridge-mrp-Add-support-for-getting-the-status/20200630-214828
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 5fb62372a0207f1514fa6052c51991198c46ffe2
config: i386-randconfig-s002-20200630 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-3-gfa153962-dirty
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


sparse warnings: (new ones prefixed by >>)

   net/smc/smc_ib.c:202:44: sparse:     got struct net_device [noderef] __rcu *const ndev
   net/sctp/sm_make_chunk.c:3060:48: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected int optname @@     got restricted __be16 @@
   net/sctp/sm_make_chunk.c:3060:48: sparse:     expected int optname
   net/sctp/sm_make_chunk.c:3060:48: sparse:     got restricted __be16
   net/sctp/sm_make_chunk.c:3132:48: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected int optname @@     got restricted __be16 @@
   net/sctp/sm_make_chunk.c:3132:48: sparse:     expected int optname
   net/sctp/sm_make_chunk.c:3132:48: sparse:     got restricted __be16
   net/ipv4/tcp_output.c:3346: warning: Function parameter or member 'sk' not described in 'tcp_make_synack'
   net/ipv4/tcp_output.c:3346: warning: Function parameter or member 'dst' not described in 'tcp_make_synack'
   net/ipv4/tcp_output.c:3346: warning: Function parameter or member 'req' not described in 'tcp_make_synack'
   net/ipv4/tcp_output.c:3346: warning: Function parameter or member 'foc' not described in 'tcp_make_synack'
   net/ipv4/tcp_output.c:3346: warning: Function parameter or member 'synack_type' not described in 'tcp_make_synack'
   net/core/filter.c:400:33: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:403:33: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:406:33: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:409:33: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:412:33: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:486:27: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:489:27: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:492:27: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:1380:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct sock_filter const *filter @@     got struct sock_filter [noderef] __user *filter @@
   net/core/filter.c:1380:39: sparse:     expected struct sock_filter const *filter
   net/core/filter.c:1380:39: sparse:     got struct sock_filter [noderef] __user *filter
   net/core/filter.c:1458:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct sock_filter const *filter @@     got struct sock_filter [noderef] __user *filter @@
   net/core/filter.c:1458:39: sparse:     expected struct sock_filter const *filter
   net/core/filter.c:1458:39: sparse:     got struct sock_filter [noderef] __user *filter
   net/core/filter.c:7008:27: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:7011:27: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:7014:27: sparse: sparse: subtraction of functions? Share your drugs
   net/core/filter.c:8768:31: sparse: sparse: symbol 'cg_skb_verifier_ops' was not declared. Should it be static?
   net/core/filter.c:8774:27: sparse: sparse: symbol 'cg_skb_prog_ops' was not declared. Should it be static?
   net/core/filter.c:8819:31: sparse: sparse: symbol 'cg_sock_verifier_ops' was not declared. Should it be static?
   net/core/filter.c:8825:27: sparse: sparse: symbol 'cg_sock_prog_ops' was not declared. Should it be static?
   net/core/filter.c:8828:31: sparse: sparse: symbol 'cg_sock_addr_verifier_ops' was not declared. Should it be static?
   net/core/filter.c:8834:27: sparse: sparse: symbol 'cg_sock_addr_prog_ops' was not declared. Should it be static?
   net/core/filter.c:215:32: sparse: sparse: cast to restricted __be16
   net/core/filter.c:215:32: sparse: sparse: cast to restricted __be16
   net/core/filter.c:215:32: sparse: sparse: cast to restricted __be16
   net/core/filter.c:215:32: sparse: sparse: cast to restricted __be16
   net/core/filter.c:242:32: sparse: sparse: cast to restricted __be32
   net/core/filter.c:242:32: sparse: sparse: cast to restricted __be32
   net/core/filter.c:242:32: sparse: sparse: cast to restricted __be32
   net/core/filter.c:242:32: sparse: sparse: cast to restricted __be32
   net/core/filter.c:242:32: sparse: sparse: cast to restricted __be32
   net/core/filter.c:242:32: sparse: sparse: cast to restricted __be32
   net/core/filter.c:1882:43: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected restricted __wsum [usertype] diff @@     got unsigned long long [usertype] to @@
   net/core/filter.c:1882:43: sparse:     expected restricted __wsum [usertype] diff
   net/core/filter.c:1882:43: sparse:     got unsigned long long [usertype] to
   net/core/filter.c:1885:36: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected restricted __be16 [usertype] old @@     got unsigned long long [usertype] from @@
   net/core/filter.c:1885:36: sparse:     expected restricted __be16 [usertype] old
   net/core/filter.c:1885:36: sparse:     got unsigned long long [usertype] from
   net/core/filter.c:1885:42: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected restricted __be16 [usertype] new @@     got unsigned long long [usertype] to @@
   net/core/filter.c:1885:42: sparse:     expected restricted __be16 [usertype] new
   net/core/filter.c:1885:42: sparse:     got unsigned long long [usertype] to
   net/core/filter.c:1888:36: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected restricted __be32 [usertype] from @@     got unsigned long long [usertype] from @@
   net/core/filter.c:1888:36: sparse:     expected restricted __be32 [usertype] from
   net/core/filter.c:1888:36: sparse:     got unsigned long long [usertype] from
   net/core/filter.c:1888:42: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected restricted __be32 [usertype] to @@     got unsigned long long [usertype] to @@
   net/core/filter.c:1888:42: sparse:     expected restricted __be32 [usertype] to
   net/core/filter.c:1888:42: sparse:     got unsigned long long [usertype] to
   net/core/filter.c:1933:59: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected restricted __wsum [usertype] diff @@     got unsigned long long [usertype] to @@
   net/core/filter.c:1933:59: sparse:     expected restricted __wsum [usertype] diff
   net/core/filter.c:1933:59: sparse:     got unsigned long long [usertype] to
   net/core/filter.c:1936:52: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected restricted __be16 [usertype] from @@     got unsigned long long [usertype] from @@
   net/core/filter.c:1936:52: sparse:     expected restricted __be16 [usertype] from
   net/core/filter.c:1936:52: sparse:     got unsigned long long [usertype] from
   net/core/filter.c:1936:58: sparse: sparse: incorrect type in argument 4 (different base types) @@     expected restricted __be16 [usertype] to @@     got unsigned long long [usertype] to @@
   net/core/filter.c:1936:58: sparse:     expected restricted __be16 [usertype] to
   net/core/filter.c:1936:58: sparse:     got unsigned long long [usertype] to
   net/core/filter.c:1939:52: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected restricted __be32 [usertype] from @@     got unsigned long long [usertype] from @@
   net/core/filter.c:1939:52: sparse:     expected restricted __be32 [usertype] from
   net/core/filter.c:1939:52: sparse:     got unsigned long long [usertype] from
   net/core/filter.c:1939:58: sparse: sparse: incorrect type in argument 4 (different base types) @@     expected restricted __be32 [usertype] to @@     got unsigned long long [usertype] to @@
   net/core/filter.c:1939:58: sparse:     expected restricted __be32 [usertype] to
   net/core/filter.c:1939:58: sparse:     got unsigned long long [usertype] to
   net/core/filter.c:1985:28: sparse: sparse: incorrect type in return expression (different base types) @@     expected unsigned long long @@     got restricted __wsum @@
   net/core/filter.c:1985:28: sparse:     expected unsigned long long
   net/core/filter.c:1985:28: sparse:     got restricted __wsum
   net/core/filter.c:2007:35: sparse: sparse: incorrect type in return expression (different base types) @@     expected unsigned long long @@     got restricted __wsum [usertype] csum @@
   net/core/filter.c:2007:35: sparse:     expected unsigned long long
   net/core/filter.c:2007:35: sparse:     got restricted __wsum [usertype] csum
   net/core/filter.c:4694:17: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] spi @@     got restricted __be32 const [usertype] spi @@
   net/core/filter.c:4694:17: sparse:     expected unsigned int [usertype] spi
   net/core/filter.c:4694:17: sparse:     got restricted __be32 const [usertype] spi
   net/core/filter.c:4702:33: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] remote_ipv4 @@     got restricted __be32 const [usertype] a4 @@
   net/core/filter.c:4702:33: sparse:     expected unsigned int [usertype] remote_ipv4
   net/core/filter.c:4702:33: sparse:     got restricted __be32 const [usertype] a4
   net/atm/lec.c:891:39: sparse: sparse: context imbalance in 'lec_priv_walk' - unexpected unlock
   net/atm/lec.c:947:39: sparse: sparse: context imbalance in 'lec_seq_stop' - unexpected unlock
   net/9p/client.c:420: warning: Function parameter or member 'c' not described in 'p9_client_cb'
   net/9p/client.c:420: warning: Function parameter or member 'req' not described in 'p9_client_cb'
   net/9p/client.c:420: warning: Function parameter or member 'status' not described in 'p9_client_cb'
   net/9p/client.c:568: warning: Function parameter or member 'uidata' not described in 'p9_check_zc_errors'
   net/9p/client.c:824: warning: Function parameter or member 'in_hdrlen' not described in 'p9_client_zc_rpc'
   net/9p/client.c:824: warning: Excess function parameter 'hdrlen' description in 'p9_client_zc_rpc'
   net/sunrpc/svcsock.c:226:5: warning: "ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE" is not defined, evaluates to 0 [-Wundef]
     226 | #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> net/bridge/br_mrp_netlink.c:316:9: sparse: sparse: dereference of noderef expression
   net/bridge/br_mrp_netlink.c:325:36: sparse: sparse: dereference of noderef expression
   net/bridge/br_mrp_netlink.c:325:36: sparse: sparse: dereference of noderef expression
   net/bridge/br_mrp_netlink.c:328:36: sparse: sparse: dereference of noderef expression
   net/bridge/br_mrp_netlink.c:328:36: sparse: sparse: dereference of noderef expression
>> net/bridge/br_mrp_netlink.c:316:9: sparse: sparse: dereference of noderef expression
   net/bridge/br_mrp.c:106:18: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] @@     got restricted __be16 [usertype] @@
   net/bridge/br_mrp.c:106:18: sparse:     expected unsigned short [usertype]
   net/bridge/br_mrp.c:106:18: sparse:     got restricted __be16 [usertype]
   net/bridge/br_mrp.c:281:23: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected struct list_head *entry @@     got struct list_head [noderef] * @@
   net/bridge/br_mrp.c:281:23: sparse:     expected struct list_head *entry
   net/bridge/br_mrp.c:281:23: sparse:     got struct list_head [noderef] *
   net/bridge/br_mrp.c:332:28: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected struct list_head *new @@     got struct list_head [noderef] * @@
   net/bridge/br_mrp.c:332:28: sparse:     expected struct list_head *new
   net/bridge/br_mrp.c:332:28: sparse:     got struct list_head [noderef] *
   net/bridge/br_mrp.c:332:40: sparse: sparse: incorrect type in argument 2 (different modifiers) @@     expected struct list_head *head @@     got struct list_head [noderef] * @@
   net/bridge/br_mrp.c:332:40: sparse:     expected struct list_head *head
   net/bridge/br_mrp.c:332:40: sparse:     got struct list_head [noderef] *
   net/bridge/br_mrp.c:682:29: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected struct list_head const *head @@     got struct list_head [noderef] * @@
   net/bridge/br_mrp.c:682:29: sparse:     expected struct list_head const *head
   net/bridge/br_mrp.c:682:29: sparse:     got struct list_head [noderef] *
   net/tipc/bearer.c:77: warning: Function parameter or member 'name' not described in 'tipc_media_find'
   net/tipc/bearer.c:91: warning: Function parameter or member 'type' not described in 'media_find_id'
   net/tipc/bearer.c:105: warning: Function parameter or member 'buf' not described in 'tipc_media_addr_printf'
   net/tipc/bearer.c:105: warning: Function parameter or member 'len' not described in 'tipc_media_addr_printf'
   net/tipc/bearer.c:105: warning: Function parameter or member 'a' not described in 'tipc_media_addr_printf'
   net/tipc/bearer.c:174: warning: Function parameter or member 'net' not described in 'tipc_bearer_find'
   net/tipc/bearer.c:174: warning: Function parameter or member 'name' not described in 'tipc_bearer_find'
   net/tipc/bearer.c:238: warning: Function parameter or member 'net' not described in 'tipc_enable_bearer'
   net/tipc/bearer.c:238: warning: Function parameter or member 'name' not described in 'tipc_enable_bearer'
   net/tipc/bearer.c:238: warning: Function parameter or member 'disc_domain' not described in 'tipc_enable_bearer'
   net/tipc/bearer.c:238: warning: Function parameter or member 'prio' not described in 'tipc_enable_bearer'
   net/tipc/bearer.c:238: warning: Function parameter or member 'attr' not described in 'tipc_enable_bearer'
   net/tipc/bearer.c:350: warning: Function parameter or member 'net' not described in 'tipc_reset_bearer'
   net/tipc/bearer.c:350: warning: Function parameter or member 'b' not described in 'tipc_reset_bearer'
   net/tipc/bearer.c:374: warning: Function parameter or member 'net' not described in 'bearer_disable'
   net/tipc/bearer.c:374: warning: Function parameter or member 'b' not described in 'bearer_disable'
   net/tipc/bearer.c:462: warning: Function parameter or member 'net' not described in 'tipc_l2_send_msg'
   net/tipc/bearer.c:609: warning: Function parameter or member 'skb' not described in 'tipc_l2_rcv_msg'
   net/tipc/bearer.c:609: warning: Excess function parameter 'buf' description in 'tipc_l2_rcv_msg'
   net/ipv4/tcp_offload.c:129:49: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected restricted __wsum [usertype] res @@     got fouled restricted __sum16 @@
   net/ipv4/tcp_offload.c:129:49: sparse:     expected restricted __wsum [usertype] res
   net/ipv4/tcp_offload.c:129:49: sparse:     got fouled restricted __sum16
   net/ipv4/tcp_offload.c:131:60: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected restricted __wsum [usertype] res @@     got fouled restricted __sum16 @@
   net/ipv4/tcp_offload.c:131:60: sparse:     expected restricted __wsum [usertype] res
   net/ipv4/tcp_offload.c:131:60: sparse:     got fouled restricted __sum16
   net/ipv4/tcp_offload.c:173:41: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected restricted __wsum [usertype] res @@     got fouled restricted __sum16 @@
   net/ipv4/tcp_offload.c:173:41: sparse:     expected restricted __wsum [usertype] res
   net/ipv4/tcp_offload.c:173:41: sparse:     got fouled restricted __sum16
   net/ipv4/tcp_offload.c:175:52: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected restricted __wsum [usertype] res @@     got fouled restricted __sum16 @@
   net/ipv4/tcp_offload.c:175:52: sparse:     expected restricted __wsum [usertype] res
   net/ipv4/tcp_offload.c:175:52: sparse:     got fouled restricted __sum16
   net/9p/trans_fd.c:932:28: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be32 [addressable] [assigned] [usertype] s_addr @@     got unsigned long @@
   net/9p/trans_fd.c:932:28: sparse:     expected restricted __be32 [addressable] [assigned] [usertype] s_addr
   net/9p/trans_fd.c:932:28: sparse:     got unsigned long
   net/dcb/dcbnl.c:1828: warning: Function parameter or member 'dev' not described in 'dcb_getapp'
   net/dcb/dcbnl.c:1828: warning: Function parameter or member 'app' not described in 'dcb_getapp'
   net/dcb/dcbnl.c:1850: warning: Function parameter or member 'dev' not described in 'dcb_setapp'
   net/dcb/dcbnl.c:1850: warning: Function parameter or member 'new' not described in 'dcb_setapp'
   net/dcb/dcbnl.c:1891: warning: Function parameter or member 'dev' not described in 'dcb_ieee_getapp_mask'
   net/dcb/dcbnl.c:1891: warning: Function parameter or member 'app' not described in 'dcb_ieee_getapp_mask'
   net/dcb/dcbnl.c:1914: warning: Function parameter or member 'dev' not described in 'dcb_ieee_setapp'
   net/dcb/dcbnl.c:1914: warning: Function parameter or member 'new' not described in 'dcb_ieee_setapp'
   net/dcb/dcbnl.c:1945: warning: Function parameter or member 'dev' not described in 'dcb_ieee_delapp'
   net/dcb/dcbnl.c:1945: warning: Function parameter or member 'del' not described in 'dcb_ieee_delapp'
   net/dcb/dcbnl.c:1978: warning: Function parameter or member 'dev' not described in 'dcb_ieee_getapp_prio_dscp_mask_map'
   net/dcb/dcbnl.c:1978: warning: Function parameter or member 'p_map' not described in 'dcb_ieee_getapp_prio_dscp_mask_map'
   net/dcb/dcbnl.c:2008: warning: Function parameter or member 'dev' not described in 'dcb_ieee_getapp_dscp_prio_mask_map'
   net/dcb/dcbnl.c:2008: warning: Function parameter or member 'p_map' not described in 'dcb_ieee_getapp_dscp_prio_mask_map'
   net/dcb/dcbnl.c:2037: warning: Function parameter or member 'dev' not described in 'dcb_ieee_getapp_default_prio_mask'
   net/9p/trans_common.c:23: warning: Function parameter or member 'pages' not described in 'p9_release_pages'
   net/9p/trans_common.c:23: warning: Function parameter or member 'nr_pages' not described in 'p9_release_pages'
   net/tipc/discover.c:82: warning: Function parameter or member 'skb' not described in 'tipc_disc_init_msg'
   net/tipc/discover.c:82: warning: Function parameter or member 'mtyp' not described in 'tipc_disc_init_msg'
   net/tipc/discover.c:82: warning: Excess function parameter 'type' description in 'tipc_disc_init_msg'
   net/tipc/discover.c:348: warning: Function parameter or member 'skb' not described in 'tipc_disc_create'
   net/tipc/discover.c:348: warning: Excess function parameter 'dest_domain' description in 'tipc_disc_create'
   net/tipc/discover.c:399: warning: Excess function parameter 'dest_domain' description in 'tipc_disc_reset'
   net/tipc/msg.c:68: warning: Function parameter or member 'gfp' not described in 'tipc_buf_acquire'
   net/tipc/msg.c:214: warning: Function parameter or member '_hdr' not described in 'tipc_msg_append'
   net/tipc/msg.c:214: warning: Excess function parameter 'hdr' description in 'tipc_msg_append'
   net/tipc/msg.c:380: warning: Function parameter or member 'offset' not described in 'tipc_msg_build'
   net/tipc/msg.c:706: warning: Function parameter or member 'net' not described in 'tipc_msg_lookup_dest'
   net/tipc/monitor.c:263:35: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int @@     got restricted __be32 [usertype] @@
   net/tipc/monitor.c:263:35: sparse:     expected unsigned int
   net/tipc/monitor.c:263:35: sparse:     got restricted __be32 [usertype]
   net/tipc/monitor.c:269:20: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] len @@     got restricted __be16 [usertype] @@
   net/tipc/monitor.c:269:20: sparse:     expected unsigned short [usertype] len
   net/tipc/monitor.c:269:20: sparse:     got restricted __be16 [usertype]
   net/tipc/monitor.c:270:20: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] gen @@     got restricted __be16 [usertype] @@
   net/tipc/monitor.c:270:20: sparse:     expected unsigned short [usertype] gen
   net/tipc/monitor.c:270:20: sparse:     got restricted __be16 [usertype]
   net/tipc/monitor.c:271:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] member_cnt @@     got restricted __be16 [usertype] @@
   net/tipc/monitor.c:271:27: sparse:     expected unsigned short [usertype] member_cnt
   net/tipc/monitor.c:271:27: sparse:     got restricted __be16 [usertype]
   net/tipc/monitor.c:272:23: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long long [usertype] up_map @@     got restricted __be64 [usertype] @@
   net/tipc/monitor.c:272:23: sparse:     expected unsigned long long [usertype] up_map
   net/tipc/monitor.c:272:23: sparse:     got restricted __be64 [usertype]
   net/tipc/monitor.c:458:30: sparse: sparse: cast to restricted __be16
   net/tipc/monitor.c:458:30: sparse: sparse: cast to restricted __be16
   net/tipc/monitor.c:458:30: sparse: sparse: cast to restricted __be16
   net/tipc/monitor.c:458:30: sparse: sparse: cast to restricted __be16
   net/tipc/monitor.c:460:23: sparse: sparse: cast to restricted __be16
   net/tipc/monitor.c:460:23: sparse: sparse: cast to restricted __be16
   net/tipc/monitor.c:460:23: sparse: sparse: cast to restricted __be16
   net/tipc/monitor.c:460:23: sparse: sparse: cast to restricted __be16
--
   net/bridge/br_device.c:475:25: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected struct list_head *list @@     got struct list_head [noderef] * @@
   net/bridge/br_device.c:475:25: sparse:     expected struct list_head *list
   net/bridge/br_device.c:475:25: sparse:     got struct list_head [noderef] *
   net/bridge/br_netlink_tunnel.c:29:6: warning: no previous prototype for 'vlan_tunid_inrange' [-Wmissing-prototypes]
      29 | bool vlan_tunid_inrange(const struct net_bridge_vlan *v_curr,
         |      ^~~~~~~~~~~~~~~~~~
   net/bridge/br_netlink_tunnel.c:196:5: warning: no previous prototype for 'br_vlan_tunnel_info' [-Wmissing-prototypes]
     196 | int br_vlan_tunnel_info(const struct net_bridge_port *p, int cmd,
         |     ^~~~~~~~~~~~~~~~~~~
>> net/bridge/br_mrp_netlink.c:316:9: sparse: sparse: dereference of noderef expression
   net/bridge/br_mrp_netlink.c:325:36: sparse: sparse: dereference of noderef expression
   net/bridge/br_mrp_netlink.c:325:36: sparse: sparse: dereference of noderef expression
   net/bridge/br_mrp_netlink.c:328:36: sparse: sparse: dereference of noderef expression
   net/bridge/br_mrp_netlink.c:328:36: sparse: sparse: dereference of noderef expression
>> net/bridge/br_mrp_netlink.c:316:9: sparse: sparse: dereference of noderef expression
   net/bridge/br_mrp.c:106:18: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] @@     got restricted __be16 [usertype] @@
   net/bridge/br_mrp.c:106:18: sparse:     expected unsigned short [usertype]
   net/bridge/br_mrp.c:106:18: sparse:     got restricted __be16 [usertype]
   net/bridge/br_mrp.c:281:23: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected struct list_head *entry @@     got struct list_head [noderef] * @@
   net/bridge/br_mrp.c:281:23: sparse:     expected struct list_head *entry
   net/bridge/br_mrp.c:281:23: sparse:     got struct list_head [noderef] *
   net/bridge/br_mrp.c:332:28: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected struct list_head *new @@     got struct list_head [noderef] * @@
   net/bridge/br_mrp.c:332:28: sparse:     expected struct list_head *new
   net/bridge/br_mrp.c:332:28: sparse:     got struct list_head [noderef] *
   net/bridge/br_mrp.c:332:40: sparse: sparse: incorrect type in argument 2 (different modifiers) @@     expected struct list_head *head @@     got struct list_head [noderef] * @@
   net/bridge/br_mrp.c:332:40: sparse:     expected struct list_head *head
   net/bridge/br_mrp.c:332:40: sparse:     got struct list_head [noderef] *
   net/bridge/br_mrp.c:682:29: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected struct list_head const *head @@     got struct list_head [noderef] * @@
   net/bridge/br_mrp.c:682:29: sparse:     expected struct list_head const *head
   net/bridge/br_mrp.c:682:29: sparse:     got struct list_head [noderef] *
--
>> net/bridge/br_mrp_netlink.c:316:9: sparse: sparse: dereference of noderef expression
   net/bridge/br_mrp_netlink.c:325:36: sparse: sparse: dereference of noderef expression
   net/bridge/br_mrp_netlink.c:325:36: sparse: sparse: dereference of noderef expression
   net/bridge/br_mrp_netlink.c:328:36: sparse: sparse: dereference of noderef expression
   net/bridge/br_mrp_netlink.c:328:36: sparse: sparse: dereference of noderef expression
>> net/bridge/br_mrp_netlink.c:316:9: sparse: sparse: dereference of noderef expression

vim +316 net/bridge/br_mrp_netlink.c

   306	
   307	int br_mrp_fill_info(struct sk_buff *skb, struct net_bridge *br)
   308	{
   309		struct nlattr *tb, *mrp_tb;
   310		struct br_mrp *mrp;
   311	
   312		mrp_tb = nla_nest_start_noflag(skb, IFLA_BRIDGE_MRP);
   313		if (!mrp_tb)
   314			return -EMSGSIZE;
   315	
 > 316		list_for_each_entry(mrp, &br->mrp_list, list) {
   317			tb = nla_nest_start_noflag(skb, IFLA_BRIDGE_MRP_INFO);
   318			if (!tb)
   319				goto nla_info_failure;
   320	
   321			if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_RING_ID,
   322					mrp->ring_id))
   323				goto nla_put_failure;
   324			if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_P_IFINDEX,
   325					mrp->p_port->dev->ifindex))
   326				goto nla_put_failure;
   327			if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_S_IFINDEX,
   328					mrp->s_port->dev->ifindex))
   329				goto nla_put_failure;
   330			if (nla_put_u16(skb, IFLA_BRIDGE_MRP_INFO_PRIO,
   331					mrp->prio))
   332				goto nla_put_failure;
   333			if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_RING_STATE,
   334					mrp->ring_state))
   335				goto nla_put_failure;
   336			if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_RING_ROLE,
   337					mrp->ring_role))
   338				goto nla_put_failure;
   339			if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_TEST_INTERVAL,
   340					mrp->test_interval))
   341				goto nla_put_failure;
   342			if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_TEST_MAX_MISS,
   343					mrp->test_max_miss))
   344				goto nla_put_failure;
   345			if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_TEST_MONITOR,
   346					mrp->test_monitor))
   347				goto nla_put_failure;
   348	
   349			nla_nest_end(skb, tb);
   350		}
   351		nla_nest_end(skb, mrp_tb);
   352	
   353		return 0;
   354	
   355	nla_put_failure:
   356		nla_nest_cancel(skb, tb);
   357	
   358	nla_info_failure:
   359		nla_nest_cancel(skb, mrp_tb);
   360	
   361		return -EMSGSIZE;
   362	}
   363	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/net/bridge/br_mrp_netlink.c b/net/bridge/br_mrp_netlink.c
index 34b3a8776991f..c7dd0cc5b90e5 100644
--- a/net/bridge/br_mrp_netlink.c
+++ b/net/bridge/br_mrp_netlink.c
@@ -304,6 +304,63 @@  int br_mrp_parse(struct net_bridge *br, struct net_bridge_port *p,
 	return 0;
 }
 
+int br_mrp_fill_info(struct sk_buff *skb, struct net_bridge *br)
+{
+	struct nlattr *tb, *mrp_tb;
+	struct br_mrp *mrp;
+
+	mrp_tb = nla_nest_start_noflag(skb, IFLA_BRIDGE_MRP);
+	if (!mrp_tb)
+		return -EMSGSIZE;
+
+	list_for_each_entry(mrp, &br->mrp_list, list) {
+		tb = nla_nest_start_noflag(skb, IFLA_BRIDGE_MRP_INFO);
+		if (!tb)
+			goto nla_info_failure;
+
+		if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_RING_ID,
+				mrp->ring_id))
+			goto nla_put_failure;
+		if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_P_IFINDEX,
+				mrp->p_port->dev->ifindex))
+			goto nla_put_failure;
+		if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_S_IFINDEX,
+				mrp->s_port->dev->ifindex))
+			goto nla_put_failure;
+		if (nla_put_u16(skb, IFLA_BRIDGE_MRP_INFO_PRIO,
+				mrp->prio))
+			goto nla_put_failure;
+		if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_RING_STATE,
+				mrp->ring_state))
+			goto nla_put_failure;
+		if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_RING_ROLE,
+				mrp->ring_role))
+			goto nla_put_failure;
+		if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_TEST_INTERVAL,
+				mrp->test_interval))
+			goto nla_put_failure;
+		if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_TEST_MAX_MISS,
+				mrp->test_max_miss))
+			goto nla_put_failure;
+		if (nla_put_u32(skb, IFLA_BRIDGE_MRP_INFO_TEST_MONITOR,
+				mrp->test_monitor))
+			goto nla_put_failure;
+
+		nla_nest_end(skb, tb);
+	}
+	nla_nest_end(skb, mrp_tb);
+
+	return 0;
+
+nla_put_failure:
+	nla_nest_cancel(skb, tb);
+
+nla_info_failure:
+	nla_nest_cancel(skb, mrp_tb);
+
+	return -EMSGSIZE;
+}
+
 int br_mrp_port_open(struct net_device *dev, u8 loc)
 {
 	struct net_bridge_port *p;
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 6a7d8e218ae7e..65d2c163a24ab 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -1317,6 +1317,7 @@  int br_mrp_parse(struct net_bridge *br, struct net_bridge_port *p,
 int br_mrp_process(struct net_bridge_port *p, struct sk_buff *skb);
 bool br_mrp_enabled(struct net_bridge *br);
 void br_mrp_port_del(struct net_bridge *br, struct net_bridge_port *p);
+int br_mrp_fill_info(struct sk_buff *skb, struct net_bridge *br);
 #else
 static inline int br_mrp_parse(struct net_bridge *br, struct net_bridge_port *p,
 			       struct nlattr *attr, int cmd,
@@ -1339,6 +1340,12 @@  static inline void br_mrp_port_del(struct net_bridge *br,
 				   struct net_bridge_port *p)
 {
 }
+
+static inline int br_mrp_fill_info(struct sk_buff *skb, struct net_bridge *br)
+{
+	return 0;
+}
+
 #endif
 
 /* br_netlink.c */