All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [bug report] net: dsa: sja1105: Add support for Spanning Tree Protocol
Date: Wed, 08 May 2019 07:19:51 +0000	[thread overview]
Message-ID: <20190508071951.GA12293@mwanda> (raw)

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

                 reply	other threads:[~2019-05-08  7:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20190508071951.GA12293@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.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.