Re: [PATCH v1] can: bittiming: add CAN_KBPS, CAN_MBPS and CAN_MHZ macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06.03.2021 14:40:40, Vincent Mailhol wrote:
> Add three macro to simplify the readibility of big bittiming numbers:
                                  readability

>   - CAN_KBPS: kilobits per second (one thousand)
>   - CAN_MBPS: megabits per second (one million)
>   - CAN_MHZ: megahertz per second (one million)
> 
> Example:
> 	u32 bitrate_max = 8 * CAN_MBPS;
> 	struct can_clock clock = {.freq = 80 * CAN_MHZ};
> instead of:
> 	u32 bitrate_max = 8000000;
> 	struct can_clock clock = {.freq = 80000000};
> 
> Apply the new macro to driver/net/can/dev/bittiming.c.
> 
> Signed-off-by: Vincent Mailhol <mailhol.vincent@xxxxxxxxxx>

Applied with the typo-fix to linux-can-next/testing.

regards,
Marc

-- 
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 |

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux