Received: by 2002:aa6:c429:0:b029:98:93ff:f56f with SMTP id g9csp3394006lkq; Mon, 23 Nov 2020 04:42:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsHZAM/ZJRYsXLexRjQsn5XuE/2+jiKQzsTiZ5/Vu2YaPNp+BWuUiK5pLgkT2kUGUHlGPK X-Received: by 2002:a17:906:e254:: with SMTP id gq20mr44581343ejb.520.1606135355425; Mon, 23 Nov 2020 04:42:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606135355; cv=none; d=google.com; s=arc-20160816; b=gUk9QFvSRoo5gsk0DlZ8vc9fSg4EuFhi2WWPfipajPuh9u+WNI4Hre1PzB2qrUpbyr j5prQrpBviq4y+kPLxdc5HGI81uPE/9kmbzjKPYR/KbB4IKdn3vHcfyPuh/dm24dbmim zUbCs0bIxkcbfOnarhBacOhy2RUHwvIcZijNexR5Tp7GAN4Sq1QyxFauwAsWH3HIGB0Q lyzwQuw4vqMFYTTDK++DG+FBrf6LVDrFal97sPD6fHRqxJYAcNXys9yhYhJekCNO75oC /EG/vCASaK4ltMQb24TEre+SAQMwAHvVGH6hrj7GLlq3JEh1WXWKx6qEswV7QHMcNsvC 4JAw== 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=9nJOUqdyiUNmAYX2mslYuppZaKqJqzYoEh/76x91gQY=; b=t8vf8L/ZLDgsXXIXK87L+rYc3uqbUax/ofDrS8kkfF1Wd7WjrR3JybuiMsIdOgE85b ywJOP7qM5x4OTHYrj41HXclBXQUw/PJoqiB0mFKtOMllrbvqrYVVu9ebPRXtiwIfuyov 3sJHIu4e5DFx1dRy1I94rC3+d5wUMEmUsVZnNbRCh0WLY+mY7q2Hda0sUKBzTVDFDw40 mrnjedoG0/4Dvj43w+3WbfxPgwEoWnrjTK/9RtL2JkZ72dNJ5YD+X4g/lVEldg9jv8eS F/J+LMe/GLB8qp/i8M5V85ZdiDGDtsqibv6ZKtaqfWXBqPrrykULmvia1uOg0Y7PsLCW QlNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i80FYXhs; 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 m6si6457546eji.658.2020.11.23.04.42.12; Mon, 23 Nov 2020 04:42:35 -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=i80FYXhs; 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 S1731964AbgKWMhh (ORCPT + 99 others); Mon, 23 Nov 2020 07:37:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:49714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731929AbgKWMha (ORCPT ); Mon, 23 Nov 2020 07:37:30 -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 8F6DE2065E; Mon, 23 Nov 2020 12:37:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135050; bh=LZXv1ktnG9CtImniUHN+1Oy0mabgErgup2s3uEAfvbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i80FYXhsv2GkeS2ZQCr99jQNZCZi/1mFhVtlJjsaxULmiUsfqeMB523dbH1xwK1NC Edsapq1mkR4iLF3NdK4bwohCbtePpZdxsHnVOSgxC3wLppr8JLUfGIrWkqT8Y2NonO NAix+2wdEuEm+E8GlXqWlbUd3MqI8t1EBfBTeJrQ= 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 5.4 085/158] can: m_can: m_can_handle_state_change(): fix state change Date: Mon, 23 Nov 2020 13:21:53 +0100 Message-Id: <20201123121824.036101790@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@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 562c8317e3aa8..20f025b4f6d4c 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -664,7 +664,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 */ cdev->can.can_stats.error_warning++; cdev->can.state = CAN_STATE_ERROR_WARNING; @@ -693,7 +693,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