CC: [email protected]
CC: [email protected]
TO: Vladimir Oltean <[email protected]>
CC: Florian Fainelli <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   13391c60da3308ed9980de0168f74cce6c62ac1d
commit: ec5ae61076d07be986df19773662506220757c9f net: dsa: sja1105: 
save/restore VLANs using a delta commit method
date:   9 months ago
:::::: branch date: 7 hours ago
:::::: commit date: 9 months ago
config: i386-randconfig-m031-20210126 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-20) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

New smatch warnings:
drivers/net/dsa/sja1105/sja1105_main.c:336 sja1105_init_static_vlan() warn: 
should '(((1))) << port' be a 64 bit type?

Old smatch warnings:
drivers/net/dsa/sja1105/sja1105_main.c:46 sja1105_port_allow_traffic() warn: 
should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:47 sja1105_port_allow_traffic() warn: 
should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:48 sja1105_port_allow_traffic() warn: 
should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:188 sja1105_init_mii_settings() warn: is 
'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:191 sja1105_init_mii_settings() warn: is 
'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:197 sja1105_init_mii_settings() warn: is 
'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:202 sja1105_init_mii_settings() warn: is 
'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:337 sja1105_init_static_vlan() warn: 
should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:527 sja1105_init_avb_params() warn: is 
'table->entries' large enough for 'struct sja1105_avb_params_entry'? 1
drivers/net/dsa/sja1105/sja1105_main.c:1119 sja1105_find_static_fdb_entry() 
warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1237 sja1105et_fdb_add() warn: should 
'((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1239 sja1105et_fdb_add() warn: should 
'(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1247 sja1105et_fdb_add() warn: should 
'(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1333 sja1105pqrs_fdb_add() warn: should 
'(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1341 sja1105pqrs_fdb_add() warn: should 
'((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1346 sja1105pqrs_fdb_add() warn: should 
'(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1396 sja1105pqrs_fdb_del() warn: should 
'(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1480 sja1105_fdb_dump() warn: should 
'((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1716 sja1105_static_config_reload() 
warn: bitwise AND condition is false here
drivers/net/dsa/sja1105/sja1105_main.c:1958 sja1105_build_bridge_vlans() warn: 
should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1959 sja1105_build_bridge_vlans() warn: 
should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1961 sja1105_build_bridge_vlans() warn: 
should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1980 sja1105_build_dsa_8021q_vlans() 
warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1981 sja1105_build_dsa_8021q_vlans() 
warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1983 sja1105_build_dsa_8021q_vlans() 
warn: should '(((1))) << (v->port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2431 sja1105_mgmt_xmit() warn: should 
'(((1))) << port' be a 64 bit type?

vim +336 drivers/net/dsa/sja1105/sja1105_main.c

