All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] net: dsa: sja1105: Add support for Spanning Tree Protocol
@ 2019-05-08  7:19 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2019-05-08  7:19 UTC (permalink / raw)
  To: kernel-janitors

Hello Vladimir Oltean,

The patch 640f763f98c2: "net: dsa: sja1105: Add support for Spanning
Tree Protocol" from May 5, 2019, leads to the following static
checker warning:

	drivers/net/dsa/sja1105/sja1105_main.c:1073 sja1105_stp_state_get()
	warn: signedness bug returning '(-22)'

drivers/net/dsa/sja1105/sja1105_main.c
  1059  static u8 sja1105_stp_state_get(struct sja1105_private *priv, int port)
               ^^
  1060  {
  1061          struct sja1105_mac_config_entry *mac;
  1062  
  1063          mac = priv->static_config.tables[BLK_IDX_MAC_CONFIG].entries;
  1064  
  1065          if (!mac[port].ingress && !mac[port].egress && !mac[port].dyn_learn)
  1066                  return BR_STATE_BLOCKING;
  1067          if (mac[port].ingress && !mac[port].egress && !mac[port].dyn_learn)
  1068                  return BR_STATE_LISTENING;
  1069          if (mac[port].ingress && !mac[port].egress && mac[port].dyn_learn)
  1070                  return BR_STATE_LEARNING;
  1071          if (mac[port].ingress && mac[port].egress && mac[port].dyn_learn)
  1072                  return BR_STATE_FORWARDING;
  1073          return -EINVAL;
                ^^^^^^^^^^^^^^
The caller doesn't check for negative errors anyway.

  1074  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-08  7:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-08  7:19 [bug report] net: dsa: sja1105: Add support for Spanning Tree Protocol Dan Carpenter

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.