mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Takashi Sakamoto <o-takashi@sakamocchi.jp>,
	linux1394-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH] firewire: fix warnings to generate UAPI documentation
Date: Thu, 1 Jun 2023 13:23:27 -0700	[thread overview]
Message-ID: <c9770ddc-d1fe-d49f-adec-a413a7bf65ec@infradead.org> (raw)
In-Reply-To: <20230601144937.121179-1-o-takashi@sakamocchi.jp>

Hi,

On 6/1/23 07:49, Takashi Sakamoto wrote:
> Any target to generate UAPI documentation reports warnings to missing
> annotation for padding member in structures added recently.
> 
> This commit suppresses the warnings.
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Closes: https://lore.kernel.org/lkml/20230531135306.43613a59@canb.auug.org.au/
> Fixes: 7c22d4a92bb2 ("firewire: cdev: add new event to notify request subaction with time stamp")
> Fixes: fc2b52cf2e0e ("firewire: cdev: add new event to notify response subaction with time stamp")
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
> ---
>  include/uapi/linux/firewire-cdev.h | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 

You can do it as this patch shows, or you can hide those padding fields as
described in Documentation/doc-guide/kernel-doc.rst:

Inside a struct or union description, you can use the ``private:`` and
``public:`` comment tags. Structure fields that are inside a ``private:``
area are not listed in the generated output documentation.

The ``private:`` and ``public:`` tags must begin immediately following a
``/*`` comment marker. They may optionally include comments between the
``:`` and the ending ``*/`` marker.

See below.

> diff --git a/include/uapi/linux/firewire-cdev.h b/include/uapi/linux/firewire-cdev.h
> index 99e823935427..1f2c9469f921 100644
> --- a/include/uapi/linux/firewire-cdev.h
> +++ b/include/uapi/linux/firewire-cdev.h
> @@ -130,6 +130,9 @@ struct fw_cdev_event_response {
>   * @length:	Data length, i.e. the response's payload size in bytes
>   * @request_tstamp:	The time stamp of isochronous cycle at which the request was sent.
>   * @response_tstamp:	The time stamp of isochronous cycle at which the response was sent.
> + * @padding:	Padding to keep the size of structure as multiples of 8 in various architectures
> + *		since 4 byte alignment is used for 8 byte of object type in System V ABI for i386
> + *		architecture.

You could drop that change.

>   * @data:	Payload data, if any
>   *
>   * This event is sent when the stack receives a response to an outgoing request
> @@ -155,10 +158,6 @@ struct fw_cdev_event_response2 {
>  	__u32 length;
>  	__u32 request_tstamp;
>  	__u32 response_tstamp;

	/* private: */
> -	/*
> -	 * Padding to keep the size of structure as multiples of 8 in various architectures since
> -	 * 4 byte alignment is used for 8 byte of object type in System V ABI for i386 architecture.
> -	 */
>  	__u32 padding;

	/* public: */

>  	__u32 data[];
>  };
> @@ -231,6 +230,9 @@ struct fw_cdev_event_request2 {
>   * @handle:	Reference to the kernel-side pending request
>   * @length:	Data length, i.e. the request's payload size in bytes
>   * @tstamp:	The time stamp of isochronous cycle at which the request arrived.
> + * @padding:	Padding to keep the size of structure as multiples of 8 in various architectures
> + *		since 4 byte alignment is used for 8 byte of object type in System V ABI for i386
> + *		architecture.

drop that.

>   * @data:	Incoming data, if any
>   *
>   * This event is sent when the stack receives an incoming request to an address
> @@ -284,10 +286,6 @@ struct fw_cdev_event_request3 {
>  	__u32 handle;
>  	__u32 length;
>  	__u32 tstamp;

	/* private: */

> -	/*
> -	 * Padding to keep the size of structure as multiples of 8 in various architectures since
> -	 * 4 byte alignment is used for 8 byte of object type in System V ABI for i386 architecture.
> -	 */
>  	__u32 padding;

	/* public: */

>  	__u32 data[];
>  };

-- 
~Randy

  reply	other threads:[~2023-06-01 20:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01 14:49 Takashi Sakamoto
2023-06-01 20:23 ` Randy Dunlap [this message]
2023-06-03  4:25   ` Takashi Sakamoto
2023-06-05 22:55 ` Takashi Sakamoto

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=c9770ddc-d1fe-d49f-adec-a413a7bf65ec@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=o-takashi@sakamocchi.jp \
    --cc=sfr@canb.auug.org.au \
    /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

all inboxes | Powered by JetHome®