Re: [PATCH 3/3] rtc: rzn1: support input frequencies other than 32768Hz

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

 



Hi Wolfram,

On Thu, 10 Apr 2025 at 22:09, Wolfram Sang
<wsa+renesas@xxxxxxxxxxxxxxxxxxxx> wrote:
> > > +               if (rate < 32000 || rate > BIT(22)) {
> >
> > Perhaps
> >
> >     #define RTCA0SCMP_MIN    32000
> >     #define RTCA0SCMP_MASK    GEN_MASK(21. 0)
> >
> > and
> >
> >     if (rate < RTCA0SCMP_MIN || rate > FIELD_MAX(RTCA0SCMP_MASK) + 1)
> >
> > ?
>
> You really think this is more readable than the original code? I am
> really tired of bike-shedding so I don't care much, but I do wonder...

I don't mind the literal 32000, but the "> BIT(22)" looks rather
obscure, IMO.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux