Skip to content

Commit abc59fd

Browse files
committed
docs: remove some replace macros like |struct foo|
There are three files with replace macros for structs, mapping them into Sphinx 2.x C domain references. Well, this is broken on Sphinx 3.x. Also, for Sphinx 2.x, the automarkup macro should be able to take care of them. So, let's just drop those. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent 5b76632 commit abc59fd

3 files changed

Lines changed: 38 additions & 48 deletions

File tree

‎Documentation/admin-guide/pm/cpufreq.rst‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.. SPDX-License-Identifier: GPL-2.0
22
.. include:: <isonum.txt>
33

4-
.. |struct cpufreq_policy| replace:: :c:type:`struct cpufreq_policy <cpufreq_policy>`
54
.. |intel_pstate| replace:: :doc:`intel_pstate <intel_pstate>`
65

76
=======================
@@ -92,16 +91,16 @@ control the P-state of multiple CPUs at the same time and writing to it affects
9291
all of those CPUs simultaneously.
9392

9493
Sets of CPUs sharing hardware P-state control interfaces are represented by
95-
``CPUFreq`` as |struct cpufreq_policy| objects. For consistency,
96-
|struct cpufreq_policy| is also used when there is only one CPU in the given
94+
``CPUFreq`` as struct cpufreq_policy objects. For consistency,
95+
struct cpufreq_policy is also used when there is only one CPU in the given
9796
set.
9897

99-
The ``CPUFreq`` core maintains a pointer to a |struct cpufreq_policy| object for
98+
The ``CPUFreq`` core maintains a pointer to a struct cpufreq_policy object for
10099
every CPU in the system, including CPUs that are currently offline. If multiple
101100
CPUs share the same hardware P-state control interface, all of the pointers
102-
corresponding to them point to the same |struct cpufreq_policy| object.
101+
corresponding to them point to the same struct cpufreq_policy object.
103102

104-
``CPUFreq`` uses |struct cpufreq_policy| as its basic data type and the design
103+
``CPUFreq`` uses struct cpufreq_policy as its basic data type and the design
105104
of its user space interface is based on the policy concept.
106105

107106

‎Documentation/driver-api/device_link.rst‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
.. |struct dev_pm_domain| replace:: :c:type:`struct dev_pm_domain <dev_pm_domain>`
2-
.. |struct generic_pm_domain| replace:: :c:type:`struct generic_pm_domain <generic_pm_domain>`
3-
4-
51
.. _device_link:
62

73
============
@@ -166,7 +162,7 @@ Examples
166162
is the same as if the MMU was the parent of the master device.
167163

168164
The fact that both devices share the same power domain would normally
169-
suggest usage of a |struct dev_pm_domain| or |struct generic_pm_domain|,
165+
suggest usage of a struct dev_pm_domain or struct generic_pm_domain,
170166
however these are not independent devices that happen to share a power
171167
switch, but rather the MMU device serves the busmaster device and is
172168
useless without it. A device link creates a synthetic hierarchical
@@ -202,7 +198,7 @@ Examples
202198
Alternatives
203199
============
204200

205-
* A |struct dev_pm_domain| can be used to override the bus,
201+
* A struct dev_pm_domain can be used to override the bus,
206202
class or device type callbacks. It is intended for devices sharing
207203
a single on/off switch, however it does not guarantee a specific
208204
suspend/resume ordering, this needs to be implemented separately.
@@ -211,7 +207,7 @@ Alternatives
211207
suspended. Furthermore it cannot be used to enforce a specific shutdown
212208
ordering or a driver presence dependency.
213209

214-
* A |struct generic_pm_domain| is a lot more heavyweight than a
210+
* A struct generic_pm_domain is a lot more heavyweight than a
215211
device link and does not allow for shutdown ordering or driver presence
216212
dependencies. It also cannot be used on ACPI systems.
217213

