Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2554405imu; Thu, 29 Nov 2018 06:49:35 -0800 (PST) X-Google-Smtp-Source: AFSGD/VRRDa3oUuWgdiwi9Sc1AZRH8Sq3ODXuqDYpxvAtTGNMni7ST9+Ue0YEHQhS+lV4k4SO2Ej X-Received: by 2002:a17:902:9a41:: with SMTP id x1mr1746219plv.126.1543502975411; Thu, 29 Nov 2018 06:49:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543502975; cv=none; d=google.com; s=arc-20160816; b=dvEZjfMjSAmlvqoDLhzLbRDkurwJvowfMbisPVHn5Ef1OieFbjEbkq8kXOBeAdRIXx hLz0TUDdkiZra+iKyfKzI6G87pU3wjeBpnyE9HJhhHrl0MFEM7ipoFQFv4yt8rs9hzzB Yv+eFcvvHKnRgj08dQfSzAweJt7LzUbG+8bM2u+esWjIojJhJ/QcBy7cfz3Nlrl/KHWs 7kDfCvA+7PpgjnmZpfctN3+9Vxv3TsAU7sZOYfa5FWXZbNyvTjvFbCO2CNj0xZX16czt T/ARkxrSa+zMEuDfxOCq0ThRbwzcH9fD3fyXMv9Hy0VjBsSBcPtX1mBR6eyvgi7EtzES WtJg== 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=FB/S10tGxCHHaPiu0tZbQUmhxt1OeIPINAaJS846Kv4=; b=gWy4lHOJBVHN/6mw0Yg1D9phEoVj1ip60riTtgTdLtowjCoRFMdmAqM36kFxmlpDfV hPiMfWwv+PPdx7z0NWnTKewIjdXPw+YWKwJNvpMr+g/1hr46mH5BXUILwIrB6T+GNrtk uoNUnm6/POZfZoeCy+Y4Gx/sfPOp278TPHjeQ18JiBNfPmM6cQmJxgZLsgmfgYP0OZiG ABrPTLsZfaNdfOpVEdm9m0zC6M62WyzFiXG5hYQQaGZSAyXNc95SEQmQY4zK5+E+H5Ip s7hReZ8kyWriGi4eY0Ud1csLfGhyFlblsjX4lzcZT85RSnq0zCVXYIcKz89psjtGsc5+ ySCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=d+ijM1M0; 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 q24si2536765pls.325.2018.11.29.06.49.20; Thu, 29 Nov 2018 06:49:35 -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=d+ijM1M0; 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 S1733041AbeK3BbH (ORCPT + 99 others); Thu, 29 Nov 2018 20:31:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:58522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733006AbeK3BbH (ORCPT ); Thu, 29 Nov 2018 20:31:07 -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 E47CF21104; Thu, 29 Nov 2018 14:25:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501535; bh=srUAN5m/+ShN5vnwEX+E0vWKbOpFRzY0JlEA2Yw6wA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d+ijM1M0cEPzlsi1/t2UqsGI2CjimBarZvipIOEDQOVKOh3s2kctPaEAVwc/R1ojw RXnwgfggAJs530lV3UOwKXu0CaD1YQbk4MC9XdctupXYdScWqYgSjEizSjXnNZMrEf pBkuW9drFkhlMkomRYQm7+vJxfakAdUp5Q1WkeYo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Kleine-Budde Subject: [PATCH 4.14 037/100] can: dev: __can_get_echo_skb(): replace struct can_frame by canfd_frame to access frame length Date: Thu, 29 Nov 2018 15:12:07 +0100 Message-Id: <20181129140102.028065677@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140058.768942700@linuxfoundation.org> References: <20181129140058.768942700@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.14-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 @@ -483,11 +483,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;