Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp983042ybl; Tue, 13 Aug 2019 05:46:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzp8UH0wQHxQG/OYytVh7guDvMkl05VvvB9meY76cFOVRLN7BjGdmMRviiKF8HJGcLqi1hB X-Received: by 2002:a17:90a:9f09:: with SMTP id n9mr973972pjp.72.1565700379590; Tue, 13 Aug 2019 05:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565700379; cv=none; d=google.com; s=arc-20160816; b=r/XpKdu5BrzbWmP1R8f9Ybb4Q81IFp/q9s5CY/PYMeIo1nOV369mDkZipczaWVgjR5 BeguJoSnsoTm1YCw4DtEgiRgAb13vnaQkiqM6kqiij/Ggeh/4cQudbbH0n6dsnjKw0O8 yBlqc9QNcHyoSvqBSZ8gesM00uNRK925SfCrt++Zb1f2IfbRELg0J7TiU7iz1waF0B8v 9D5XbE2XgMWs+DloSoqbitMHU2QmewIW8Yh27RUTOuO+k+p8Xt4h/uQBgJ7f28VQG/b/ 2eljH6BTYX7RfbsysYG2AzuZJgKjJ1mTJKPRBh8st8K2fY5+yxU5TcAriOtPXAHQ6seW /kpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:references:in-reply-to :message-id:date:subject:cc:to:from; bh=bF5SkmybvzpHnfO2mPDZl+2Fn6H/CdH+U1IuAJfDNXg=; b=Ef/G1C1YjigaQQb4mIPerNd/T/ztYdOaadSefcKjmt1N9G7+fx7pIAfYbqMaguunwi RdQWHFgYz8NC8sCnivtAkOxLaNwuny8OCbe/aEDtDm8QJlvI864HFXV4GdCznpUG4Xnl NcshrF9fCih+6h3J7zjVfs7POGtTyfyBkwAoase7GryxUP96R90MX0PWS6y/2kz4lBfl 2porYNP0Qm1Z30aAFZKDX8lpsxWwU5iGzAZXwrauXlmDGxhTyZ1eCnD5LXR+8mG97J0P 29ZqRKyDfZpsRRpSVE/P3rZBhj4DZ/dQ6ydHVGWRQKDZlPk5redTBhbrHsA1zGR52fk7 mTxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i185si64110485pge.505.2019.08.13.05.46.03; Tue, 13 Aug 2019 05:46:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728599AbfHMMnk (ORCPT + 99 others); Tue, 13 Aug 2019 08:43:40 -0400 Received: from inva020.nxp.com ([92.121.34.13]:59836 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726903AbfHMMnP (ORCPT ); Tue, 13 Aug 2019 08:43:15 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B36EA1A0246; Tue, 13 Aug 2019 14:43:13 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A72621A0132; Tue, 13 Aug 2019 14:43:13 +0200 (CEST) Received: from fsr-ub1464-137.ea.freescale.net (fsr-ub1464-137.ea.freescale.net [10.171.82.114]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 539BE2060E; Tue, 13 Aug 2019 14:43:13 +0200 (CEST) From: Ioana Ciornei To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: joe@perches.com, andrew@lunn.ch, ruxandra.radulescu@nxp.com, Ioana Ciornei Subject: [PATCH v3 05/10] staging: fsl-dpaa2/ethsw: use bool when encoding learning/flooding state Date: Tue, 13 Aug 2019 15:43:02 +0300 Message-Id: <1565700187-16048-6-git-send-email-ioana.ciornei@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1565700187-16048-1-git-send-email-ioana.ciornei@nxp.com> References: <1565700187-16048-1-git-send-email-ioana.ciornei@nxp.com> Reply-to: ioana.ciornei@nxp.com X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Ioana Ciornei --- Changes in v2: - added Reported-by tag Changes in v3: - none 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