[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <45f04f10-a003-fc42-2551-a2e180358ca8@linux.intel.com>
Date: Mon, 8 Sep 2025 13:37:22 +0300 (EEST)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Daniel <dany97@...e.ca>
cc: LKML <linux-kernel@...r.kernel.org>, matan@...alib.org,
platform-driver-x86@...r.kernel.org
Subject: Re: [PATCH] platform/x86: lg-laptop: Fix WMAB call in
fan_mode_store
On Sat, 6 Sep 2025, Daniel wrote:
> > Is it okay to remove preserving the other bits?
>
> The WMAB call reads only the lower nibble or the upper nibble from the
> lowest byte. Similarly when the fan status is read from WMAB, something
> of the form ((x << 4) | x) is always returned.
So the upper portion of the mask in the old code was overkill? Please note
that down into the changelog so it's recorded into the git history. This
avoids somebody having to wonder why a seemingly unrelated change like
that was made if somebody looks at this commit after a few years from the
git history.
> > Please name these field with defined GENMASK() and then use FIELD_PREP()
> > here for both fields.
>
> I don't see why something like that should be necessary, seems overkill,
> but if you insist then I'll do it.
Yes, I insist. When we touch older code, the expectation is to use modern
style and helpers. In here, naming the fields will improve readability
and document the fields more explicitly.
> I'll try to send another patch sometime soon, I've been very busy.
Don't worry, there's time. :-)
--
i.
Powered by blists - more mailing lists