All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/net/dsa/sja1105/sja1105_main.c:737 sja1105_init_topology() warn: should '(((1))) << port' be a 64 bit type?
Date: Tue, 09 Nov 2021 04:41:46 +0800	[thread overview]
Message-ID: <202111090437.qM4ojSts-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 10226 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Vladimir Oltean <vladimir.oltean@nxp.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e851dfae4371d3c751f1e18e8eb5eba993de1467
commit: 30a100e60cf36ade9902dc71610f93563d0bd7b0 net: dsa: sja1105: configure the cascade ports based on topology
date:   3 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 3 months ago
config: i386-randconfig-m021-20211022 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

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

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

Old smatch warnings:
drivers/net/dsa/sja1105/sja1105_main.c:49 sja1105_port_allow_traffic() warn: should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:57 sja1105_can_forward() warn: should '((((1))) << to)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:129 sja1105_commit_pvid() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:248 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 0
drivers/net/dsa/sja1105/sja1105_main.c:260 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 0
drivers/net/dsa/sja1105/sja1105_main.c:269 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 0
drivers/net/dsa/sja1105/sja1105_main.c:278 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 0
drivers/net/dsa/sja1105/sja1105_main.c:284 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 0
drivers/net/dsa/sja1105/sja1105_main.c:291 sja1105_init_mii_settings() warn: is 'table->entries' large enough for 'struct sja1105_xmii_params_entry'? 0
drivers/net/dsa/sja1105/sja1105_main.c:518 sja1105_init_l2_forwarding() warn: should '(((1))) << upstream' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:519 sja1105_init_l2_forwarding() warn: should '(((1))) << upstream' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:604 sja1105_init_l2_forwarding_params() warn: is 'table->entries' large enough for 'struct sja1105_l2_forwarding_params_entry'? 0
drivers/net/dsa/sja1105/sja1105_main.c:848 sja1105_init_avb_params() warn: is 'table->entries' large enough for 'struct sja1105_avb_params_entry'? 0
drivers/net/dsa/sja1105/sja1105_main.c:1315 sja1105_find_static_fdb_entry() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1433 sja1105et_fdb_add() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1435 sja1105et_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1443 sja1105et_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1529 sja1105pqrs_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1537 sja1105pqrs_fdb_add() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1542 sja1105pqrs_fdb_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1592 sja1105pqrs_fdb_del() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1661 sja1105_fdb_dump() warn: should '((((1))) << port)' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1713 sja1105_manage_flood_domains() warn: should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:1715 sja1105_manage_flood_domains() warn: should '(((1))) << to' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2208 sja1105_vlan_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2209 sja1105_vlan_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2213 sja1105_vlan_add() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2522 sja1105_mgmt_xmit() warn: should '(((1))) << port' be a 64 bit type?
drivers/net/dsa/sja1105/sja1105_main.c:2840 sja1105_port_mcast_flood() warn: should '(((1))) << to' be a 64 bit type?

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

