Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2518391imu; Thu, 29 Nov 2018 06:18:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/W0r0f2nBpaxGIfLGHN+8+0okugKAMSQN9GnDQ/VnIpCVbLZUnGQQQgAqZnhxmY2f4lgKTR X-Received: by 2002:a17:902:9f93:: with SMTP id g19mr1602657plq.195.1543501139081; Thu, 29 Nov 2018 06:18:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543501139; cv=none; d=google.com; s=arc-20160816; b=SQMoYjaxgxWYZacx4zkVuKjqeRApAL6iT51+8EX6EDdRrRxbkUi8ZA471EzlikJXSY y0m1FYOGd0TvK9Yys7aXpS328sH4Usu2ImFsMClb3OIADzRhebz8dS0Wp4tjOScT0IKj 1M5YhAO4HpcP0sFGahci97TmqYjoOyVwMNnz/UdjnQ95ORb9IA3zSAyTCz6/4+k7qVgL sbzD8UiOn7fu1C4hYhjS7NFDoUuRQcCRCyF30DFej5Hsl+IVQmYt0bujdxPCNF+INIQn nTqgWONwg9CNsMVKz7OzV8yK9a/+lCqfVMuQoAD9hwFAQFPiJmKzC2QHdzE1V5UAJQQ7 eE1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AO0PHy4tAMi/VJxe6y6TOcXSyPPNr1QD+FQaXZxuGAQ=; b=mqhayvzXZEvkl8yF/mAVLb039RHfGL67KVR5mdDuuqMZ5XKRHEW4o2KMp7IZpFXCx4 Mt19moBCszA/inukRT3wD4AmwJmEAP2nq/k27zAN+rpbVNepN2Jn2NoFRXv6mZZQ5kH3 je+shA47XnJoq7D9ILqurA1TBL1T0C0tbhBoBCsTXtB659fanWBswPb+kz0FGOsTVIxl CIVvwDNKD5i1+XQHWQVRnEKisj2aXsP3PTJIasFRHU4nBRRkf1s7aBSfbJbp9P+ejJYS RzV2V6NKFK3ZouxnswrIsYbxjtxAvbLsjpE3Ad8FZIA4uGMUkjgJPfB6n/owbT9npJey wDPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ATAyVnit; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si2520534pfb.92.2018.11.29.06.18.44; Thu, 29 Nov 2018 06:18:59 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=ATAyVnit; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730279AbeK3BWh (ORCPT + 99 others); Thu, 29 Nov 2018 20:22:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:44386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728190AbeK3BWh (ORCPT ); Thu, 29 Nov 2018 20:22:37 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 7DF5821019; Thu, 29 Nov 2018 14:17:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501026; bh=0hkNSlWnj37Jg51FVQvGEr/kcc6irP/Kb2oYroaEzVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ATAyVnitHuNux1eQmvboMCXokKnKEGq3x8i9BKGyi18gia3K+9Ve9Je0+ltlkNxR8 hvuNyJbSrX4xKKHftFPnAcqw47QuqEq8fXb8wXqVyfFtxJ+CKjrzk00dueB9/iL5lJ io3sTatcadmmXYGASkMbp++DEHfP1DexKQ9Th0xU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Kleine-Budde Subject: [PATCH 4.4 13/86] can: dev: __can_get_echo_skb(): replace struct can_frame by canfd_frame to access frame length Date: Thu, 29 Nov 2018 15:11:38 +0100 Message-Id: <20181129140110.982887675@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140109.832117862@linuxfoundation.org> References: <20181129140109.832117862@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Marc Kleine-Budde commit 200f5c49f7a2cd694436bfc6cb0662b794c96736 upstream. This patch replaces the use of "struct can_frame::can_dlc" by "struct canfd_frame::len" to access the frame's length. As it is ensured that both structures have a compatible memory layout for this member this is no functional change. Futher, this compatibility is documented in a comment. Cc: linux-stable Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/dev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -430,11 +430,14 @@ struct sk_buff *__can_get_echo_skb(struc BUG_ON(idx >= priv->echo_skb_max); if (priv->echo_skb[idx]) { + /* Using "struct canfd_frame::len" for the frame + * length is supported on both CAN and CANFD frames. + */ struct sk_buff *skb = priv->echo_skb[idx]; - struct can_frame *cf = (struct can_frame *)skb->data; - u8 dlc = cf->can_dlc; + struct canfd_frame *cf = (struct canfd_frame *)skb->data; + u8 len = cf->len; - *len_ptr = dlc; + *len_ptr = len; priv->echo_skb[idx] = NULL; return skb;