linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Randy Dunlap <rdunlap@infradead.org>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	rd.dunlab@gmail.com
Cc: linux-rdma@vger.kernel.org, Doug Ledford <dledford@redhat.com>,
	linux-doc@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>
Subject: Re: [PATCH 05/12] infiniband: fix ulp/opa_vnic/opa_vnic_encap.h kernel-doc notation
Date: Wed, 23 Oct 2019 10:26:07 +0300	[thread overview]
Message-ID: <87d0engbxs.fsf@intel.com> (raw)
In-Reply-To: <e6be1ddd-c32f-4f8a-4528-7393d5997755@infradead.org>

On Tue, 22 Oct 2019, Randy Dunlap <rdunlap@infradead.org> wrote:
> On 10/22/19 10:52 AM, Jason Gunthorpe wrote:
>> On Wed, Oct 09, 2019 at 08:52:44PM -0700, rd.dunlab@gmail.com wrote:
>>> Make reserved struct fields "private:" so that they don't need to
>>> be added to the kernel-doc notation. This removes 24 warnings.
>> 
>>> +++ linux-next-20191009/drivers/infiniband/ulp/opa_vnic/opa_vnic_encap.h
>>> @@ -129,21 +129,31 @@ struct opa_vesw_info {
>>>  	__be16  fabric_id;
>>>  	__be16  vesw_id;
>>>  
>>> +	/* private: */
>>>  	u8      rsvd0[6];
>>> +	/* public: */
>>>  	__be16  def_port_mask;
>> 
>> This seems overly ugly, is there some other way to handle these
>> reserved fields? Maybe wire protocol structures shouldn't be kdoc?
>
> I don't know of any other way to handle them with kernel-doc.
> Sure, changing the /** to just /* would be one way to hide the
> warnings.  Either this patch or not having them be kernel-doc
> is needed just to "fix" 24 warnings.

The currently available options are:

- The patch at hand (private/public comments). Ugly and verbose.

- Document the structs using regular comments instead of
  kernel-doc. Might be suitable here, but not a generally useful
  approach. Loses all format checking and generated documentation.

- Also document the reserved fields. Ugly and verbose, also in the
  generated documentation.

Some options that I think might be relatively easy to implement:

- Add struct documentation comment indicator to not complain about
  missing member documentation. Some special tag in the struct
  comment. This would also ignore members that actually need to be
  documented.

- Add support for designating private members in the member
  documentation, i.e. require the documentation, but omit the members
  from the generated document. Something like this, with PRIVATE
  replaced with your favorite bikeshed colors:

  /**
   * @rsvd0: PRIVATE
   */

  This could be used either in the struct documentation comment or in
  the inline member documentation comment. Less ugly than the patch at
  hand, and arguably a better notation, but still requires documenting
  the members.

- Add support for a catch-all member documentation comment, for example:

  /**
   * struct foo - bar
   * @*: This member is private.
   */

  Would generate the documentation for the member with the catch-all
  documentation, which might be a generally useful feature, and would be
  easy on the source code side. This could be combined with the PRIVATE
  designation above, practically leading to the same result as the first
  option but with more flexibility.


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2019-10-23  7:26 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10  3:52 [PATCH 00/12] infiniband kernel-doc fixes & driver-api/ chapter rd.dunlab
2019-10-10  3:52 ` [PATCH 01/12] infiniband: fix ulp/iser/iscsi_iser.[hc] kernel-doc notation rd.dunlab
2019-10-10  3:52 ` [PATCH 02/12] infiniband: fix core/ipwm_util.h kernel-doc warnings rd.dunlab
2019-10-10  3:52 ` [PATCH 03/12] infiniband: fix ulp/iser/iscsi_iser.h " rd.dunlab
2019-10-10  3:52 ` [PATCH 04/12] infiniband: fix ulp/opa_vnic/opa_vnic_internal.h kernel-doc notation rd.dunlab
2019-10-10  3:52 ` [PATCH 05/12] infiniband: fix ulp/opa_vnic/opa_vnic_encap.h " rd.dunlab
2019-10-22 17:52   ` Jason Gunthorpe
2019-10-22 19:51     ` Randy Dunlap
2019-10-23  7:26       ` Jani Nikula [this message]
2019-10-23 12:03       ` Dennis Dalessandro
2019-10-10  3:52 ` [PATCH 06/12] infiniband: fix ulp/srpt/ib_srpt.h " rd.dunlab
2019-10-23 20:30   ` Bart Van Assche
2019-10-23 20:39     ` Randy Dunlap
2019-10-10  3:52 ` [PATCH 07/12] infiniband: fix core/verbs.c " rd.dunlab
2019-10-10  3:52 ` [PATCH 08/12] infiniband: fix ulp/iser/iser_verbs.c " rd.dunlab
2019-10-10  3:52 ` [PATCH 09/12] infiniband: fix ulp/iser/iser_initiator.c kernel-doc warnings rd.dunlab
2019-10-10  3:52 ` [PATCH 10/12] infiniband: fix core/ kernel-doc notation rd.dunlab
2019-10-10  3:52 ` [PATCH 11/12] infiniband: fix sw/rdmavt/ " rd.dunlab
2019-10-10  3:52 ` [PATCH 12/12] infiniband: add a Documentation driver-api chapter for Infiniband rd.dunlab
2019-10-10 15:45   ` kbuild test robot
2019-10-21 17:07     ` Jason Gunthorpe
2019-10-21 21:57       ` Randy Dunlap
2019-10-22 18:41 ` [PATCH 00/12] infiniband kernel-doc fixes & driver-api/ chapter Jason Gunthorpe
2019-10-22 22:51   ` Max Gurtovoy
2019-10-23 11:54   ` Dennis Dalessandro
2019-10-23 14:39     ` Jason Gunthorpe

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=87d0engbxs.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=corbet@lwn.net \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=rd.dunlab@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).