Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp838912pxu; Mon, 23 Nov 2020 05:35:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXPXURVcwA0jFWpjN9fNjL9XQ9+GlVwDajCXu933T+/9u5chF7hb1PSBzAdnwrm8hJ8vfd X-Received: by 2002:a17:906:2b81:: with SMTP id m1mr4401230ejg.251.1606138527306; Mon, 23 Nov 2020 05:35:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606138527; cv=none; d=google.com; s=arc-20160816; b=xxqqhnzKfDYqXLJz9kiKcGv6Eou/MQMJykkd3+qrvZfRsQkQ2oZj+rMDbQHiuvLi6R Q1jlJ9SgQNaHfYOT9VHsAVhiaeLKnKq0P1NEs/eS1j0vFzgJsSUt67047bef/7ITij+6 762udtCOOOu0ncQWWZKem543t/mcjfTV3v7kXCNuFqFO1Uo92rhSzh6SepC8ajJeMoRE zI2sRfZzsvbv2Gs2dVhcdVq3VWz5LKrFv30Oud7eBHDG27+1QK74bOlaB2C3w1Tg8qir qOnCuRf5X6U19rXfZJWyT3JmWaRdvmTKCO/Ye+SRIW2wovAMUf9IEwW0XTIUZN5kS6/r I0eA== 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=SJaAa/Ewj417ORTcIcaws88haIHsm2d0FOlf/xEOpTU=; b=LjABwvMbUSBl1TfmcyljSmVbLfUcsyKjlZrsQ+znNmGhRccIIMOPOCwwcgSaybp3Oc oOuAqF0qgFOSewVV8CE/a1CDKl3It30Ry20ogKA+Lf+Lhx77VaMCJ2NmoRpVzmoxKdg9 vRQPvsFncXA9CpR3WyQHyLh5zzHeQ1IWMWUeoakZHo6lIy+VbrHIzl2v2KGlhiVa31Y3 mfxBbdP6c7KA4pkbS3WOvI1Vz8kZBtJkngsuh6T+gPVe+Ka0Z0TYMRQ3Ztd7SLrmHZg/ poWcf52U9xWKGbpKU5IxGoR+hDFJlcIn5JcQbnrJk05FqAelUCX5C3OJSaTjUdkntZJk nyOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UsLvocmX; 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 qu18si6331466ejb.438.2020.11.23.05.35.04; Mon, 23 Nov 2020 05:35:27 -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=UsLvocmX; 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 S1729526AbgKWM0s (ORCPT + 99 others); Mon, 23 Nov 2020 07:26:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:36722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730177AbgKWM0o (ORCPT ); Mon, 23 Nov 2020 07:26:44 -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 5F06420857; Mon, 23 Nov 2020 12:26:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134403; bh=fpRHnWk875PicaKG9ODEDzkL8KyVZHCkv1aQOYD+ftY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UsLvocmX9dDpWQizAj79ZB6ZXRWE4asyvhsTWHHyxrsbP7RQmhbLqp7ORINkcFk+1 io+8WtO/AcK3njlr+Tcp3rvQiRwfUIsIrPvkZfRgZBnTXnaHa6VflMIrBy/svsCXZ0 6cIi0Qn6v6I4sqvaQJdMfcbhX9lF2vI2gJMWUKcc= 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.9 29/47] can: m_can: m_can_handle_state_change(): fix state change Date: Mon, 23 Nov 2020 13:22:15 +0100 Message-Id: <20201123121806.958114275@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121805.530891002@linuxfoundation.org> References: <20201123121805.530891002@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 195f15edb32e3..0bd7e71647964 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -572,7 +572,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; @@ -601,7 +601,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