Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3566024ybl; Mon, 12 Aug 2019 02:40:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmYZ6pb/iFotRSVILVulJpIKJq7i+9mj+g04teN/Uz1PaR/iVE/TFkVIZ/yp/bHDqu9vBk X-Received: by 2002:a17:902:b582:: with SMTP id a2mr6387466pls.199.1565602831950; Mon, 12 Aug 2019 02:40:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565602831; cv=none; d=google.com; s=arc-20160816; b=vCXSqte7SaGKwQGa1QJVxmz7ENpieAbzL9O7rOG0DDKQZmKeiZ0J37sSiUdRczZKpi Qv1IcRxMvY5h7SBuMB/3QlBfkJaX+wJlTFNQUp4mMrASqEPLfCCr0eXNJIBmAhzKB4+F 8aAL6+4gsbIf22yKSbfSPMX8kKmcmnWTNSbIUP6A+7oQ0R/QB/ik8rQoEFxVAVZ+2bO/ pD2rBNs/CDC+N6vbNu0Ngfj/H0NN5Q0uUwIaCxSUy+TYqKybQqGX3GCiBilnDDFlNmGM 5NUQZGFwdNSLKiDHqjEQNNxKo70freFigAABBxf+KJBb+HhUxCdH4bk6g4HpXTJMQNYO Nywg== 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=adLvT+zCyAE2BoMlwsoD8nWNErZ0Mfdx1fhLemrV/bA=; b=KBsPDbusv5BOQLKdi6k9SwVDAn4zanThm4IzLER/hXRiAkV+zAi5pGqCjYvdC02MOD z9Mm6RApcdxHsTScbozvZB3KioxqpbnT81+yhzZRb0DNFIj7d3fBEwKWnfbo9xRLFSMe Ss5hju3mslBprOlzpCxy2HQxfOcISdb+Iyb33Ovjna67fHBaV4359HRBqAxBwEKsk5pf FnrMP6qntfRei8ar94IE5d+/XIKh3Ijce/MgMxzYTb3rfdwkpofiaKiKzHEStgGLCMm+ B0E1YagtAZjMW/p3iMmp7SQhPdwR+bcEwXkbWM2I9CJGfutfxDZdkTmOj0z7Hc+0XYOu dn0w== 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 p8si55645347plq.53.2019.08.12.02.40.16; Mon, 12 Aug 2019 02:40:31 -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 S1727513AbfHLJjj (ORCPT + 99 others); Mon, 12 Aug 2019 05:39:39 -0400 Received: from inva021.nxp.com ([92.121.34.21]:57594 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727474AbfHLJjg (ORCPT ); Mon, 12 Aug 2019 05:39:36 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 8DECE2002F1; Mon, 12 Aug 2019 11:39:34 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 7EEB4200112; Mon, 12 Aug 2019 11:39:34 +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 35536205ED; Mon, 12 Aug 2019 11:39:34 +0200 (CEST) From: Ioana Ciornei To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: andrew@lunn.ch, ruxandra.radulescu@nxp.com, Ioana Ciornei Subject: [PATCH 05/10] staging: fsl-dpaa2/ethsw: use bool when encoding learning/flooding state Date: Mon, 12 Aug 2019 12:39:13 +0300 Message-Id: <1565602758-14434-6-git-send-email-ioana.ciornei@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1565602758-14434-1-git-send-email-ioana.ciornei@nxp.com> References: <1565602758-14434-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. Signed-off-by: Ioana Ciornei --- 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