Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp729323pxj; Wed, 16 Jun 2021 12:11:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLLoTYsdYQ7xFFfzmk86CJsB1eS+HUjkI47VSsg6FNp1yjDgMIHCElve73AlJCb42EzBhN X-Received: by 2002:a17:906:606:: with SMTP id s6mr1064008ejb.206.1623870665345; Wed, 16 Jun 2021 12:11:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623870665; cv=none; d=google.com; s=arc-20160816; b=FZeh5CpzED1VaMnG1RMOAqZArc4p/76ISnWWTFMUZIf0BIVGIXun63LHQ6lOYQMBp7 fRqpJZepVnZe0OgRWsYLol5KDstP01UisQ1wegI+ec9KkCy1rBYAgBx0cNkviJGjmxin vW4+1ymk1yRQ5ukrRroswDMhEAdEPzMviD354Q94yTYSHwL7ga1s+thufV4zF+pSHVJy bNEZckZwq4vH1HDU8F2pGVHuHu8jRB717HrRN9QMGSJvRd5wqJa0CDou7PBEhjwemGTE oCuSeJ2HNADz9yGUOETNHe7Xy+Bj9hTXG+Bx4S5AhENN+y8DnIW45xRbD+6s340ljxr2 hePg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=nN9zYK+A3xk5yfDprMVsRnijfeF+vHQDsu+7uMV71CI=; b=zLjdIOAzyOp4OY0b9FUokDDsXSE2YWohuI9Mab/Zk+TMcpngKLPBl10mEPy4zK9jhc 6CQdVB1gqoxlXH6zuLdkhv2IZ+6cLXV1oSRasn1t0ATCxWY+o5pqq8bR5Fyi/odzyZvo TUs6DYh9Wbqkk2D+jzSEwzp+YRBwgrUrtip5l9ObXld5Bc/I8E2x/EeGp/6ifnIL2ISH SemWMsXgDQ5euLJ74901eUEFa+ILsfksWi0OVfY9tvhuljnZydpn+A0hrGj1Zq/1y2Ck v6XiJWsbYn0nM7rO5lVpSmuzr59E8D0kWKbaFybXZ99yJ/mtq7WIA6c/DmJdBCzG3q2b JvAw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v29si2904664ejv.66.2021.06.16.12.10.42; Wed, 16 Jun 2021 12:11:05 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234117AbhFPOsu (ORCPT + 99 others); Wed, 16 Jun 2021 10:48:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234080AbhFPOsu (ORCPT ); Wed, 16 Jun 2021 10:48:50 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E39BC06175F for ; Wed, 16 Jun 2021 07:46:44 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ltWoU-00078q-14; Wed, 16 Jun 2021 16:46:42 +0200 Received: from pengutronix.de (unknown [IPv6:2a03:f580:87bc:d400:27:4a54:dbae:b593]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id B244863D59F; Wed, 16 Jun 2021 14:46:40 +0000 (UTC) Date: Wed, 16 Jun 2021 16:46:40 +0200 From: Marc Kleine-Budde To: Vincent MAILHOL Cc: linux-can , netdev , open list , Oliver Hartkopp Subject: Re: [PATCH v2 2/2] can: netlink: add interface for CAN-FD Transmitter Delay Compensation (TDC) Message-ID: <20210616144640.l4hjc6mc3ndw25hj@pengutronix.de> References: <20210603151550.140727-1-mailhol.vincent@wanadoo.fr> <20210603151550.140727-3-mailhol.vincent@wanadoo.fr> <20210616094633.fwg6rsyxyvm2zc6d@pengutronix.de> <20210616142940.wxllr3c55rk66rij@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yfgh76m5lrylc5pl" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --yfgh76m5lrylc5pl Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 16.06.2021 23:43:35, Vincent MAILHOL wrote: > > Sounds good, I'm squashing this patch: > > > > | diff --git a/drivers/net/can/dev/netlink.c b/drivers/net/can/dev/netl= ink.c > > | index 6134bbf69c10..d48be574eae7 100644 > > | --- a/drivers/net/can/dev/netlink.c > > | +++ b/drivers/net/can/dev/netlink.c > > | @@ -311,7 +311,7 @@ static size_t can_tdc_get_size(const struct net_d= evice *dev) > > | size +=3D nla_total_size(sizeof(u32)); /* IFLA_CAN= _TDCO_MAX */ > > | size +=3D nla_total_size(sizeof(u32)); /* IFLA_CAN= _TDCF_MAX */ > > | > > | - if (priv->tdc.tdco) { > > | + if (can_tdc_is_enabled(priv)) { > > | size +=3D nla_total_size(sizeof(u32)); /* IFLA_CAN= _TDCV */ > > | size +=3D nla_total_size(sizeof(u32)); /* IFLA_CAN= _TDCO */ > > | size +=3D nla_total_size(sizeof(u32)); /* IFLA_CAN= _TDCF */ > > | @@ -352,6 +352,7 @@ static size_t can_get_size(const struct net_devic= e *dev) > > | priv->data_bitrate_const_cnt); > > | size +=3D sizeof(priv->bitrate_max); /* = IFLA_CAN_BITRATE_MAX */ > > | size +=3D can_tdc_get_size(dev); /* = IFLA_CAN_TDC */ > > | + > > | return size; > > | } > > | > > | @@ -374,7 +375,7 @@ static int can_tdc_fill_info(struct sk_buff *skb,= const struct net_device *dev) > > | nla_put_u32(skb, IFLA_CAN_TDC_TDCF_MAX, tdc_const->tdcf_m= ax)) > > | goto err_cancel; > > | > > | - if (priv->tdc.tdco) > > | + if (can_tdc_is_enabled(priv)) { > > | if (nla_put_u32(skb, IFLA_CAN_TDC_TDCV, tdc->tdcv) || > > | nla_put_u32(skb, IFLA_CAN_TDC_TDCO, tdc->tdco) || > > | nla_put_u32(skb, IFLA_CAN_TDC_TDCF, tdc->tdcf)) > > | diff --git a/include/linux/can/bittiming.h b/include/linux/can/bittim= ing.h > > | index 9de6e9053e34..b6d1db1e7258 100644 > > | --- a/include/linux/can/bittiming.h > > | +++ b/include/linux/can/bittiming.h > > | @@ -83,6 +83,11 @@ struct can_tdc_const { > > | u32 tdcf_max; > > | }; > > | > > | +static inline bool can_tdc_is_enabled(const struct can_priv *priv) >=20 > Did you try to compile? Not before sending that mail :) > I am not sure if bittiming.h is able to see struct can_priv which is > defined in dev.h. Nope it doesn't, I moved the can_tdc_is_enabled() to include/linux/can/dev.h Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --yfgh76m5lrylc5pl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAmDKDs0ACgkQqclaivrt 76nmKgf+JKGqznOyIg4hPJil6qfsqgmZnRQEiy1rkwKYNbOwYXLuiFr4vf6g1H1l r0vYi80+78mcIIlqpBGirsKB3WX993WpfLDmPnvM+vB/CV+kxmKu4gQWOr0MRMpY QNj7qb8w3zkc1gFm6nMXWxOqXPDBPaPFEGdfF8khYzs8xJ3UUNrUhWS5KQvA1wjg ru05plLZqUIR6qvQCcefdguE/owCLYNxf9hBsfIJc5M6Os8XmB/NO/W/FQ7pPS4p D0dLB6v2jH1v71XjvrYbxqGFMG96PY6YOoqdYRKkFrGj4q/989A66R3jQ4VNQZgz bKLdR+AniFa7sBGpB7b0jXgLzeSL1w== =NYU/ -----END PGP SIGNATURE----- --yfgh76m5lrylc5pl--