8aa9ebccae8762 Vladimir Oltean 2019-05-02  294  
8aa9ebccae8762 Vladimir Oltean 2019-05-02  295  static int 
sja1105_init_static_vlan(struct sja1105_private *priv)
8aa9ebccae8762 Vladimir Oltean 2019-05-02  296  {
8aa9ebccae8762 Vladimir Oltean 2019-05-02  297          struct sja1105_table 
*table;
8aa9ebccae8762 Vladimir Oltean 2019-05-02  298          struct 
sja1105_vlan_lookup_entry pvid = {
8aa9ebccae8762 Vladimir Oltean 2019-05-02  299                  .ving_mirr = 0,
8aa9ebccae8762 Vladimir Oltean 2019-05-02  300                  .vegr_mirr = 0,
8aa9ebccae8762 Vladimir Oltean 2019-05-02  301                  .vmemb_port = 0,
8aa9ebccae8762 Vladimir Oltean 2019-05-02  302                  .vlan_bc = 0,
8aa9ebccae8762 Vladimir Oltean 2019-05-02  303                  .tag_port = 0,
e3502b82978781 Vladimir Oltean 2019-06-26  304                  .vlanid = 1,
8aa9ebccae8762 Vladimir Oltean 2019-05-02  305          };
ec5ae61076d07b Vladimir Oltean 2020-05-12  306          struct dsa_switch *ds = 
priv->ds;
ec5ae61076d07b Vladimir Oltean 2020-05-12  307          int port;
8aa9ebccae8762 Vladimir Oltean 2019-05-02  308  
8aa9ebccae8762 Vladimir Oltean 2019-05-02  309          table = 
&priv->static_config.tables[BLK_IDX_VLAN_LOOKUP];
8aa9ebccae8762 Vladimir Oltean 2019-05-02  310  
e3502b82978781 Vladimir Oltean 2019-06-26  311          /* The static VLAN 
table will only contain the initial pvid of 1.
6666cebc5e306f Vladimir Oltean 2019-05-02  312           * All other VLANs are 
to be configured through dynamic entries,
6666cebc5e306f Vladimir Oltean 2019-05-02  313           * and kept in the 
static configuration table as backing memory.
8aa9ebccae8762 Vladimir Oltean 2019-05-02  314           */
8aa9ebccae8762 Vladimir Oltean 2019-05-02  315          if (table->entry_count) 
{
8aa9ebccae8762 Vladimir Oltean 2019-05-02  316                  
kfree(table->entries);
8aa9ebccae8762 Vladimir Oltean 2019-05-02  317                  
table->entry_count = 0;
8aa9ebccae8762 Vladimir Oltean 2019-05-02  318          }
8aa9ebccae8762 Vladimir Oltean 2019-05-02  319  
8aa9ebccae8762 Vladimir Oltean 2019-05-02  320          table->entries = 
kcalloc(1, table->ops->unpacked_entry_size,
8aa9ebccae8762 Vladimir Oltean 2019-05-02  321                                  
 GFP_KERNEL);
8aa9ebccae8762 Vladimir Oltean 2019-05-02  322          if (!table->entries)
8aa9ebccae8762 Vladimir Oltean 2019-05-02  323                  return -ENOMEM;
8aa9ebccae8762 Vladimir Oltean 2019-05-02  324  
8aa9ebccae8762 Vladimir Oltean 2019-05-02  325          table->entry_count = 1;
8aa9ebccae8762 Vladimir Oltean 2019-05-02  326  
e3502b82978781 Vladimir Oltean 2019-06-26  327          /* VLAN 1: all 
DT-defined ports are members; no restrictions on
ec5ae61076d07b Vladimir Oltean 2020-05-12  328           * forwarding; always 
transmit as untagged.
8aa9ebccae8762 Vladimir Oltean 2019-05-02  329           */
ec5ae61076d07b Vladimir Oltean 2020-05-12  330          for (port = 0; port < 
ds->num_ports; port++) {
ec5ae61076d07b Vladimir Oltean 2020-05-12  331                  struct 
sja1105_bridge_vlan *v;
ec5ae61076d07b Vladimir Oltean 2020-05-12  332  
ec5ae61076d07b Vladimir Oltean 2020-05-12  333                  if 
(dsa_is_unused_port(ds, port))
ec5ae61076d07b Vladimir Oltean 2020-05-12  334                          
continue;
ec5ae61076d07b Vladimir Oltean 2020-05-12  335  
ec5ae61076d07b Vladimir Oltean 2020-05-12 @336                  pvid.vmemb_port 
|= BIT(port);
ec5ae61076d07b Vladimir Oltean 2020-05-12  337                  pvid.vlan_bc |= 
BIT(port);
ec5ae61076d07b Vladimir Oltean 2020-05-12  338                  pvid.tag_port 
&= ~BIT(port);
ec5ae61076d07b Vladimir Oltean 2020-05-12  339  
ec5ae61076d07b Vladimir Oltean 2020-05-12  340                  /* Let traffic 
that don't need dsa_8021q (e.g. STP, PTP) be
ec5ae61076d07b Vladimir Oltean 2020-05-12  341                   * transmitted 
as untagged.
ec5ae61076d07b Vladimir Oltean 2020-05-12  342                   */
ec5ae61076d07b Vladimir Oltean 2020-05-12  343                  v = 
kzalloc(sizeof(*v), GFP_KERNEL);
ec5ae61076d07b Vladimir Oltean 2020-05-12  344                  if (!v)
ec5ae61076d07b Vladimir Oltean 2020-05-12  345                          return 
-ENOMEM;
ec5ae61076d07b Vladimir Oltean 2020-05-12  346  
ec5ae61076d07b Vladimir Oltean 2020-05-12  347                  v->port = port;
ec5ae61076d07b Vladimir Oltean 2020-05-12  348                  v->vid = 1;
ec5ae61076d07b Vladimir Oltean 2020-05-12  349                  v->untagged = 
true;
ec5ae61076d07b Vladimir Oltean 2020-05-12  350                  if 
(dsa_is_cpu_port(ds, port))
ec5ae61076d07b Vladimir Oltean 2020-05-12  351                          v->pvid 
= true;
ec5ae61076d07b Vladimir Oltean 2020-05-12  352                  
list_add(&v->list, &priv->dsa_8021q_vlans);
8aa9ebccae8762 Vladimir Oltean 2019-05-02  353          }
8aa9ebccae8762 Vladimir Oltean 2019-05-02  354  
8aa9ebccae8762 Vladimir Oltean 2019-05-02  355          ((struct 
sja1105_vlan_lookup_entry *)table->entries)[0] = pvid;
8aa9ebccae8762 Vladimir Oltean 2019-05-02  356          return 0;
8aa9ebccae8762 Vladimir Oltean 2019-05-02  357  }
8aa9ebccae8762 Vladimir Oltean 2019-05-02  358  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to