Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp303045pxj; Wed, 16 Jun 2021 02:47:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyp7zRhebn4w0fMXz49/lY6Brl9hZc0gngaAjtX//4aGdZ9zIqdwhIMT/zgoMEgkBr7Qc1m X-Received: by 2002:a92:cd4c:: with SMTP id v12mr2862326ilq.259.1623836857955; Wed, 16 Jun 2021 02:47:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623836857; cv=none; d=google.com; s=arc-20160816; b=ewH/tvTasHFCSIRVB9xTn4gaOG92V9gMPojUoJ2WxlW5vQll9AFBli9mjzCV54JW1B hh1NozGt60xYm1zRGHGUb7TNPVraz+f/j7rgl7Q+C/j9gFd5kkmiuXtzpcfddWoX/Y2L PSowg5h5QBBAj8/Q+JO+7rlNi7mb6JorXC9+I5nZTODXwJev+uTOLKlI1WEB4LG1Zlkf H/CqZFMpPjB7gUx5/XX7lIT0Sw3nqO05GUHhu269iECWEn2WWoYP8M56EsbdC2nOoUme ptKCIJJvmrBtA3q7iPMk3K/icga3OF6BKth0yMpSx9zxOFT2SAhiEYyyEUZSZDhaSJwN NcrA== 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=yydXjpRizKa3I2IUOnUr2CmAG0JQzfwahWZ3uqnvRtU=; b=fTFnq5FrzBKRZ7/ujCoc1ayfMQJsf21guAApGZpZY1/rG3rdf2S4xT+TLIOUjbDA3x udYF97mquRIbx7zvdtqpHaqXL0kVppqBFi8q6K8Kq41jCAg2S5/bBuEX76En3yeWNfKN T0jWd86TnpWcqqSl6VEyBV2Cwy4vPULP+/oRNbSDXUhb0wI/SkVmXtBWjKcsgQ0jyNpT 0Zs/kHjcPNrrI05oXE1Vf14IlU2CGnWEwYkJEPCCu+nTF5fbCmywfStmV4w2FWitSDe6 bH2ofccuRbZGESjNigKetXkFc6yyZ4cB5w652+ijJ1/idfh8nPWEYAU+LVdpqwhtRMEt K4sA== 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 w4si2201745iov.14.2021.06.16.02.47.25; Wed, 16 Jun 2021 02:47:37 -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 S232115AbhFPJso (ORCPT + 99 others); Wed, 16 Jun 2021 05:48:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231468AbhFPJsn (ORCPT ); Wed, 16 Jun 2021 05:48:43 -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 1431AC061574 for ; Wed, 16 Jun 2021 02:46:38 -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 1ltS83-0007Ch-S3; Wed, 16 Jun 2021 11:46:35 +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 4ADB263D01E; Wed, 16 Jun 2021 09:46:34 +0000 (UTC) Date: Wed, 16 Jun 2021 11:46:33 +0200 From: Marc Kleine-Budde To: Vincent Mailhol Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Oliver Hartkopp Subject: Re: [PATCH v2 2/2] can: netlink: add interface for CAN-FD Transmitter Delay Compensation (TDC) Message-ID: <20210616094633.fwg6rsyxyvm2zc6d@pengutronix.de> References: <20210603151550.140727-1-mailhol.vincent@wanadoo.fr> <20210603151550.140727-3-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="z3ft7oxhu7toexlx" Content-Disposition: inline In-Reply-To: <20210603151550.140727-3-mailhol.vincent@wanadoo.fr> 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 --z3ft7oxhu7toexlx Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 04.06.2021 00:15:50, Vincent Mailhol wrote: [...] > +static size_t can_tdc_get_size(const struct net_device *dev) > +{ > + struct can_priv *priv =3D netdev_priv(dev); > + size_t size; > + > + if (!priv->tdc_const) > + return 0; > + > + size =3D nla_total_size(0); /* nest IFLA_CAN_TDC */ > + size +=3D nla_total_size(sizeof(u32)); /* IFLA_CAN_TDCV_MAX */ > + 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) { Naively I'd say, iff the device has tdc_const give the user space the tdc parameters, regardless if some value is 0 or not. What do you think? 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 | --z3ft7oxhu7toexlx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAmDJyHYACgkQqclaivrt 76lNngf/S0HVNuyUJm2+Aooh1rzOnUEieq36RoeSYqtT3jrt+LTP1S6Wii8w2IPU GSXUv8Kzu7SN0D26DLptrwJYj6VN6kV67iSIeQ4mvTPUUheqY2izjvWgfy2kmScc f19PdkHYwE2QJbqAsR04He2L7K4gQoBMd24mxHeRHygrh07In/Jj/D0eB19wyCFD Vd9obvdcboCBKcPhDjiekZq3dcsWbvFdZ0HpfHJaLoku9NeGgZ9JWwGrF1UgSqB5 ykZdVR7fGNaYBt/K96jAloiiRXHb8JVgZWrIpCPZv7HMsp9/IOWT60BZ4vf7Wj2X ZkqVUwnkxb9NjMoO4lPlwcMV5UwpiA== =6ogY -----END PGP SIGNATURE----- --z3ft7oxhu7toexlx--