Re: [PATCH v1 4/5] can: kvaser_usb: Use CAN_MHZ define in assignment of frequency

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

 



(I inadvertently sent my previous message while I was still
writing it, resending with full comments)

On Fri. 19 Nov 2021 at 22:30, Jimmy Assarsson <extja@xxxxxxxxxx> wrote:
>
> On 2021-11-19 14:19, Jimmy Assarsson wrote:
> > Use the CAN_MHZ define when assigning frequencies.
>
> Maybe we should use the HZ_PER_MHZ define introduced in kernel 5.15 in
> linux/units.h. It also got defines for KILO and MEGA, which we also got
> in linux/can/bittiming.h.
>
> What do you think?

With the recent changes in linux/units.h, I am perfectly fine to
remove the CAN_MHZ, CAN_KBPS and CAN_MBPS macros from
linux/can/bittiming.h.

I am just bothered by the name of the macro HZ_PER_MHZ. Hertz per Mega
Hertz is a ratio without a unit (physically speaking). The
clock speed is expressed in hertz. So:

| .frep = 80 * MEGA,

would make more sense.

I see HZ_PER_MHZ as something used for conversion, e.g.:
| freq_in_hz = HZ_PER_MHZ * frep_in_mhz;

Yours sincerely,
Vincent Mailhol



[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