From: Hans Zhang <18255117159@163.com>
To: Guenter Roeck <linux@roeck-us.net>,
sander@svanheule.net, wim@linux-watchdog.org
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: realtek_otto: Use FIELD_MODIFY()
Date: Thu, 30 Apr 2026 23:56:26 +0800 [thread overview]
Message-ID: <52340c25-3e6d-4cf8-ab92-b01db5fac802@163.com> (raw)
In-Reply-To: <2ca08749-f1b6-49c5-9281-c4f5b37e890e@roeck-us.net>
On 4/30/26 23:53, Guenter Roeck wrote:
> On 4/30/26 08:42, Hans Zhang wrote:
>> Use FIELD_MODIFY() to remove open-coded bit manipulation.
>> No functional change intended.
>>
>> Signed-off-by: Hans Zhang <18255117159@163.com>
>
> Please refrain from making non-functional changes such as this one.
>
OK, maybe everyone has different preferences. Please ignore it.
Hans
> Guenter
>
>> ---
>> drivers/watchdog/realtek_otto_wdt.c | 11 ++++-------
>> 1 file changed, 4 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/watchdog/realtek_otto_wdt.c b/drivers/watchdog/
>> realtek_otto_wdt.c
>> index 2c30ddd574c5..cf4841583721 100644
>> --- a/drivers/watchdog/realtek_otto_wdt.c
>> +++ b/drivers/watchdog/realtek_otto_wdt.c
>> @@ -149,11 +149,9 @@ static int otto_wdt_determine_timeouts(struct
>> watchdog_device *wdev, unsigned in
>> || phase2_ticks > OTTO_WDT_PHASE_TICKS_MAX);
>> v = ioread32(ctrl->base + OTTO_WDT_REG_CTRL);
>> -
>> - v &= ~(OTTO_WDT_CTRL_PRESCALE | OTTO_WDT_CTRL_PHASE1 |
>> OTTO_WDT_CTRL_PHASE2);
>> - v |= FIELD_PREP(OTTO_WDT_CTRL_PHASE1, phase1_ticks - 1);
>> - v |= FIELD_PREP(OTTO_WDT_CTRL_PHASE2, phase2_ticks - 1);
>> - v |= FIELD_PREP(OTTO_WDT_CTRL_PRESCALE, prescale);
>> + FIELD_MODIFY(OTTO_WDT_CTRL_PHASE1, &v, phase1_ticks - 1);
>> + FIELD_MODIFY(OTTO_WDT_CTRL_PHASE2, &v, phase2_ticks - 1);
>> + FIELD_MODIFY(OTTO_WDT_CTRL_PRESCALE, &v, prescale);
>> iowrite32(v, ctrl->base + OTTO_WDT_REG_CTRL);
>> @@ -279,8 +277,7 @@ static int otto_wdt_probe_reset_mode(struct
>> otto_wdt_ctrl *ctrl)
>> return -EINVAL;
>> v = ioread32(ctrl->base + OTTO_WDT_REG_CTRL);
>> - v &= ~OTTO_WDT_CTRL_RST_MODE;
>> - v |= FIELD_PREP(OTTO_WDT_CTRL_RST_MODE, mode);
>> + FIELD_MODIFY(OTTO_WDT_CTRL_RST_MODE, &v, mode);
>> iowrite32(v, ctrl->base + OTTO_WDT_REG_CTRL);
>> return 0;
>>
>> base-commit: 3b3bea6d4b9c162f9e555905d96b8c1da67ecd5b
prev parent reply other threads:[~2026-04-30 15:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 15:42 Hans Zhang
2026-04-30 15:53 ` Guenter Roeck
2026-04-30 15:56 ` Hans Zhang [this message]
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=52340c25-3e6d-4cf8-ab92-b01db5fac802@163.com \
--to=18255117159@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=sander@svanheule.net \
--cc=wim@linux-watchdog.org \
/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®