linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* scripts/kernel-doc update
@ 2020-06-30  9:36 Lee Jones
  0 siblings, 0 replies; only message in thread
From: Lee Jones @ 2020-06-30  9:36 UTC (permalink / raw)
  To: corbet; +Cc: linux-doc, linux-kernel

Good morning Jon, et al.,

Would someone be kind enough to update scripts/kernel-doc to elegantly
handle complex bitmap expressions in structures please?  Presently
only simple syntax is handled.  Something like:

struct foo {
       u8 arg : 10;
};

However, the bitmap is sometimes derived from some pre-processed
define or calculated.  Similar to the following examples.

Example 1:
---------

  File: drivers/misc/vmw_balloon.c

  struct vmballoon_batch_entry {
          u64 status : 5;
          u64 reserved : PAGE_SHIFT - 5;
          u64 pfn : 52;
  } __packed;

Example 2:
---------

  File: include/math-emu/single.h
  
  union _FP_UNION_S
  {
    float flt;
    struct {
  #if __BYTE_ORDER == __BIG_ENDIAN
      unsigned sign : 1;
      unsigned exp  : _FP_EXPBITS_S;
      unsigned frac : _FP_FRACBITS_S - (_FP_IMPLBIT_S != 0);
  #else
      unsigned frac : _FP_FRACBITS_S - (_FP_IMPLBIT_S != 0);
      unsigned exp  : _FP_EXPBITS_S;
      unsigned sign : 1;
  #endif
    } bits __attribute__((packed));
  };

The first example causes this warning:

 drivers/misc/vmw_balloon.c:262: warning: Function parameter or member '5' not described in 'vmballoon_batch_entry'

The second doesn't use kerneldoc, but is an example of a complex, but
totally possible/legitimate use-case.

Would it be feasible to make to make the regex which handles bitmaps
greedy up until the ';'?  Or perhaps someone can come up with
something more refined that would solve the problem.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-30  9:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-30  9:36 scripts/kernel-doc update Lee Jones

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).