Skip to content

Commit

Permalink
docs: get rid of :c:type explicit declarations for structs
Browse files Browse the repository at this point in the history
The :c:type:`foo` only works properly with structs before
Sphinx 3.x.

On Sphinx 3.x, structs should now be declared using the
.. c:struct, and referenced via :c:struct tag.

As we now have the automarkup.py macro, that automatically
convert:
	struct foo

into cross-references, let's get rid of that, solving
several warnings when building docs with Sphinx 3.x.

Reviewed-by: André Almeida <andrealmeid@collabora.com> # blk-mq.rst
Reviewed-by: Takashi Iwai <tiwai@suse.de> # sound
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
mchehab committed Oct 15, 2020
1 parent abc59fd commit 9303c9d
Show file tree
Hide file tree
Showing 29 changed files with 86 additions and 86 deletions.
8 changes: 4 additions & 4 deletions Documentation/block/blk-mq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ Software staging queues
~~~~~~~~~~~~~~~~~~~~~~~

The block IO subsystem adds requests in the software staging queues
(represented by struct :c:type:`blk_mq_ctx`) in case that they weren't sent
(represented by struct blk_mq_ctx) in case that they weren't sent
directly to the driver. A request is one or more BIOs. They arrived at the
block layer through the data structure struct :c:type:`bio`. The block layer
will then build a new structure from it, the struct :c:type:`request` that will
block layer through the data structure struct bio. The block layer
will then build a new structure from it, the struct request that will
be used to communicate with the device driver. Each queue has its own lock and
the number of queues is defined by a per-CPU or per-node basis.

Expand Down Expand Up @@ -102,7 +102,7 @@ hardware queue will be drained in sequence according to their mapping.
Hardware dispatch queues
~~~~~~~~~~~~~~~~~~~~~~~~

The hardware queue (represented by struct :c:type:`blk_mq_hw_ctx`) is a struct
The hardware queue (represented by struct blk_mq_hw_ctx) is a struct
used by device drivers to map the device submission queues (or device DMA ring
buffer), and are the last step of the block layer submission code before the
low level device driver taking ownership of the request. To run this queue, the
Expand Down
8 changes: 4 additions & 4 deletions Documentation/block/inline-encryption.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Constraints and notes
Design
======

We add a :c:type:`struct bio_crypt_ctx` to :c:type:`struct bio` that can
We add a struct bio_crypt_ctx to struct bio that can
represent an encryption context, because we need to be able to pass this
encryption context from the upper layers (like the fs layer) to the
device driver to act upon.
Expand Down Expand Up @@ -85,7 +85,7 @@ blk-mq changes, other block layer changes and blk-crypto-fallback
=================================================================

We add a pointer to a ``bi_crypt_context`` and ``keyslot`` to
:c:type:`struct request`. These will be referred to as the ``crypto fields``
struct request. These will be referred to as the ``crypto fields``
for the request. This ``keyslot`` is the keyslot into which the
``bi_crypt_context`` has been programmed in the KSM of the ``request_queue``
that this request is being sent to.
Expand Down Expand Up @@ -118,7 +118,7 @@ of the algorithm being used adheres to spec and functions correctly).
If a ``request queue``'s inline encryption hardware claimed to support the
encryption context specified with a bio, then it will not be handled by the
``blk-crypto-fallback``. We will eventually reach a point in blk-mq when a
:c:type:`struct request` needs to be allocated for that bio. At that point,
struct request needs to be allocated for that bio. At that point,
blk-mq tries to program the encryption context into the ``request_queue``'s
keyslot_manager, and obtain a keyslot, which it stores in its newly added
``keyslot`` field. This keyslot is released when the request is completed.
Expand Down Expand Up @@ -188,7 +188,7 @@ keyslots supported by the hardware.
The device driver also needs to tell the KSM how to actually manipulate the
IE hardware in the device to do things like programming the crypto key into
the IE hardware into a particular keyslot. All this is achieved through the
:c:type:`struct blk_ksm_ll_ops` field in the KSM that the device driver
struct blk_ksm_ll_ops field in the KSM that the device driver
must fill up after initing the ``blk_keyslot_manager``.

The KSM also handles runtime power management for the device when applicable
Expand Down
4 changes: 2 additions & 2 deletions Documentation/driver-api/fpga/fpga-bridge.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ FPGA Bridge
API to implement a new FPGA bridge
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* struct :c:type:`fpga_bridge` — The FPGA Bridge structure
* struct :c:type:`fpga_bridge_ops` — Low level Bridge driver ops
* struct fpga_bridge — The FPGA Bridge structure
* struct fpga_bridge_ops — Low level Bridge driver ops
* devm_fpga_bridge_create() — Allocate and init a bridge struct
* fpga_bridge_register() — Register a bridge
* fpga_bridge_unregister() — Unregister a bridge
Expand Down
4 changes: 2 additions & 2 deletions Documentation/driver-api/fpga/fpga-mgr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ API for implementing a new FPGA Manager driver
----------------------------------------------

