From: Guenter Roeck <linux@roeck-us.net>
To: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Cc: "Derek John Clark" <derekjohn.clark@gmail.com>,
"Joaquín Ignacio Aramendía" <samsagax@gmail.com>,
"Jean Delvare" <jdelvare@suse.com>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] hwmon: (oxp-sensors) Fix wording in code comment
Date: Tue, 7 Jan 2025 09:24:50 -0800 [thread overview]
Message-ID: <eaca7150-a259-40a7-8faa-b4ad7897f375@roeck-us.net> (raw)
In-Reply-To: <7284955a-fadf-497c-a7e4-6c261c84d32a@math.uni-bielefeld.de>
On Thu, Dec 26, 2024 at 11:56:12PM +0100, Tobias Jakobi wrote:
>
> On 12/26/24 21:52, Guenter Roeck wrote:
> > On Thu, Dec 26, 2024 at 06:00:18PM +0100, tjakobi@math.uni-bielefeld.de wrote:
> > > From: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> > >
> > > Despite what the current comment says, the register is used
> > > both for reading and writing the PWM value.
> > >
> > > Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> > > ---
> > > drivers/hwmon/oxp-sensors.c | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/hwmon/oxp-sensors.c b/drivers/hwmon/oxp-sensors.c
> > > index fbd1463d1494..8089349fa508 100644
> > > --- a/drivers/hwmon/oxp-sensors.c
> > > +++ b/drivers/hwmon/oxp-sensors.c
> > > @@ -46,14 +46,14 @@ static bool unlock_global_acpi_lock(void)
> > > #define OXP_SENSOR_FAN_REG 0x76 /* Fan reading is 2 registers long */
> > > #define OXP_2_SENSOR_FAN_REG 0x58 /* Fan reading is 2 registers long */
> > > #define OXP_SENSOR_PWM_ENABLE_REG 0x4A /* PWM enable is 1 register long */
> > > -#define OXP_SENSOR_PWM_REG 0x4B /* PWM reading is 1 register long */
> > > +#define OXP_SENSOR_PWM_REG 0x4B /* PWM control is 1 register long */
> >
> > I think that, if anything, this is more confusing than before.
> > "control" is, for example, enabling or disabling pwm management,
> > setting automatic or manual mode, or setting the pwm polarity.
> > Together ith the next two defines, "control" would suggest that
> > PWM_MODE_AUTO and PWM_MODE_MANUAL are set through that register -
> > which is not the case. "value" maybe, but "control" is just wrong.
> Noted. What do you think about "target" then?
>
> My main point here was that reading implies that this register is read-only.
> Which it clearly isn't. And the documentation (which could be certainly be
> improved in general) should reflect that.
>
"reading and writing the PWM value". "target" implies writing. "register"
implies neither, so you could use that.
Guenter
next prev parent reply other threads:[~2025-01-07 17:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-26 17:00 [PATCH 0/4] hwmon: (oxp-sensors) Cleanup device type handling tjakobi
2024-12-26 17:00 ` [PATCH 1/4] hwmon: (oxp-sensors) Separate logic from device-specific data tjakobi
2024-12-26 20:54 ` Guenter Roeck
2024-12-26 22:59 ` Tobias Jakobi
2025-01-07 17:33 ` Guenter Roeck
2024-12-26 21:04 ` Guenter Roeck
2024-12-26 23:05 ` Tobias Jakobi
2025-01-07 17:34 ` Guenter Roeck
2024-12-26 17:00 ` [PATCH 2/4] hwmon: (oxp-sensors) Fix typos in documentation tjakobi
2024-12-26 17:00 ` [PATCH 3/4] hwmon: (oxp-sensors) Fix wording in code comment tjakobi
2024-12-26 20:52 ` Guenter Roeck
2024-12-26 22:56 ` Tobias Jakobi
2025-01-07 17:24 ` Guenter Roeck [this message]
2024-12-26 17:00 ` [PATCH 4/4] hwmon: (oxp-sensors) Cache state of PWM enable mode tjakobi
2024-12-26 21:05 ` Guenter Roeck
2024-12-26 23:13 ` Tobias Jakobi
2025-01-07 17:43 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eaca7150-a259-40a7-8faa-b4ad7897f375@roeck-us.net \
--to=linux@roeck-us.net \
--cc=derekjohn.clark@gmail.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=samsagax@gmail.com \
--cc=tjakobi@math.uni-bielefeld.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®