Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2568782pxk; Sun, 4 Oct 2020 04:12:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwY2QqOrC4sODNa9N/z7j3JODaUpyT8BJq8LoIMLupc7Zi35N5VrkQSCF3hS9OlR3TiRitE X-Received: by 2002:aa7:d4d8:: with SMTP id t24mr11879571edr.247.1601809949368; Sun, 04 Oct 2020 04:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601809949; cv=none; d=google.com; s=arc-20160816; b=TOV3Xv7CRNdr1Eq7fsvz1WNRYz07AU+68V7i2kAI1Db1vV6N1Ctpb/si/lKiXYtVU3 pWxDitRNLS77LY0uPRbpp6UCRUTBcBUQkJAYONlzJ9uFi08Lc1qxgPLuwumaLntRRD2H ZDwvDyFBtCtSH73r/QAftSJ++zq0VZpeEXsPnGJqOyCCSlkg1EvkXOb6WekY8nFoYaps aoNgXvaFn9x/nHNUProylsMSyy5GVPIfUcU6dI0agi7kXdjGaBdDtEGUbQ9Fz4KAaB4E dAl3DP5/a1ZC5cuU134V/67vgoWOGEzcw5+uWUWsfxorM0Td4oeF81v71PkkdCtzpX9x qeEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:references:cc:to:from:subject; bh=pwYcWwvOn4K2Vrj+b5uRMj1oQ0TzKLj+d98RlUhR8xg=; b=zn+Mr0gkIhDuhzsuvSpNscE8en4pXxwct9JuHNkyCqKePYBtbb3omL2LcbfAUKHIgI RJjvJoYWVpaRhnlnxRCa2/boTu0k6Rc8ywLVXskb6p20i2tkltTDN/XGu7jp29XZvaET pFmBuyvP9rRGCrghAwaG6tlzOCLHTwlxMWApad17zkR7qwPSOu1dnAqZ+f6l1jUrlrME EDp+OY8jNg5p4qg/wCtUTuOo1gup5M6t058QEZMkZr3/v6V/jyiC7rTCDjB7Kd0EF1IT FYfIHsh9I87Ijl6q2OyZ4nU3vZIOi6c4X0/A/4W2cPH+xe1XsidZSM8onFPP+a9BUO5g m80w== 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 z9si5129589ejb.479.2020.10.04.04.12.06; Sun, 04 Oct 2020 04:12:29 -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 S1725981AbgJDLLD (ORCPT + 99 others); Sun, 4 Oct 2020 07:11:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725825AbgJDLLC (ORCPT ); Sun, 4 Oct 2020 07:11:02 -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 AD9EEC0613CE for ; Sun, 4 Oct 2020 04:11:02 -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 1kP1uo-0000mC-Ky; Sun, 04 Oct 2020 13:10:54 +0200 Received: from [IPv6:2a03:f580:87bc:d400:fc36:ae63:3b35:518b] (unknown [IPv6:2a03:f580:87bc:d400:fc36:ae63:3b35:518b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mkl@blackshift.org", Issuer "StartCom Class 1 Client CA" (not verified)) (Authenticated sender: mkl@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id AD3DA571D4E; Sun, 4 Oct 2020 11:10:52 +0000 (UTC) Subject: Re: [PATCH v3 5/7] can: dev: add a helper function to calculate the duration of one bit From: Marc Kleine-Budde To: Vincent Mailhol , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-can@vger.kernel.org, Wolfgang Grandegger , "David S . Miller" , Jakub Kicinski Cc: Oliver Neukum , Greg Kroah-Hartman , Masahiro Yamada , Arunachalam Santhanam , "open list:USB ACM DRIVER" References: <20201002154219.4887-1-mailhol.vincent@wanadoo.fr> <20201002154219.4887-6-mailhol.vincent@wanadoo.fr> <49660a42-9465-a519-6dd4-0f80795b0aca@pengutronix.de> Autocrypt: addr=mkl@pengutronix.de; prefer-encrypt=mutual; keydata= mQINBFFVq30BEACtnSvtXHoeHJxG6nRULcvlkW6RuNwHKmrqoksispp43X8+nwqIFYgb8UaX zu8T6kZP2wEIpM9RjEL3jdBjZNCsjSS6x1qzpc2+2ivjdiJsqeaagIgvy2JWy7vUa4/PyGfx QyUeXOxdj59DvLwAx8I6hOgeHx2X/ntKAMUxwawYfPZpP3gwTNKc27dJWSomOLgp+gbmOmgc 6U5KwhAxPTEb3CsT5RicsC+uQQFumdl5I6XS+pbeXZndXwnj5t84M+HEj7RN6bUfV2WZO/AB Xt5+qFkC/AVUcj/dcHvZwQJlGeZxoi4veCoOT2MYqfR0ax1MmN+LVRvKm29oSyD4Ts/97cbs XsZDRxnEG3z/7Winiv0ZanclA7v7CQwrzsbpCv+oj+zokGuKasofzKdpywkjAfSE1zTyF+8K nxBAmzwEqeQ3iKqBc3AcCseqSPX53mPqmwvNVS2GqBpnOfY7Mxr1A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zPGVzNKoAzxjlaxI1MfqAD9XUM80MYBVjunIQlkU/AubdvmMY X7hY1oMkTkC5hZNHLgIsDvWUG0g3sACfqF6gtMHY2lhQ0RxgxAEx+ULrk/svF6XGDe6iveyc z5Mg5SUggw3rMotqgjMHHRtB3nct6XqgPXVDGYR7nAkXitG+nyG5zWhbhRDglVZ0mLlW9hij z3Emwa94FaDhN2+1VqLFNZXhLwrNC5mlA6LUjCwOL+zb9a07HyjekLyVAdA6bZJ5BkSXJ1CO 5YeYolFjr4YU7GXcSVfUR6fpxrb8N+yH+kJhY3LmS9vb2IXxneE/ESkXM6a2YAZWfW8sgwTm 0yCEJ41rW/p3UpTV9wwE2VbGD1XjzVKl8SuAUfjjcGGys3yk5XQ5cccWTCwsVdo2uAcY1MVM HhN6YJjnMqbFoHQq0H+2YenTlTBn2Wsp8TIytE1GL6EbaPWbMh3VLRcihlMj28OUWGSERxat xlygDG5cBiY3snN3xJyBroh5xk/sHRgOdHpmujnFyu77y4RTZ2W8 Message-ID: Date: Sun, 4 Oct 2020 13:10:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <49660a42-9465-a519-6dd4-0f80795b0aca@pengutronix.de> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Au1g7qhsajtJ3rHsms802Ho64raVFmd6I" 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 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Au1g7qhsajtJ3rHsms802Ho64raVFmd6I Content-Type: multipart/mixed; boundary="CVh1Q0BrKYAPkqENWGjuEhi8a9asKIYgh"; protected-headers="v1" From: Marc Kleine-Budde To: Vincent Mailhol , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-can@vger.kernel.org, Wolfgang Grandegger , "David S . Miller" , Jakub Kicinski Cc: Oliver Neukum , Greg Kroah-Hartman , Masahiro Yamada , Arunachalam Santhanam , "open list:USB ACM DRIVER" Message-ID: Subject: Re: [PATCH v3 5/7] can: dev: add a helper function to calculate the duration of one bit References: <20201002154219.4887-1-mailhol.vincent@wanadoo.fr> <20201002154219.4887-6-mailhol.vincent@wanadoo.fr> <49660a42-9465-a519-6dd4-0f80795b0aca@pengutronix.de> In-Reply-To: <49660a42-9465-a519-6dd4-0f80795b0aca@pengutronix.de> --CVh1Q0BrKYAPkqENWGjuEhi8a9asKIYgh Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable On 10/4/20 1:06 PM, Marc Kleine-Budde wrote: > On 10/2/20 5:41 PM, Vincent Mailhol wrote: >> Rename macro CAN_CALC_SYNC_SEG to CAN_SYNC_SEG and make it available >> through include/linux/can/dev.h >> >> Add an helper function can_bit_time() which returns the duration (in >> time quanta) of one CAN bit. >> >> Rationale for this patch: the sync segment and the bit time are two >> concepts which are defined in the CAN ISO standard. Device drivers for= >> CAN might need those. >> >> Please refer to ISO 11898-1:2015, section 11.3.1.1 "Bit time" for >> additional information. >> >> Signed-off-by: Vincent Mailhol [...] >> index 791c452d98e1..77c3ea49b8fb 100644 >> --- a/include/linux/can/dev.h >> +++ b/include/linux/can/dev.h >> @@ -82,6 +82,21 @@ struct can_priv { >> #endif >> }; >> =20 >> +#define CAN_SYNC_SEG 1 >> + >> +/* >> + * can_bit_time() - Duration of one bit >> + * >> + * Please refer to ISO 11898-1:2015, section 11.3.1.1 "Bit time" for >> + * additional information. >> + * >> + * Return: the number of time quanta in one bit. >> + */ >> +static inline int can_bit_time(struct can_bittiming *bt) >=20 > make it return an unsigned int > make the bt pointer const I'll change this while applying the patch. 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 | --CVh1Q0BrKYAPkqENWGjuEhi8a9asKIYgh-- --Au1g7qhsajtJ3rHsms802Ho64raVFmd6I Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAl95rbcACgkQqclaivrt 76mJ2Af+KsXxhV3+6XtL4GTb/XCU9MIS9O33JIB0nbDsbpD0HbG+fhJPmefJOYNj QFTwki/VYz9T3Qo9PMnI0tX89bC2PtcMYshT3tTuZnsgXPST78W84M9CyoDVYbHA LzygdmD7ji8nv2pqrJb9Jpz37JDUyAaaN2IT8oIwLJuiXl0szrlrrxwc8uchKwv1 R8Ql1LuGC71COcGTC3IGqDRJS3f0ED1O3y1Vt0t4UGbAcJ6XBggIr5EFprVlXX33 i8ycgAlGuLTHMlrJ35DKvil7QmQNhYqhL9daa/EI/0wGuYeBL0JvclFIWpgQX8Hi rFc+ERKuH9EWv0tUc68YrxP2UBT7Ow== =wnPs -----END PGP SIGNATURE----- --Au1g7qhsajtJ3rHsms802Ho64raVFmd6I--