Re: [GIT PULL] ACPI fixes for v6.9-rc6

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


On Thu, 25 Apr 2024 at 11:58, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> When that macro now has had TWO independent bugs, how about you just
> write it out with explicit types and without any broken "helpers":
>    static inline u64 MASK_VAL(const struct cpc_reg *reg, u64 val)
>    {
>         u64 mask = (1ull << reg->bit_width)-1;
>         return (val >> reg->bit_offset) & mask;
>    }
> which is a few more lines, but doesn't that make it a whole lot more readable?
> And maybe this time, it's not a buggy mess?

Just to clarify: that was written in the MUA, and entirely untested.
Somebody should still verify it, but really, with already now two
bugs, that macro needs fixing for good, and the "for good" should be
looking at least _something_ like the above.

And despite needing fixing, I've done the pull, since bug #2 is at
least less bad than bug#1 was.


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux