Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp835315pxu; Mon, 23 Nov 2020 05:30:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/K+JS7CdC0D9X7A7eJJYDVpGcHYvEcTTvQDiUQ2u+CNpomiNh/6cgWeoOk026fztMeQk2 X-Received: by 2002:a17:907:396:: with SMTP id ss22mr29492995ejb.24.1606138233632; Mon, 23 Nov 2020 05:30:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606138233; cv=none; d=google.com; s=arc-20160816; b=NyhYhOfGMTJi6fKCtkGUXV40AoL9xmykTlNmiY88C9cU/Bkmkb8pEKFjC9vFf5H7S4 sNm8kGwMOjFj0qKdhJQcugcdbip52Hlc6ZxMzKId/osUJp6QGiYvE/O13lhvehSgy/pE s4Nz8buqJiLg9DV5VrWibP29N5G8VhHfucX0/jeWh1hU3HpLFWu7f389JosCUEArKvAa LuL+Kswb95L9Qq1hePVwFQuFoaoyJFfxz2vP6N29xY1Boa2lLMkYHoD5vFq17sk3tQ2x keuwN0ZXDci3GLTq7s6nP68PkMU+D45TBQ7F0NUqlNRwBJtzSFcZ8UcMZBtsHvsic0gt Qxdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=G9H3M09cJW+FdWVXl/8E1dA+m+wBmhk9tVGTrhLS2Ak=; b=HZoyvWIEmQDNuyp04WEp2fAlxRqtKOEm5VBp/0hqQLngxdiIxCA8EG5mMfpc/ZlRTo 2inU/TY1Ai3TQ+ePbyU/O3GKCh5XvcemYDKqzGi4KzKiSovDtF7PUhAQ4wYABUEfUBzs MiFJgbf2dPoFQZ+LrK+GWlAbnITPUH8DiqzEk53jJch4I2RNY0gWFBjgZL7sSutnVctb sYW0Uih5sG7LmY5xf7WRq51LWm7vtxd9jU75CyFD++gT7vKrU/rPxrhoVoKpd5kxHjWm bWreaUjF9Omsn9sKSIAscRaLh21TY71KAXZSjFua0KcevGl+7HrmExEjJ3o2mPL+lq31 uxKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2ZUX3hip; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l9si5687613edf.357.2020.11.23.05.30.10; Mon, 23 Nov 2020 05:30:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2ZUX3hip; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389199AbgKWN1Z (ORCPT + 99 others); Mon, 23 Nov 2020 08:27:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:42984 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730390AbgKWMbv (ORCPT ); Mon, 23 Nov 2020 07:31:51 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BA9B22076E; Mon, 23 Nov 2020 12:31:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134710; bh=XiBAC+G3MWHV68mu8MaaUtEe2tl2WKEXrezZVTKu8ts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2ZUX3hipey6WZnwBm/FDK4QN8t8XITp2O5lM3WaZAk4MCj7bcImVgmcVJpa8JGTox ge6lfluGxlecv5qxn6co3nSKUnbCekgrCFxS55OsmioSia+qUh6YFvq7JsPZTYkN0E vAqagIMAkrg8r2aa9cYOnbZqtwaHPlPZVV47dn+0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wu Bo , Dan Murphy , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 4.19 54/91] can: m_can: m_can_handle_state_change(): fix state change Date: Mon, 23 Nov 2020 13:22:14 +0100 Message-Id: <20201123121811.948329304@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121809.285416732@linuxfoundation.org> References: <20201123121809.285416732@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wu Bo [ Upstream commit cd0d83eab2e0c26fe87a10debfedbb23901853c1 ] m_can_handle_state_change() is called with the new_state as an argument. In the switch statements for CAN_STATE_ERROR_ACTIVE, the comment and the following code indicate that a CAN_STATE_ERROR_WARNING is handled. This patch fixes this problem by changing the case to CAN_STATE_ERROR_WARNING. Signed-off-by: Wu Bo Link: http://lore.kernel.org/r/20200129022330.21248-2-wubo.oduw@gmail.com Cc: Dan Murphy Fixes: e0d1f4816f2a ("can: m_can: add Bosch M_CAN controller support") Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/m_can/m_can.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index deb274a19ba00..efaa342600c41 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -675,7 +675,7 @@ static int m_can_handle_state_change(struct net_device *dev, unsigned int ecr; switch (new_state) { - case CAN_STATE_ERROR_ACTIVE: + case CAN_STATE_ERROR_WARNING: /* error warning state */ priv->can.can_stats.error_warning++; priv->can.state = CAN_STATE_ERROR_WARNING; @@ -704,7 +704,7 @@ static int m_can_handle_state_change(struct net_device *dev, __m_can_get_berr_counter(dev, &bec); switch (new_state) { - case CAN_STATE_ERROR_ACTIVE: + case CAN_STATE_ERROR_WARNING: /* error warning state */ cf->can_id |= CAN_ERR_CRTL; cf->data[1] = (bec.txerr > bec.rxerr) ? -- 2.27.0