From: Philipp Hahn <p.hahn@avm.de>
To: Wim Van Sebroeck <wim@linux-watchdog.org>,
Guenter Roeck <linux@roeck-us.net>
Cc: Philipp Hahn <phahn-oss@avm.de>,
linux-watchdog@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v3 2/5] watchdog: Move `struct` before name
Date: Tue, 5 May 2026 11:26:13 +0200 [thread overview]
Message-ID: <e66ec58f3b8252b3676cc9fe68818af95123210c.1777972790.git.phahn-oss@avm.de> (raw)
In-Reply-To: <cover.1777972790.git.phahn-oss@avm.de>
From: Philipp Hahn <phahn-oss@avm.de>
Write `struct ` before the structure name as Sphinx otherwise uses the
following word after it. See
https://docs.kernel.org/watchdog/watchdog-api.html#environmental-monitoring
Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
---
.../convert_drivers_to_kernel_api.rst | 24 +++++++++----------
Documentation/watchdog/watchdog-api.rst | 2 +-
.../watchdog/watchdog-kernel-api.rst | 2 +-
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/Documentation/watchdog/convert_drivers_to_kernel_api.rst b/Documentation/watchdog/convert_drivers_to_kernel_api.rst
index 9eddb962f8e4c..004fe6ef76e94 100644
--- a/Documentation/watchdog/convert_drivers_to_kernel_api.rst
+++ b/Documentation/watchdog/convert_drivers_to_kernel_api.rst
@@ -11,12 +11,12 @@ This document shall guide you for this task. The necessary steps are described
as well as things to look out for.
-Remove the file_operations struct
+Remove the struct file_operations
---------------------------------
Old drivers define their own file_operations for actions like open(), write(),
etc... These are now handled by the framework and just call the driver when
-needed. So, in general, the 'file_operations' struct and assorted functions can
+needed. So, in general, the struct file_operations and assorted functions can
go. Only very few driver-specific details have to be moved to other functions.
Here is a overview of the functions and probably needed actions:
@@ -36,7 +36,7 @@ Here is a overview of the functions and probably needed actions:
from the driver:
WDIOC_GETSUPPORT:
- Returns the mandatory watchdog_info struct from the driver
+ Returns the mandatory struct watchdog_info from the driver
WDIOC_GETSTATUS:
Needs the status-callback defined, otherwise returns 0
@@ -88,8 +88,8 @@ refactoring. The rest can go.
Remove the miscdevice
---------------------
-Since the file_operations are gone now, you can also remove the 'struct
-miscdevice'. The framework will create it on watchdog_dev_register() called by
+Since the file_operations are gone now, you can also remove the struct
+miscdevice. The framework will create it on watchdog_dev_register() called by
watchdog_register_device()::
-static struct miscdevice s3c2410wdt_miscdev = {
@@ -113,10 +113,10 @@ them. Includes can be removed, too. For example::
Add the watchdog operations
---------------------------
-All possible callbacks are defined in 'struct watchdog_ops'. You can find it
+All possible callbacks are defined in struct watchdog_ops. You can find it
explained in watchdog-kernel-api.rst in this directory. start() and
owner must be set, the rest are optional. You will easily find corresponding
-functions in the old driver. Note that you will now get a pointer to the
+functions in the old driver. Note that you will now get a pointer to the struct
watchdog_device as a parameter to these functions, so you probably have to
change the function header. Other changes are most likely not needed, because
here simply happens the direct hardware access. If you have device-specific
@@ -151,12 +151,12 @@ A typical function-header change looks like::
Add the watchdog device
-----------------------
-Now we need to create a 'struct watchdog_device' and populate it with the
-necessary information for the framework. The struct is also explained in detail
+Now we need to create a struct watchdog_device and populate it with the
+necessary information for the framework. The structure is also explained in detail
in watchdog-kernel-api.rst in this directory. We pass it the mandatory
-watchdog_info struct and the newly created watchdog_ops. Often, old drivers
+struct watchdog_info and the newly created struct watchdog_ops. Often, old drivers
have their own record-keeping for things like bootstatus and timeout using
-static variables. Those have to be converted to use the members in
+static variables. Those have to be converted to use the members in struct
watchdog_device. Note that the timeout values are unsigned int. Some drivers
use signed int, so this has to be converted, too.
@@ -174,7 +174,7 @@ Handle the 'nowayout' feature
A few drivers use nowayout statically, i.e. there is no module parameter for it
and only CONFIG_WATCHDOG_NOWAYOUT determines if the feature is going to be
used. This needs to be converted by initializing the status variable of the
-watchdog_device like this::
+struct watchdog_device like this::
.status = WATCHDOG_NOWAYOUT_INIT_STATUS,
diff --git a/Documentation/watchdog/watchdog-api.rst b/Documentation/watchdog/watchdog-api.rst
index 78e228c272cf8..2c138eaa43397 100644
--- a/Documentation/watchdog/watchdog-api.rst
+++ b/Documentation/watchdog/watchdog-api.rst
@@ -158,7 +158,7 @@ available to ask what the device can do::
struct watchdog_info ident;
ioctl(fd, WDIOC_GETSUPPORT, &ident);
-the fields returned in the ident struct are:
+the fields returned in the struct watchdog_info are:
================ =============================================
identity a string identifying the watchdog driver
diff --git a/Documentation/watchdog/watchdog-kernel-api.rst b/Documentation/watchdog/watchdog-kernel-api.rst
index 5649c54cf6fbe..e2c1386c95509 100644
--- a/Documentation/watchdog/watchdog-kernel-api.rst
+++ b/Documentation/watchdog/watchdog-kernel-api.rst
@@ -257,7 +257,7 @@ bit-operations. The status bits that are defined are:
To set the WDOG_NO_WAY_OUT status bit (before registering your watchdog
timer device) you can either:
- * set it statically in your watchdog_device struct with
+ * set it statically in your struct watchdog_device with
.status = WATCHDOG_NOWAYOUT_INIT_STATUS,
--
2.43.0
next prev parent reply other threads:[~2026-05-05 9:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-05 9:26 [PATCH v3 0/5] Cleanup Linux Watchdog documentation Philipp Hahn
2026-05-05 9:26 ` [PATCH v3 1/5] watchdog: Change suffix .txt to .rst in references Philipp Hahn
2026-05-05 13:08 ` Guenter Roeck
2026-05-05 9:26 ` Philipp Hahn [this message]
2026-05-05 13:09 ` [PATCH v3 2/5] watchdog: Move `struct` before name Guenter Roeck
2026-05-05 9:26 ` [PATCH v3 3/5] watchdog: Replace intermixed tab/space indent Philipp Hahn
2026-05-05 9:26 ` [PATCH v3 4/5] watchdog: Separate kind of documentation Philipp Hahn
2026-05-05 13:11 ` Guenter Roeck
2026-05-05 9:26 ` [PATCH v3 5/5] watchdog: Prefix WDT with ICS for clarity Philipp Hahn
2026-05-05 13:12 ` 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=e66ec58f3b8252b3676cc9fe68818af95123210c.1777972790.git.phahn-oss@avm.de \
--to=p.hahn@avm.de \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=phahn-oss@avm.de \
--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