ceec8bc0988dca Vladimir Oltean 2021-06-08  690  
30a100e60cf36a Vladimir Oltean 2021-08-04  691  static int sja1105_init_topology(struct sja1105_private *priv,
30a100e60cf36a Vladimir Oltean 2021-08-04  692  				 struct sja1105_general_params_entry *general_params)
30a100e60cf36a Vladimir Oltean 2021-08-04  693  {
30a100e60cf36a Vladimir Oltean 2021-08-04  694  	struct dsa_switch *ds = priv->ds;
30a100e60cf36a Vladimir Oltean 2021-08-04  695  	int port;
30a100e60cf36a Vladimir Oltean 2021-08-04  696  
30a100e60cf36a Vladimir Oltean 2021-08-04  697  	/* The host port is the destination for traffic matching mac_fltres1
30a100e60cf36a Vladimir Oltean 2021-08-04  698  	 * and mac_fltres0 on all ports except itself. Default to an invalid
30a100e60cf36a Vladimir Oltean 2021-08-04  699  	 * value.
30a100e60cf36a Vladimir Oltean 2021-08-04  700  	 */
30a100e60cf36a Vladimir Oltean 2021-08-04  701  	general_params->host_port = ds->num_ports;
30a100e60cf36a Vladimir Oltean 2021-08-04  702  
30a100e60cf36a Vladimir Oltean 2021-08-04  703  	/* Link-local traffic received on casc_port will be forwarded
30a100e60cf36a Vladimir Oltean 2021-08-04  704  	 * to host_port without embedding the source port and device ID
30a100e60cf36a Vladimir Oltean 2021-08-04  705  	 * info in the destination MAC address, and no RX timestamps will be
30a100e60cf36a Vladimir Oltean 2021-08-04  706  	 * taken either (presumably because it is a cascaded port and a
30a100e60cf36a Vladimir Oltean 2021-08-04  707  	 * downstream SJA switch already did that).
30a100e60cf36a Vladimir Oltean 2021-08-04  708  	 * To disable the feature, we need to do different things depending on
30a100e60cf36a Vladimir Oltean 2021-08-04  709  	 * switch generation. On SJA1105 we need to set an invalid port, while
30a100e60cf36a Vladimir Oltean 2021-08-04  710  	 * on SJA1110 which support multiple cascaded ports, this field is a
30a100e60cf36a Vladimir Oltean 2021-08-04  711  	 * bitmask so it must be left zero.
30a100e60cf36a Vladimir Oltean 2021-08-04  712  	 */
30a100e60cf36a Vladimir Oltean 2021-08-04  713  	if (!priv->info->multiple_cascade_ports)
30a100e60cf36a Vladimir Oltean 2021-08-04  714  		general_params->casc_port = ds->num_ports;
30a100e60cf36a Vladimir Oltean 2021-08-04  715  
30a100e60cf36a Vladimir Oltean 2021-08-04  716  	for (port = 0; port < ds->num_ports; port++) {
30a100e60cf36a Vladimir Oltean 2021-08-04  717  		bool is_upstream = dsa_is_upstream_port(ds, port);
30a100e60cf36a Vladimir Oltean 2021-08-04  718  		bool is_dsa_link = dsa_is_dsa_port(ds, port);
30a100e60cf36a Vladimir Oltean 2021-08-04  719  
30a100e60cf36a Vladimir Oltean 2021-08-04  720  		/* Upstream ports can be dedicated CPU ports or
30a100e60cf36a Vladimir Oltean 2021-08-04  721  		 * upstream-facing DSA links
30a100e60cf36a Vladimir Oltean 2021-08-04  722  		 */
30a100e60cf36a Vladimir Oltean 2021-08-04  723  		if (is_upstream) {
30a100e60cf36a Vladimir Oltean 2021-08-04  724  			if (general_params->host_port == ds->num_ports) {
30a100e60cf36a Vladimir Oltean 2021-08-04  725  				general_params->host_port = port;
30a100e60cf36a Vladimir Oltean 2021-08-04  726  			} else {
30a100e60cf36a Vladimir Oltean 2021-08-04  727  				dev_err(ds->dev,
30a100e60cf36a Vladimir Oltean 2021-08-04  728  					"Port %llu is already a host port, configuring %d as one too is not supported\n",
30a100e60cf36a Vladimir Oltean 2021-08-04  729  					general_params->host_port, port);
30a100e60cf36a Vladimir Oltean 2021-08-04  730  				return -EINVAL;
30a100e60cf36a Vladimir Oltean 2021-08-04  731  			}
30a100e60cf36a Vladimir Oltean 2021-08-04  732  		}
30a100e60cf36a Vladimir Oltean 2021-08-04  733  
30a100e60cf36a Vladimir Oltean 2021-08-04  734  		/* Cascade ports are downstream-facing DSA links */
30a100e60cf36a Vladimir Oltean 2021-08-04  735  		if (is_dsa_link && !is_upstream) {
30a100e60cf36a Vladimir Oltean 2021-08-04  736  			if (priv->info->multiple_cascade_ports) {
30a100e60cf36a Vladimir Oltean 2021-08-04 @737  				general_params->casc_port |= BIT(port);
30a100e60cf36a Vladimir Oltean 2021-08-04  738  			} else if (general_params->casc_port == ds->num_ports) {
30a100e60cf36a Vladimir Oltean 2021-08-04  739  				general_params->casc_port = port;
30a100e60cf36a Vladimir Oltean 2021-08-04  740  			} else {
30a100e60cf36a Vladimir Oltean 2021-08-04  741  				dev_err(ds->dev,
30a100e60cf36a Vladimir Oltean 2021-08-04  742  					"Port %llu is already a cascade port, configuring %d as one too is not supported\n",
30a100e60cf36a Vladimir Oltean 2021-08-04  743  					general_params->casc_port, port);
30a100e60cf36a Vladimir Oltean 2021-08-04  744  				return -EINVAL;
30a100e60cf36a Vladimir Oltean 2021-08-04  745  			}
30a100e60cf36a Vladimir Oltean 2021-08-04  746  		}
30a100e60cf36a Vladimir Oltean 2021-08-04  747  	}
30a100e60cf36a Vladimir Oltean 2021-08-04  748  
30a100e60cf36a Vladimir Oltean 2021-08-04  749  	if (general_params->host_port == ds->num_ports) {
30a100e60cf36a Vladimir Oltean 2021-08-04  750  		dev_err(ds->dev, "No host port configured\n");
30a100e60cf36a Vladimir Oltean 2021-08-04  751  		return -EINVAL;
30a100e60cf36a Vladimir Oltean 2021-08-04  752  	}
30a100e60cf36a Vladimir Oltean 2021-08-04  753  
30a100e60cf36a Vladimir Oltean 2021-08-04  754  	return 0;
30a100e60cf36a Vladimir Oltean 2021-08-04  755  }
30a100e60cf36a Vladimir Oltean 2021-08-04  756  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36037 bytes --]

             reply	other threads:[~2021-11-08 20:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 20:41 kernel test robot [this message]
2021-11-15 23:06 drivers/net/dsa/sja1105/sja1105_main.c:737 sja1105_init_topology() warn: should '(((1))) << port' be a 64 bit type? kernel test robot
2022-02-11 19:00 kernel test robot
2022-04-27  4:16 kernel test robot
2022-05-29  0:41 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202111090437.qM4ojSts-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.