‎Documentation/driver-api/pm/cpuidle.rst‎

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
.. SPDX-License-Identifier: GPL-2.0
22
.. include:: <isonum.txt>
33

4-
.. |struct cpuidle_governor| replace:: :c:type:`struct cpuidle_governor <cpuidle_governor>`
5-
.. |struct cpuidle_device| replace:: :c:type:`struct cpuidle_device <cpuidle_device>`
6-
.. |struct cpuidle_driver| replace:: :c:type:`struct cpuidle_driver <cpuidle_driver>`
7-
.. |struct cpuidle_state| replace:: :c:type:`struct cpuidle_state <cpuidle_state>`
8-
94
========================
105
CPU Idle Time Management
116
========================
@@ -54,7 +49,7 @@ platform that the Linux kernel can run on. For this reason, data structures
5449
operated on by them cannot depend on any hardware architecture or platform
5550
design details as well.
5651

57-
The governor itself is represented by a |struct cpuidle_governor| object
52+
The governor itself is represented by a struct cpuidle_governor object
5853
containing four callback pointers, :c:member:`enable`, :c:member:`disable`,
5954
:c:member:`select`, :c:member:`reflect`, a :c:member:`rating` field described
6055
below, and a name (string) used for identifying it.
@@ -83,11 +78,11 @@ callbacks:
8378
int (*enable) (struct cpuidle_driver *drv, struct cpuidle_device *dev);
8479

8580
The role of this callback is to prepare the governor for handling the
86-
(logical) CPU represented by the |struct cpuidle_device| object pointed
87-
to by the ``dev`` argument. The |struct cpuidle_driver| object pointed
81+
(logical) CPU represented by the struct cpuidle_device object pointed
82+
to by the ``dev`` argument. The struct cpuidle_driver object pointed
8883
to by the ``drv`` argument represents the ``CPUIdle`` driver to be used
8984
with that CPU (among other things, it should contain the list of
90-
|struct cpuidle_state| objects representing idle states that the
85+
struct cpuidle_state objects representing idle states that the
9186
processor holding the given CPU can be asked to enter).
9287

9388
It may fail, in which case it is expected to return a negative error
@@ -102,7 +97,7 @@ callbacks:
10297
void (*disable) (struct cpuidle_driver *drv, struct cpuidle_device *dev);
10398

10499
Called to make the governor stop handling the (logical) CPU represented
105-
by the |struct cpuidle_device| object pointed to by the ``dev``
100+
by the struct cpuidle_device object pointed to by the ``dev``
106101
argument.
107102

108103
It is expected to reverse any changes made by the ``->enable()``
@@ -116,12 +111,12 @@ callbacks:
116111
bool *stop_tick);
117112

118113
Called to select an idle state for the processor holding the (logical)
119-
CPU represented by the |struct cpuidle_device| object pointed to by the
114+
CPU represented by the struct cpuidle_device object pointed to by the
120115
``dev`` argument.
121116

122117
The list of idle states to take into consideration is represented by the
123-
:c:member:`states` array of |struct cpuidle_state| objects held by the
124-
|struct cpuidle_driver| object pointed to by the ``drv`` argument (which
118+
:c:member:`states` array of struct cpuidle_state objects held by the
119+
struct cpuidle_driver object pointed to by the ``drv`` argument (which
125120
represents the ``CPUIdle`` driver to be used with the CPU at hand). The
126121
value returned by this callback is interpreted as an index into that
127122
array (unless it is a negative error code).
@@ -136,7 +131,7 @@ callbacks:
136131
asking the processor to enter the idle state).
137132

138133
This callback is mandatory (i.e. the :c:member:`select` callback pointer
139-
in |struct cpuidle_governor| must not be ``NULL`` for the registration
134+
in struct cpuidle_governor must not be ``NULL`` for the registration
140135
of the governor to succeed).
141136

142137
:c:member:`reflect`
@@ -167,21 +162,21 @@ CPU idle time management (``CPUIdle``) drivers provide an interface between the
167162
other parts of ``CPUIdle`` and the hardware.
168163