* ``fpga_mgr_states`` — Values for :c:member:`fpga_manager->state`.
* struct :c:type:`fpga_manager` — the FPGA manager struct
* struct :c:type:`fpga_manager_ops` — Low level FPGA manager driver ops
* struct fpga_manager — the FPGA manager struct
* struct fpga_manager_ops — Low level FPGA manager driver ops
* devm_fpga_mgr_create() — Allocate and init a manager struct
* fpga_mgr_register() — Register an FPGA manager
* fpga_mgr_unregister() — Unregister an FPGA manager
Expand Down
2 changes: 1 addition & 1 deletion Documentation/driver-api/fpga/fpga-region.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ An example of usage can be seen in the probe function of [#f2]_.
API to add a new FPGA region
----------------------------

* struct :c:type:`fpga_region` — The FPGA region struct
* struct fpga_region — The FPGA region struct
* devm_fpga_region_create() — Allocate and init a region struct
* fpga_region_register() — Register an FPGA region
* fpga_region_unregister() — Unregister an FPGA region
Expand Down
2 changes: 1 addition & 1 deletion Documentation/driver-api/iio/buffers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Buffers
=======

* struct :c:type:`iio_buffer` — general buffer structure
* struct iio_buffer — general buffer structure
* :c:func:`iio_validate_scan_mask_onehot` — Validates that exactly one channel
is selected
* :c:func:`iio_buffer_get` — Grab a reference to the buffer
Expand Down
6 changes: 3 additions & 3 deletions Documentation/driver-api/iio/core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ applications manipulating sensors. The implementation can be found under
Industrial I/O Devices
----------------------

* struct :c:type:`iio_dev` - industrial I/O device
* struct iio_dev - industrial I/O device
* iio_device_alloc() - allocate an :c:type:`iio_dev` from a driver
* iio_device_free() - free an :c:type:`iio_dev` from a driver
* iio_device_register() - register a device with the IIO subsystem
Expand Down Expand Up @@ -66,7 +66,7 @@ Common attributes are:
IIO device channels
===================

struct :c:type:`iio_chan_spec` - specification of a single channel
struct iio_chan_spec - specification of a single channel

An IIO device channel is a representation of a data channel. An IIO device can
have one or multiple channels. For example:
Expand All @@ -77,7 +77,7 @@ have one or multiple channels. For example:
* an accelerometer can have up to 3 channels representing acceleration on X, Y
and Z axes.

An IIO channel is described by the struct :c:type:`iio_chan_spec`.
An IIO channel is described by the struct iio_chan_spec.
A thermometer driver for the temperature sensor in the example above would
have to describe its channel as follows::

Expand Down
2 changes: 1 addition & 1 deletion Documentation/driver-api/iio/hw-consumer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ software buffer for data. The implementation can be found under
:file:`drivers/iio/buffer/hw-consumer.c`


* struct :c:type:`iio_hw_consumer` — Hardware consumer structure
* struct iio_hw_consumer — Hardware consumer structure
* :c:func:`iio_hw_consumer_alloc` — Allocate IIO hardware consumer
* :c:func:`iio_hw_consumer_free` — Free IIO hardware consumer
* :c:func:`iio_hw_consumer_enable` — Enable IIO hardware consumer
Expand Down
2 changes: 1 addition & 1 deletion Documentation/driver-api/iio/triggered-buffers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ IIO triggered buffer setup
* :c:func:`iio_triggered_buffer_setup` — Setup triggered buffer and pollfunc
* :c:func:`iio_triggered_buffer_cleanup` — Free resources allocated by
:c:func:`iio_triggered_buffer_setup`
* struct :c:type:`iio_buffer_setup_ops` — buffer setup related callbacks
* struct iio_buffer_setup_ops — buffer setup related callbacks

A typical triggered buffer setup looks like this::

Expand Down
4 changes: 2 additions & 2 deletions Documentation/driver-api/iio/triggers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Triggers
========

* struct :c:type:`iio_trigger` — industrial I/O trigger device
* struct iio_trigger — industrial I/O trigger device
* :c:func:`devm_iio_trigger_alloc` — Resource-managed iio_trigger_alloc
* :c:func:`devm_iio_trigger_register` — Resource-managed iio_trigger_register
iio_trigger_unregister
Expand Down Expand Up @@ -63,7 +63,7 @@ Let's see a simple example of how to setup a trigger to be used by a driver::
IIO trigger ops
===============

* struct :c:type:`iio_trigger_ops` — operations structure for an iio_trigger.
* struct iio_trigger_ops — operations structure for an iio_trigger.

Notice that a trigger has a set of operations attached:

Expand Down
4 changes: 2 additions & 2 deletions Documentation/driver-api/media/dtv-frontend.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ responsible for tuning the device. It supports multiple algorithms to
detect a channel, as defined at enum :c:func:`dvbfe_algo`.

The algorithm to be used is obtained via ``.get_frontend_algo``. If the driver
doesn't fill its field at struct :c:type:`dvb_frontend_ops`, it will default to
doesn't fill its field at struct dvb_frontend_ops, it will default to
``DVBFE_ALGO_SW``, meaning that the dvb-core will do a zigzag when tuning,
e. g. it will try first to use the specified center frequency ``f``,
then, it will do ``f`` + |delta|, ``f`` - |delta|, ``f`` + 2 x |delta|,
Expand All @@ -140,7 +140,7 @@ define a ``.get_frontend_algo`` function that would return ``DVBFE_ALGO_HW``.
a third type (``DVBFE_ALGO_CUSTOM``), in order to allow the driver to
define its own hardware-assisted algorithm. Very few hardware need to
use it nowadays. Using ``DVBFE_ALGO_CUSTOM`` require to provide other
function callbacks at struct :c:type:`dvb_frontend_ops`.
function callbacks at struct dvb_frontend_ops.

Attaching frontend driver to the bridge driver
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
24 changes: 12 additions & 12 deletions Documentation/driver-api/media/mc-core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pad to a sink pad.
Media device
^^^^^^^^^^^^

A media device is represented by a struct :c:type:`media_device`
A media device is represented by a struct media_device
instance, defined in ``include/media/media-device.h``.
Allocation of the structure is handled by the media device driver, usually by
embedding the :c:type:`media_device` instance in a larger driver-specific
Expand All @@ -49,7 +49,7 @@ and unregistered by calling :c:func:`media_device_unregister()`.
Entities
^^^^^^^^

Entities are represented by a struct :c:type:`media_entity`
Entities are represented by a struct media_entity
instance, defined in ``include/media/media-entity.h``. The structure is usually
embedded into a higher-level structure, such as
:c:type:`v4l2_subdev` or :c:type:`video_device`
Expand All @@ -67,10 +67,10 @@ Interfaces
^^^^^^^^^^

Interfaces are represented by a
struct :c:type:`media_interface` instance, defined in
struct media_interface instance, defined in
``include/media/media-entity.h``. Currently, only one type of interface is
defined: a device node. Such interfaces are represented by a
struct :c:type:`media_intf_devnode`.
struct media_intf_devnode.

Drivers initialize and create device node interfaces by calling
:c:func:`media_devnode_create()`
Expand All @@ -79,16 +79,16 @@ and remove them by calling:

Pads
^^^^
Pads are represented by a struct :c:type:`media_pad` instance,
Pads are represented by a struct media_pad instance,
defined in ``include/media/media-entity.h``. Each entity stores its pads in
a pads array managed by the entity driver. Drivers usually embed the array in
a driver-specific structure.

Pads are identified by their entity and their 0-based index in the pads
array.

Both information are stored in the struct :c:type:`media_pad`,
making the struct :c:type:`media_pad` pointer the canonical way
Both information are stored in the struct media_pad,
making the struct media_pad pointer the canonical way
to store and pass link references.

Pads have flags that describe the pad capabilities and state.
Expand All @@ -104,7 +104,7 @@ Pads have flags that describe the pad capabilities and state.
Links
^^^^^

Links are represented by a struct :c:type:`media_link` instance,
Links are represented by a struct media_link instance,
defined in ``include/media/media-entity.h``. There are two types of links:

**1. pad to pad links**:
Expand Down Expand Up @@ -187,7 +187,7 @@ Use count and power handling

Due to the wide differences between drivers regarding power management
needs, the media controller does not implement power management. However,
the struct :c:type:`media_entity` includes a ``use_count``
the struct media_entity includes a ``use_count``
field that media drivers
can use to track the number of users of every entity for power management
needs.
Expand All @@ -213,11 +213,11 @@ prevent link states from being modified during streaming by calling
The function will mark all entities connected to the given entity through
enabled links, either directly or indirectly, as streaming.

The struct :c:type:`media_pipeline` instance pointed to by
The struct media_pipeline instance pointed to by
the pipe argument will be stored in every entity in the pipeline.
Drivers should embed the struct :c:type:`media_pipeline`
Drivers should embed the struct media_pipeline
in higher-level pipeline structures and can then access the
pipeline through the struct :c:type:`media_entity`
pipeline through the struct media_entity
pipe field.

Calls to :c:func:`media_pipeline_start()` can be nested.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/driver-api/media/v4l2-controls.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ V4L2 specification with respect to controls in a central place. And to make
life as easy as possible for the driver developer.

Note that the control framework relies on the presence of a struct
:c:type:`v4l2_device` for V4L2 drivers and struct :c:type:`v4l2_subdev` for
:c:type:`v4l2_device` for V4L2 drivers and struct v4l2_subdev for
sub-device drivers.


Expand Down
8 changes: 4 additions & 4 deletions Documentation/driver-api/media/v4l2-dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ You should also set these fields of :c:type:`video_device`:
file operation is called this lock will be taken by the core and released
afterwards. See the next section for more details.

- :c:type:`video_device`->queue: a pointer to the struct :c:type:`vb2_queue`
- :c:type:`video_device`->queue: a pointer to the struct vb2_queue
associated with this device node.
If queue is not ``NULL``, and queue->lock is not ``NULL``, then queue->lock
is used for the queuing ioctls (``VIDIOC_REQBUFS``, ``CREATE_BUFS``,
Expand All @@ -81,7 +81,7 @@ You should also set these fields of :c:type:`video_device`:

- :c:type:`video_device`->prio: keeps track of the priorities. Used to
implement ``VIDIOC_G_PRIORITY`` and ``VIDIOC_S_PRIORITY``.
If left to ``NULL``, then it will use the struct :c:type:`v4l2_prio_state`
If left to ``NULL``, then it will use the struct v4l2_prio_state
in :c:type:`v4l2_device`. If you want to have a separate priority state per
(group of) device node(s), then you can point it to your own struct
:c:type:`v4l2_prio_state`.
Expand All @@ -95,7 +95,7 @@ You should also set these fields of :c:type:`video_device`:
but it is used by both a raw video PCI device (cx8800) and a MPEG PCI device
(cx8802). Since the :c:type:`v4l2_device` cannot be associated with two PCI
devices at the same time it is setup without a parent device. But when the
struct :c:type:`video_device` is initialized you **do** know which parent
struct video_device is initialized you **do** know which parent
PCI device to use and so you set ``dev_device`` to the correct PCI device.

If you use :c:type:`v4l2_ioctl_ops`, then you should set
Expand Down Expand Up @@ -138,7 +138,7 @@ ioctls and locking
------------------

The V4L core provides optional locking services. The main service is the
lock field in struct :c:type:`video_device`, which is a pointer to a mutex.
lock field in struct video_device, which is a pointer to a mutex.
If you set this pointer, then that will be used by unlocked_ioctl to
serialize all ioctls.

Expand Down
6 changes: 3 additions & 3 deletions Documentation/driver-api/media/v4l2-device.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
V4L2 device instance
--------------------

Each device instance is represented by a struct :c:type:`v4l2_device`.
Each device instance is represented by a struct v4l2_device.
Very simple devices can just allocate this struct, but most of the time you
would embed this struct inside a larger struct.

Expand All @@ -18,9 +18,9 @@ dev->driver_data field is ``NULL``, it will be linked to

Drivers that want integration with the media device framework need to set
dev->driver_data manually to point to the driver-specific device structure
that embed the struct :c:type:`v4l2_device` instance. This is achieved by a
that embed the struct v4l2_device instance. This is achieved by a
``dev_set_drvdata()`` call before registering the V4L2 device instance.
They must also set the struct :c:type:`v4l2_device` mdev field to point to a
They must also set the struct v4l2_device mdev field to point to a
properly initialized and registered :c:type:`media_device` instance.

If :c:type:`v4l2_dev <v4l2_device>`\ ->name is empty then it will be set to a
Expand Down
10 changes: 5 additions & 5 deletions Documentation/driver-api/media/v4l2-event.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ such objects.

So to summarize:

- struct :c:type:`v4l2_fh` has two lists: one of the ``subscribed`` events,
- struct v4l2_fh has two lists: one of the ``subscribed`` events,
and one of the ``available`` events.

- struct :c:type:`v4l2_subscribed_event` has a ringbuffer of raised
- struct v4l2_subscribed_event has a ringbuffer of raised
(pending) events of that particular type.

- If struct :c:type:`v4l2_subscribed_event` is associated with a specific
- If struct v4l2_subscribed_event is associated with a specific
object, then that object will have an internal list of
struct :c:type:`v4l2_subscribed_event` so it knows who subscribed an
struct v4l2_subscribed_event so it knows who subscribed an
event to that object.

Furthermore, the internal struct :c:type:`v4l2_subscribed_event` has
Furthermore, the internal struct v4l2_subscribed_event has
``merge()`` and ``replace()`` callbacks which drivers can set. These
callbacks are called when a new event is raised and there is no more room.

Expand Down
Loading

0 comments on commit 9303c9d

Please sign in to comment.