linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ioana Ciornei <ioana.ciornei@nxp.com>
To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Cc: joe@perches.com, andrew@lunn.ch, ruxandra.radulescu@nxp.com,
	Ioana Ciornei <ioana.ciornei@nxp.com>
Subject: [PATCH v2 05/10] staging: fsl-dpaa2/ethsw: use bool when encoding learning/flooding state
Date: Tue, 13 Aug 2019 11:54:34 +0300	[thread overview]
Message-ID: <1565686479-32577-6-git-send-email-ioana.ciornei@nxp.com> (raw)
In-Reply-To: <1565686479-32577-1-git-send-email-ioana.ciornei@nxp.com>

Use a bool instead of an u8 in ethsw_set_learning() and
ethsw_port_set_flood() to encode an binary type property.

Reported-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
Changes in v2:
 - added Reported-by tag

 drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
index 9ade73928e60..20519af4d804 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
@@ -149,12 +149,12 @@ static int ethsw_port_add_vlan(struct ethsw_port_priv *port_priv,
 	return 0;
 }
 
-static int ethsw_set_learning(struct ethsw_core *ethsw, u8 flag)
+static int ethsw_set_learning(struct ethsw_core *ethsw, bool enable)
 {
 	enum dpsw_fdb_learning_mode learn_mode;
 	int err;
 
-	if (flag)
+	if (enable)
 		learn_mode = DPSW_FDB_LEARNING_MODE_HW;
 	else
 		learn_mode = DPSW_FDB_LEARNING_MODE_DIS;
@@ -165,24 +165,24 @@ static int ethsw_set_learning(struct ethsw_core *ethsw, u8 flag)
 		dev_err(ethsw->dev, "dpsw_fdb_set_learning_mode err %d\n", err);
 		return err;
 	}
-	ethsw->learning = !!flag;
+	ethsw->learning = enable;
 
 	return 0;
 }
 
-static int ethsw_port_set_flood(struct ethsw_port_priv *port_priv, u8 flag)
+static int ethsw_port_set_flood(struct ethsw_port_priv *port_priv, bool enable)
 {
 	int err;
 
 	err = dpsw_if_set_flooding(port_priv->ethsw_data->mc_io, 0,
 				   port_priv->ethsw_data->dpsw_handle,
-				   port_priv->idx, flag);
+				   port_priv->idx, enable);
 	if (err) {
 		netdev_err(port_priv->netdev,
 			   "dpsw_if_set_flooding err %d\n", err);
 		return err;
 	}
-	port_priv->flood = !!flag;
+	port_priv->flood = enable;
 
 	return 0;
 }
-- 
1.9.1


  parent reply	other threads:[~2019-08-13  8:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13  8:54 [PATCH v2 00/10] staging: fsl-dpaa2/ethsw: code cleanup Ioana Ciornei
2019-08-13  8:54 ` [PATCH v2 01/10] staging: fsl-dpaa2/ethsw: remove IGMP default address Ioana Ciornei
2019-08-13  8:54 ` [PATCH v2 02/10] staging: fsl-dpaa2/ethsw: enable switch ports only on dev_open Ioana Ciornei
2019-08-13  8:54 ` [PATCH v2 03/10] staging: fsl-dpaa2/ethsw: add line terminator to all formats Ioana Ciornei
2019-08-13  8:54 ` [PATCH v2 04/10] staging: fsl-dpaa2/ethsw: remove debug message Ioana Ciornei
2019-08-13  8:54 ` Ioana Ciornei [this message]
2019-08-13  8:54 ` [PATCH v2 06/10] staging: fsl-dpaa2/ethsw: remove unnecessary memset Ioana Ciornei
2019-08-13  8:54 ` [PATCH v2 07/10] staging: fsl-dpaa2/ethsw: remove redundant VLAN check Ioana Ciornei
2019-08-13  8:54 ` [PATCH v2 08/10] staging: fsl-dpaa2/ethsw: reword error message Ioana Ciornei
2019-08-13  8:54 ` [PATCH v2 09/10] staging: fsl-dpaa2/ethsw: register_netdev only when ready Ioana Ciornei
2019-08-13  8:54 ` [PATCH v2 10/10] staging: fsl-dpaa2/ethsw: do not force user to bring interface down Ioana Ciornei
2019-08-13  9:38   ` Razvan.Stefanescu
2019-08-13  9:43     ` Ioana Ciornei

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=1565686479-32577-6-git-send-email-ioana.ciornei@nxp.com \
    --to=ioana.ciornei@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ruxandra.radulescu@nxp.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).