From: Jani Nikula <jani.nikula@linux.intel.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>,
linux-kernel@vger.kernel.org,
"Rafael J. Wysocki" <rafael@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
linux-pm@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
linux-doc@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: Re: [PATCH v4] kernel.h: add comments for system_states
Date: Mon, 08 Sep 2025 12:36:04 +0300 [thread overview]
Message-ID: <a016a06ceaa05b446d06d669cc8bac43a64c72c8@intel.com> (raw)
In-Reply-To: <b47c91a4f4c337ec8e2fdb663e0a90fd62b5c3b6.camel@HansenPartnership.com>
On Sat, 06 Sep 2025, James Bottomley <James.Bottomley@HansenPartnership.com> wrote:
> On Fri, 2025-09-05 at 16:06 +0300, Jani Nikula wrote:
>> On Fri, 05 Sep 2025, Mauro Carvalho Chehab
>> <mchehab+huawei@kernel.org> wrote:
>> > Em Fri, 05 Sep 2025 12:02:37 +0300
>> > Jani Nikula <jani.nikula@linux.intel.com> escreveu:
>> >
>> > > On Wed, 03 Sep 2025, Randy Dunlap <rdunlap@infradead.org> wrote:
> [...]
>> > > > +++ linux-next-20250819/Documentation/driver-api/pm/devices.rst
>> > > > @@ -241,6 +241,14 @@ before reactivating its class I/O queues
>> > > > More power-aware drivers might prepare the devices for
>> > > > triggering system wakeup
>> > > > events.
>> > > >
>> > > > +System states available for drivers
>> > > > +-----------------------------------
>> > > > +
>> > > > +These system states are available for drivers to help them
>> > > > determine how to
>> > > > +handle state transitions.
>> > > > +
>> > > > +.. kernel-doc:: include/linux/kernel.h
>> > > > + :doc: General system_states available for drivers
>> > > >
>> > > > Call Sequence Guarantees
>> > > > ------------------------
>> > > >
>> > >
>> >
>> > If the problem is with "extern" before enum, fixing kdoc be
>> > fairly trivial.
>>
>> The non-trivial part is deciding whether you're documenting the enum
>> type or the variable. Both are equally valid options.
>
> If you're building a system that's easy to maintain, it shouldn't be at
> all non trivial: you add the documentation where someone adding a new
> state would find it. i.e. on the enum. If you document the variable,
> no-one adding a new state would likely look at it. I get that in this
> case they're one after the other, but think about the precedent for
> when they're not.
Ah, I meant deciding what the *tool* should do with the documentation
when the type and the variable are bundled together like here.
BR,
Jani.
--
Jani Nikula, Intel
next prev parent reply other threads:[~2025-09-08 9:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 6:36 [PATCH v4] kernel.h: add comments for system_states Randy Dunlap
2025-09-05 9:02 ` Jani Nikula
2025-09-05 12:11 ` Mauro Carvalho Chehab
2025-09-05 13:06 ` Jani Nikula
2025-09-05 13:38 ` Mauro Carvalho Chehab
2025-09-05 22:07 ` Randy Dunlap
2025-09-06 8:56 ` Mauro Carvalho Chehab
2025-09-06 17:13 ` Randy Dunlap
2025-09-06 21:30 ` Mauro Carvalho Chehab
2025-09-07 13:35 ` Mauro Carvalho Chehab
2025-09-07 16:17 ` Mauro Carvalho Chehab
2025-09-08 9:22 ` Jani Nikula
2025-09-08 11:08 ` Mauro Carvalho Chehab
2025-09-07 21:46 ` Mauro Carvalho Chehab
2025-09-06 12:13 ` James Bottomley
2025-09-08 9:36 ` Jani Nikula [this message]
2025-09-05 22:00 ` Randy Dunlap
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=a016a06ceaa05b446d06d669cc8bac43a64c72c8@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=gregkh@linuxfoundation.org \
--cc=len.brown@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mchehab+huawei@kernel.org \
--cc=mchehab@kernel.org \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.org \
--cc=rdunlap@infradead.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