169164
First of all, a ``CPUIdle`` driver has to populate the :c:member:`states` array
170-
of |struct cpuidle_state| objects included in the |struct cpuidle_driver| object
165+
of struct cpuidle_state objects included in the struct cpuidle_driver object
171166
representing it. Going forward this array will represent the list of available
172167
idle states that the processor hardware can be asked to enter shared by all of
173168
the logical CPUs handled by the given driver.
174169

175170
The entries in the :c:member:`states` array are expected to be sorted by the
176-
value of the :c:member:`target_residency` field in |struct cpuidle_state| in
171+
value of the :c:member:`target_residency` field in struct cpuidle_state in
177172
the ascending order (that is, index 0 should correspond to the idle state with
178173
the minimum value of :c:member:`target_residency`). [Since the
179174
:c:member:`target_residency` value is expected to reflect the "depth" of the
180-
idle state represented by the |struct cpuidle_state| object holding it, this
175+
idle state represented by the struct cpuidle_state object holding it, this
181176
sorting order should be the same as the ascending sorting order by the idle
182177
state "depth".]
183178

184-
Three fields in |struct cpuidle_state| are used by the existing ``CPUIdle``
179+
Three fields in struct cpuidle_state are used by the existing ``CPUIdle``
185180
governors for computations related to idle state selection:
186181

187182
:c:member:`target_residency`
@@ -203,7 +198,7 @@ governors for computations related to idle state selection:
203198
any idle state at all. [There are other flags used by the ``CPUIdle``
204199
core in special situations.]
205200

206-
The :c:member:`enter` callback pointer in |struct cpuidle_state|, which must not
201+
The :c:member:`enter` callback pointer in struct cpuidle_state, which must not
207202
be ``NULL``, points to the routine to execute in order to ask the processor to
208203
enter this particular idle state:
209204

@@ -212,63 +207,63 @@ enter this particular idle state:
212207
void (*enter) (struct cpuidle_device *dev, struct cpuidle_driver *drv,
213208
int index);
214209

215-
The first two arguments of it point to the |struct cpuidle_device| object
210+
The first two arguments of it point to the struct cpuidle_device object
216211
representing the logical CPU running this callback and the
217-
|struct cpuidle_driver| object representing the driver itself, respectively,
218-
and the last one is an index of the |struct cpuidle_state| entry in the driver's
212+
struct cpuidle_driver object representing the driver itself, respectively,
213+
and the last one is an index of the struct cpuidle_state entry in the driver's
219214
:c:member:`states` array representing the idle state to ask the processor to
220215
enter.
221216

222-
The analogous ``->enter_s2idle()`` callback in |struct cpuidle_state| is used
217+
The analogous ``->enter_s2idle()`` callback in struct cpuidle_state is used
223218
only for implementing the suspend-to-idle system-wide power management feature.
224219
The difference between in and ``->enter()`` is that it must not re-enable
225220
interrupts at any point (even temporarily) or attempt to change the states of
226221
clock event devices, which the ``->enter()`` callback may do sometimes.
227222

228223
Once the :c:member:`states` array has been populated, the number of valid
229224
entries in it has to be stored in the :c:member:`state_count` field of the
230-
|struct cpuidle_driver| object representing the driver. Moreover, if any
225+
struct cpuidle_driver object representing the driver. Moreover, if any
231226
entries in the :c:member:`states` array represent "coupled" idle states (that
232227
is, idle states that can only be asked for if multiple related logical CPUs are
233-
idle), the :c:member:`safe_state_index` field in |struct cpuidle_driver| needs
228+
idle), the :c:member:`safe_state_index` field in struct cpuidle_driver needs
234229
to be the index of an idle state that is not "coupled" (that is, one that can be
235230
asked for if only one logical CPU is idle).
236231

