Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp844865ybl; Tue, 13 Aug 2019 03:36:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxd8kcvZTBIqEKl5hBYBWxkPHIee7m9//2Eb6fpBdxPaixZfOANROOnSjF9w242D1Su1BoG X-Received: by 2002:a17:90a:de02:: with SMTP id m2mr1603213pjv.18.1565692564495; Tue, 13 Aug 2019 03:36:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565692564; cv=none; d=google.com; s=arc-20160816; b=dVt98HG7tENhvBSZW6gAvvwr5klxCNUPon4M4azELyX6ZuFkfcsiWoDGC5tSk6acjx KP2imQeNzYWildVftTIkjLG2cXXoonJL2m16UNWMeZYtQPaXsAj0Gjtz7F11GYt/NE0I QXIu46jaDvNwz9R386b9rpk76JipMJsHqWygvePRnlnZPtdUSrBiKuuwvfPTKTpDrwyB I9snjEHAkzrPCdtiKKyETrwITwGYB/IIIgpxJibd+XIEKSoARlW8aG+8kqPDtyXAgCMb eCExbGI9iIM5rE9+2vhuSnphlNiZjamWbRaKSNtzqOoPHESBuygmMQhTVtCW1hn2DT/G qlvw== 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=QLTCUczmXbgsLt4HF18YP0GNUdlSgJnmEl1fMzyto6k=; b=Dkec9hAHN5cBE/Kfnjl8dAo5rzoPHvfaUStOYfBQvJn3fBEEsbYfMciYFQBIVVtQY1 uXm2jZmoTseAHeTlWWLF5QIU5u1bKuYnMhqz5SZzI7lHQyTvJIVC03Jf9/2Lu9nCKRRD UDyBhbG7Ud2SDrwKixyKrbuHyS7xr+XPpOL2YKnnLFq/DBWWgn/GwQOJ337+sq4TtGJk wot1fSa13dJQQHdrU+iQO/ZB1jRKS0cgrYO8NJEbBqQ7B48h9d8GWgN8iuncwT/zbIhS vT9T7W9CefQ2KWnYjgxwRlpI/ShDyXXf0VXt/d35hLiYSs9LQG664Iuame/vonYJGnEA m8wQ== 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 r4si25108020pgg.368.2019.08.13.03.35.48; Tue, 13 Aug 2019 03:36:04 -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 S1728347AbfHMIzS (ORCPT + 99 others); Tue, 13 Aug 2019 04:55:18 -0400 Received: from inva021.nxp.com ([92.121.34.21]:41534 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727987AbfHMIyx (ORCPT ); Tue, 13 Aug 2019 04:54:53 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 5BCD5200778; Tue, 13 Aug 2019 10:54:52 +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 4ED60200752; Tue, 13 Aug 2019 10:54:52 +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 059E02060E; Tue, 13 Aug 2019 10:54:51 +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 v2 05/10] staging: fsl-dpaa2/ethsw: use bool when encoding learning/flooding state Date: Tue, 13 Aug 2019 11:54:34 +0300 Message-Id: <1565686479-32577-6-git-send-email-ioana.ciornei@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1565686479-32577-1-git-send-email-ioana.ciornei@nxp.com> References: <1565686479-32577-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 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