Skip to content

Commit

Permalink
docs: enable warnings for missing return value description
Browse files Browse the repository at this point in the history
Make kerneldoc warn on missing description of return values.

Signed-off-by: Klaus Jensen <[email protected]>
  • Loading branch information
birkelund committed Feb 9, 2024
1 parent 5d0bcbe commit c826e7e
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/sphinx/kerneldoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class KernelDocDirective(Directive):

def run(self):
env = self.state.document.settings.env
cmd = [env.config.kerneldoc_bin, '-rst', '-enable-lineno']
cmd = [env.config.kerneldoc_bin, '-rst', '-Wreturn', '-enable-lineno']

# Pass the version string to kernel-doc, as it needs to use a different
# dialect, depending what the C domain supports for each specific
Expand Down
2 changes: 2 additions & 0 deletions include/vfn/nvme/ctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ struct nvme_ctrl {
* after a successful call to this.
*
* See &struct nvme_ctrl_opts for configurable options.
*
* Return: ``0`` on success, ``-1`` on error and sets ``errno``.
*/
int nvme_init(struct nvme_ctrl *ctrl, const char *bdf, const struct nvme_ctrl_opts *opts);

Expand Down
24 changes: 24 additions & 0 deletions include/vfn/support/endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ typedef uint16_t __bitwise beint16_t;
/**
* cpu_to_le64 - convert a uint64_t value to little-endian
* @native: value to convert
*
* Return: little endian integer
*/
static inline leint64_t cpu_to_le64(uint64_t native)
{
Expand All @@ -62,6 +64,8 @@ static inline leint64_t cpu_to_le64(uint64_t native)
/**
* cpu_to_le32 - convert a uint32_t value to little-endian
* @native: value to convert
*
* Return: little endian integer
*/
static inline leint32_t cpu_to_le32(uint32_t native)
{
Expand All @@ -71,6 +75,8 @@ static inline leint32_t cpu_to_le32(uint32_t native)
/**
* cpu_to_le16 - convert a uint16_t value to little-endian
* @native: value to convert
*
* Return: little endian integer
*/
static inline leint16_t cpu_to_le16(uint16_t native)
{
Expand All @@ -80,6 +86,8 @@ static inline leint16_t cpu_to_le16(uint16_t native)
/**
* le64_to_cpu - convert a little-endian uint64_t value
* @le_val: little-endian value to convert
*
* Return: host endian integer
*/
static inline uint64_t le64_to_cpu(leint64_t le_val)
{
Expand All @@ -89,6 +97,8 @@ static inline uint64_t le64_to_cpu(leint64_t le_val)
/**
* le32_to_cpu - convert a little-endian uint32_t value
* @le_val: little-endian value to convert
*
* Return: host endian integer
*/
static inline uint32_t le32_to_cpu(leint32_t le_val)
{
Expand All @@ -98,6 +108,8 @@ static inline uint32_t le32_to_cpu(leint32_t le_val)
/**
* le16_to_cpu - convert a little-endian uint16_t value
* @le_val: little-endian value to convert
*
* Return: host endian integer
*/
static inline uint16_t le16_to_cpu(leint16_t le_val)
{
Expand All @@ -107,6 +119,8 @@ static inline uint16_t le16_to_cpu(leint16_t le_val)
/**
* cpu_to_be64 - convert a uint64_t value to big endian.
* @native: value to convert
*
* Return: big endian integer
*/
static inline beint64_t cpu_to_be64(uint64_t native)
{
Expand All @@ -116,6 +130,8 @@ static inline beint64_t cpu_to_be64(uint64_t native)
/**
* cpu_to_be32 - convert a uint32_t value to big endian.
* @native: value to convert
*
* Return: big endian integer
*/
static inline beint32_t cpu_to_be32(uint32_t native)
{
Expand All @@ -125,6 +141,8 @@ static inline beint32_t cpu_to_be32(uint32_t native)
/**
* cpu_to_be16 - convert a uint16_t value to big endian.
* @native: value to convert
*
* Return: big endian integer
*/
static inline beint16_t cpu_to_be16(uint16_t native)
{
Expand All @@ -134,6 +152,8 @@ static inline beint16_t cpu_to_be16(uint16_t native)
/**
* be64_to_cpu - convert a big-endian uint64_t value
* @be_val: big-endian value to convert
*
* Return: host endian integer
*/
static inline uint64_t be64_to_cpu(beint64_t be_val)
{
Expand All @@ -143,6 +163,8 @@ static inline uint64_t be64_to_cpu(beint64_t be_val)
/**
* be32_to_cpu - convert a big-endian uint32_t value
* @be_val: big-endian value to convert
*
* Return: host endian integer
*/
static inline uint32_t be32_to_cpu(beint32_t be_val)
{
Expand All @@ -152,6 +174,8 @@ static inline uint32_t be32_to_cpu(beint32_t be_val)
/**
* be16_to_cpu - convert a big-endian uint16_t value
* @be_val: big-endian value to convert
*
* Return: host endian integer
*/
static inline uint16_t be16_to_cpu(beint16_t be_val)
{
Expand Down
2 changes: 2 additions & 0 deletions include/vfn/support/mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ static inline size_t __abort_on_overflow(unsigned int n, size_t sz)
* @sz: number of bytes to allocate
*
* Call malloc, but only return NULL when @sz is zero. Otherwise, abort.
*
* Return: pointer to allocated memory
*/
static inline void *xmalloc(size_t sz)
{
Expand Down
2 changes: 2 additions & 0 deletions include/vfn/vfio/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ int vfio_set_irq(struct vfio_device *dev, int *eventfds, int count);
* @dev: &struct vfio_device
*
* Disable all IRQs.
*
* Return: ``0`` on success, ``-1`` on error and sets ``errno``.
*/
int vfio_disable_irq(struct vfio_device *dev);

Expand Down

0 comments on commit c826e7e

Please sign in to comment.