237232
In addition to that, if the given ``CPUIdle`` driver is only going to handle a
238233
subset of logical CPUs in the system, the :c:member:`cpumask` field in its
239-
|struct cpuidle_driver| object must point to the set (mask) of CPUs that will be
234+
struct cpuidle_driver object must point to the set (mask) of CPUs that will be
240235
handled by it.
241236

242237
A ``CPUIdle`` driver can only be used after it has been registered. If there
243238
are no "coupled" idle state entries in the driver's :c:member:`states` array,
244-
that can be accomplished by passing the driver's |struct cpuidle_driver| object
239+
that can be accomplished by passing the driver's struct cpuidle_driver object
245240
to :c:func:`cpuidle_register_driver()`. Otherwise, :c:func:`cpuidle_register()`
246241
should be used for this purpose.
247242

248-
However, it also is necessary to register |struct cpuidle_device| objects for
243+
However, it also is necessary to register struct cpuidle_device objects for
249244
all of the logical CPUs to be handled by the given ``CPUIdle`` driver with the
250245
help of :c:func:`cpuidle_register_device()` after the driver has been registered
251246
and :c:func:`cpuidle_register_driver()`, unlike :c:func:`cpuidle_register()`,
252247
does not do that automatically. For this reason, the drivers that use
253248
:c:func:`cpuidle_register_driver()` to register themselves must also take care
254-
of registering the |struct cpuidle_device| objects as needed, so it is generally
249+
of registering the struct cpuidle_device objects as needed, so it is generally
255250
recommended to use :c:func:`cpuidle_register()` for ``CPUIdle`` driver
256251
registration in all cases.
257252

258-
The registration of a |struct cpuidle_device| object causes the ``CPUIdle``
253+
The registration of a struct cpuidle_device object causes the ``CPUIdle``
259254
``sysfs`` interface to be created and the governor's ``->enable()`` callback to
260255
be invoked for the logical CPU represented by it, so it must take place after
261256
registering the driver that will handle the CPU in question.
262257

263-
``CPUIdle`` drivers and |struct cpuidle_device| objects can be unregistered
258+
``CPUIdle`` drivers and struct cpuidle_device objects can be unregistered
264259
when they are not necessary any more which allows some resources associated with
265260
them to be released. Due to dependencies between them, all of the
266-
|struct cpuidle_device| objects representing CPUs handled by the given
261+
struct cpuidle_device objects representing CPUs handled by the given
267262
``CPUIdle`` driver must be unregistered, with the help of
268263
:c:func:`cpuidle_unregister_device()`, before calling
269264
:c:func:`cpuidle_unregister_driver()` to unregister the driver. Alternatively,
270265
:c:func:`cpuidle_unregister()` can be called to unregister a ``CPUIdle`` driver
271-
along with all of the |struct cpuidle_device| objects representing CPUs handled
266+
along with all of the struct cpuidle_device objects representing CPUs handled
272267
by it.
273268

274269
``CPUIdle`` drivers can respond to runtime system configuration changes that
@@ -277,8 +272,8 @@ happen, for example, when the system's power source is switched from AC to
277272
battery or the other way around). Upon a notification of such a change,
278273
a ``CPUIdle`` driver is expected to call :c:func:`cpuidle_pause_and_lock()` to
279274
turn ``CPUIdle`` off temporarily and then :c:func:`cpuidle_disable_device()` for
280-
all of the |struct cpuidle_device| objects representing CPUs affected by that
275+
all of the struct cpuidle_device objects representing CPUs affected by that
281276
change. Next, it can update its :c:member:`states` array in accordance with
282277
the new configuration of the system, call :c:func:`cpuidle_enable_device()` for
283-
all of the relevant |struct cpuidle_device| objects and invoke
278+
all of the relevant struct cpuidle_device objects and invoke
284279
:c:func:`cpuidle_resume_and_unlock()` to allow ``CPUIdle`` to be used again.

0 commit comments

Comments
 (0)