diff mbox series

drm/connector: hdmi: Fix kerneldoc warnings

Message ID 20240610111200.428224-1-mripard@kernel.org (mailing list archive)
State New, archived
Headers show
Series drm/connector: hdmi: Fix kerneldoc warnings | expand

Commit Message

Maxime Ripard June 10, 2024, 11:12 a.m. UTC
It looks like the documentation for the HDMI-related fields recently
added to both the drm_connector and drm_connector_state structures
trigger some warnings because of their use of anonymous structures:

  $ scripts/kernel-doc -none include/drm/drm_connector.h
  include/drm/drm_connector.h:1138: warning: Excess struct member 'broadcast_rgb' description in 'drm_connector_state'
  include/drm/drm_connector.h:1138: warning: Excess struct member 'infoframes' description in 'drm_connector_state'
  include/drm/drm_connector.h:1138: warning: Excess struct member 'avi' description in 'drm_connector_state'
  include/drm/drm_connector.h:1138: warning: Excess struct member 'hdr_drm' description in 'drm_connector_state'
  include/drm/drm_connector.h:1138: warning: Excess struct member 'spd' description in 'drm_connector_state'
  include/drm/drm_connector.h:1138: warning: Excess struct member 'vendor' description in 'drm_connector_state'
  include/drm/drm_connector.h:1138: warning: Excess struct member 'is_limited_range' description in 'drm_connector_state'
  include/drm/drm_connector.h:1138: warning: Excess struct member 'output_bpc' description in 'drm_connector_state'
  include/drm/drm_connector.h:1138: warning: Excess struct member 'output_format' description in 'drm_connector_state'
  include/drm/drm_connector.h:1138: warning: Excess struct member 'tmds_char_rate' description in 'drm_connector_state'
  include/drm/drm_connector.h:2112: warning: Excess struct member 'vendor' description in 'drm_connector'
  include/drm/drm_connector.h:2112: warning: Excess struct member 'product' description in 'drm_connector'
  include/drm/drm_connector.h:2112: warning: Excess struct member 'supported_formats' description in 'drm_connector'
  include/drm/drm_connector.h:2112: warning: Excess struct member 'infoframes' description in 'drm_connector'
  include/drm/drm_connector.h:2112: warning: Excess struct member 'lock' description in 'drm_connector'
  include/drm/drm_connector.h:2112: warning: Excess struct member 'audio' description in 'drm_connector'

Create some intermediate structures instead of anonymous ones to silence
the warnings.

Reported-by: Jani Nikula <jani.nikula@linux.intel.com>
Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
Fixes: 54cb39e2293b ("drm/connector: hdmi: Create an HDMI sub-state")
Fixes: 948f01d5e559 ("drm/connector: hdmi: Add support for output format")
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 include/drm/drm_connector.h | 207 +++++++++++++++++++-----------------
 1 file changed, 109 insertions(+), 98 deletions(-)

Comments

Maxime Ripard June 10, 2024, 11:16 a.m. UTC | #1
Hi,

On Mon, Jun 10, 2024 at 01:12:00PM GMT, Maxime Ripard wrote:
> It looks like the documentation for the HDMI-related fields recently
> added to both the drm_connector and drm_connector_state structures
> trigger some warnings because of their use of anonymous structures:
> 
>   $ scripts/kernel-doc -none include/drm/drm_connector.h
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'broadcast_rgb' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'infoframes' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'avi' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'hdr_drm' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'spd' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'vendor' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'is_limited_range' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'output_bpc' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'output_format' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'tmds_char_rate' description in 'drm_connector_state'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'vendor' description in 'drm_connector'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'product' description in 'drm_connector'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'supported_formats' description in 'drm_connector'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'infoframes' description in 'drm_connector'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'lock' description in 'drm_connector'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'audio' description in 'drm_connector'
> 
> Create some intermediate structures instead of anonymous ones to silence
> the warnings.
> 
> Reported-by: Jani Nikula <jani.nikula@linux.intel.com>
> Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
> Fixes: 54cb39e2293b ("drm/connector: hdmi: Create an HDMI sub-state")
> Fixes: 948f01d5e559 ("drm/connector: hdmi: Add support for output format")
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
>  include/drm/drm_connector.h | 207 +++++++++++++++++++-----------------
>  1 file changed, 109 insertions(+), 98 deletions(-)
> 
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index e04a8a0d1bbd..1afee2939b71 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -927,10 +927,72 @@ struct drm_connector_hdmi_infoframe {
>  	 * @set: Is the content of @data valid?
>  	 */
>  	bool set;
>  };
>  
> +/*
> + * struct drm_connector_hdmi_state - HDMI state container
> + */
> +struct drm_connector_hdmi_state {
> +	/**
> +	 * @broadcast_rgb: Connector property to pass the
> +	 * Broadcast RGB selection value.
> +	 */
> +	enum drm_hdmi_broadcast_rgb broadcast_rgb;
> +
> +	/**
> +	 * @infoframes: HDMI Infoframes matching that state
> +	 */
> +	struct {
> +		/**
> +		 * @avi: AVI Infoframes structure matching our
> +		 * state.
> +		 */
> +		struct drm_connector_hdmi_infoframe avi;
> +
> +		/**
> +		 * @hdr_drm: DRM (Dynamic Range and Mastering)
> +		 * Infoframes structure matching our state.
> +		 */
> +		struct drm_connector_hdmi_infoframe hdr_drm;
> +
> +		/**
> +		 * @spd: SPD Infoframes structure matching our
> +		 * state.
> +		 */
> +		struct drm_connector_hdmi_infoframe spd;
> +
> +		/**
> +		 * @vendor: HDMI Vendor Infoframes structure
> +		 * matching our state.
> +		 */
> +		struct drm_connector_hdmi_infoframe hdmi;
> +	} infoframes;
> +
> +	/**
> +	 * @is_limited_range: Is the output supposed to use a limited
> +	 * RGB Quantization Range or not?
> +	 */
> +	bool is_limited_range;
> +
> +	/**
> +	 * @output_bpc: Bits per color channel to output.
> +	 */
> +	unsigned int output_bpc;
> +
> +	/**
> +	 * @output_format: Pixel format to output in.
> +	 */
> +	enum hdmi_colorspace output_format;
> +
> +	/**
> +	 * @tmds_char_rate: TMDS Character Rate, in Hz.
> +	 */
> +	unsigned long long tmds_char_rate;
> +
> +}

FTR, there's a missing ; here

Maxime
kernel test robot June 10, 2024, 3:28 p.m. UTC | #2
Hi Maxime,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-misc/drm-misc-next]
[also build test ERROR on drm-tip/drm-tip]
[cannot apply to linus/master v6.10-rc3 next-20240607]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Maxime-Ripard/drm-connector-hdmi-Fix-kerneldoc-warnings/20240610-191427
base:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link:    https://lore.kernel.org/r/20240610111200.428224-1-mripard%40kernel.org
patch subject: [PATCH] drm/connector: hdmi: Fix kerneldoc warnings
config: riscv-defconfig (https://download.01.org/0day-ci/archive/20240610/202406102334.csOl5G2p-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 4403cdbaf01379de96f8d0d6ea4f51a085e37766)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240610/202406102334.csOl5G2p-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406102334.csOl5G2p-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/gpu/drm/radeon/radeon_drv.c:36:
   In file included from include/linux/vga_switcheroo.h:34:
   In file included from include/linux/fb.h:5:
   In file included from include/uapi/linux/fb.h:6:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:21:
   In file included from arch/riscv/include/asm/sections.h:9:
   In file included from include/linux/mm.h:2253:
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   In file included from drivers/gpu/drm/radeon/radeon_drv.c:46:
   In file included from include/drm/drm_probe_helper.h:6:
   In file included from include/drm/drm_modes.h:33:
>> include/drm/drm_connector.h:992:2: error: expected ';' after struct
     992 | }
         |  ^
         |  ;
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
     251 |         radeon_PCI_IDS
         |         ^~~~~~~~~~~~~~
   include/drm/drm_pciids.h:3:60: note: expanded from macro 'radeon_PCI_IDS'
       3 |         {0x1002, 0x1304, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
         |                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
     251 |         radeon_PCI_IDS
         |         ^~~~~~~~~~~~~~
   include/drm/drm_pciids.h:4:60: note: expanded from macro 'radeon_PCI_IDS'
       4 |         {0x1002, 0x1305, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
         |                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
     251 |         radeon_PCI_IDS
         |         ^~~~~~~~~~~~~~
   include/drm/drm_pciids.h:5:60: note: expanded from macro 'radeon_PCI_IDS'
       5 |         {0x1002, 0x1306, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
         |                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
     251 |         radeon_PCI_IDS
         |         ^~~~~~~~~~~~~~
   include/drm/drm_pciids.h:6:60: note: expanded from macro 'radeon_PCI_IDS'
       6 |         {0x1002, 0x1307, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
         |                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
     251 |         radeon_PCI_IDS
         |         ^~~~~~~~~~~~~~
   include/drm/drm_pciids.h:7:60: note: expanded from macro 'radeon_PCI_IDS'
       7 |         {0x1002, 0x1309, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
         |                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
     251 |         radeon_PCI_IDS
         |         ^~~~~~~~~~~~~~
   include/drm/drm_pciids.h:8:60: note: expanded from macro 'radeon_PCI_IDS'
       8 |         {0x1002, 0x130A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
         |                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
     251 |         radeon_PCI_IDS
         |         ^~~~~~~~~~~~~~
   include/drm/drm_pciids.h:9:60: note: expanded from macro 'radeon_PCI_IDS'
       9 |         {0x1002, 0x130B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
         |                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
     251 |         radeon_PCI_IDS
         |         ^~~~~~~~~~~~~~
   include/drm/drm_pciids.h:10:60: note: expanded from macro 'radeon_PCI_IDS'
      10 |         {0x1002, 0x130C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
         |                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
     251 |         radeon_PCI_IDS
         |         ^~~~~~~~~~~~~~
   include/drm/drm_pciids.h:11:60: note: expanded from macro 'radeon_PCI_IDS'
      11 |         {0x1002, 0x130D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
         |                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
     251 |         radeon_PCI_IDS
         |         ^~~~~~~~~~~~~~
   include/drm/drm_pciids.h:12:60: note: expanded from macro 'radeon_PCI_IDS'
      12 |         {0x1002, 0x130E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
         |                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
     251 |         radeon_PCI_IDS
         |         ^~~~~~~~~~~~~~
   include/drm/drm_pciids.h:13:60: note: expanded from macro 'radeon_PCI_IDS'
      13 |         {0x1002, 0x130F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
         |                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
     251 |         radeon_PCI_IDS
         |         ^~~~~~~~~~~~~~
   include/drm/drm_pciids.h:14:60: note: expanded from macro 'radeon_PCI_IDS'
      14 |         {0x1002, 0x1310, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
         |                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
     251 |         radeon_PCI_IDS
         |         ^~~~~~~~~~~~~~
   include/drm/drm_pciids.h:15:60: note: expanded from macro 'radeon_PCI_IDS'
      15 |         {0x1002, 0x1311, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
         |                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
     251 |         radeon_PCI_IDS
         |         ^~~~~~~~~~~~~~
   include/drm/drm_pciids.h:16:60: note: expanded from macro 'radeon_PCI_IDS'
      16 |         {0x1002, 0x1312, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
         |                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
     251 |         radeon_PCI_IDS
         |         ^~~~~~~~~~~~~~
   include/drm/drm_pciids.h:17:60: note: expanded from macro 'radeon_PCI_IDS'
      17 |         {0x1002, 0x1313, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
         |                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
     251 |         radeon_PCI_IDS
         |         ^~~~~~~~~~~~~~
   include/drm/drm_pciids.h:18:60: note: expanded from macro 'radeon_PCI_IDS'
      18 |         {0x1002, 0x1315, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
         |                                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/radeon/radeon_drv.c:251:2: warning: bitwise operation between different enumeration types ('enum radeon_family' and 'enum radeon_chip_flags') [-Wenum-enum-conversion]
--
   In file included from drivers/gpu/drm/radeon/radeon_device.c:30:
   In file included from include/linux/efi.h:20:
   In file included from include/linux/rtc.h:17:
   In file included from include/linux/interrupt.h:21:
   In file included from arch/riscv/include/asm/sections.h:9:
   In file included from include/linux/mm.h:2253:
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   In file included from drivers/gpu/drm/radeon/radeon_device.c:42:
   In file included from include/drm/drm_probe_helper.h:6:
   In file included from include/drm/drm_modes.h:33:
>> include/drm/drm_connector.h:992:2: error: expected ';' after struct
     992 | }
         |  ^
         |  ;
   In file included from drivers/gpu/drm/radeon/radeon_device.c:48:
   In file included from drivers/gpu/drm/radeon/atom.h:165:
   In file included from drivers/gpu/drm/radeon/atombios.h:7980:
   drivers/gpu/drm/radeon/pptable.h:442:5: warning: 'counted_by' should not be applied to an array with element of unknown size because 'ATOM_PPLIB_STATE_V2' (aka 'struct _ATOM_PPLIB_STATE_V2') is a struct type with a flexible array member. This will be an error in a future compiler version [-Wbounds-safety-counted-by-elt-type-unknown-size]
     442 |     ATOM_PPLIB_STATE_V2 states[] __counted_by(ucNumEntries);
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   2 warnings and 1 error generated.
--
   In file included from drivers/gpu/drm/radeon/radeon_asic.c:30:
   In file included from include/linux/pci.h:38:
   In file included from include/linux/interrupt.h:21:
   In file included from arch/riscv/include/asm/sections.h:9:
   In file included from include/linux/mm.h:2253:
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   In file included from drivers/gpu/drm/radeon/radeon_asic.c:35:
   In file included from drivers/gpu/drm/radeon/atom.h:165:
   In file included from drivers/gpu/drm/radeon/atombios.h:7980:
   drivers/gpu/drm/radeon/pptable.h:442:5: warning: 'counted_by' should not be applied to an array with element of unknown size because 'ATOM_PPLIB_STATE_V2' (aka 'struct _ATOM_PPLIB_STATE_V2') is a struct type with a flexible array member. This will be an error in a future compiler version [-Wbounds-safety-counted-by-elt-type-unknown-size]
     442 |     ATOM_PPLIB_STATE_V2 states[] __counted_by(ucNumEntries);
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/gpu/drm/radeon/radeon_asic.c:36:
   In file included from drivers/gpu/drm/radeon/radeon.h:85:
   In file included from drivers/gpu/drm/radeon/radeon_mode.h:33:
   In file included from include/drm/display/drm_dp_helper.h:30:
>> include/drm/drm_connector.h:992:2: error: expected ';' after struct
     992 | }
         |  ^
         |  ;
   2 warnings and 1 error generated.
--
   In file included from drivers/gpu/drm/radeon/radeon_kms.c:29:
   In file included from include/linux/pci.h:38:
   In file included from include/linux/interrupt.h:21:
   In file included from arch/riscv/include/asm/sections.h:9:
   In file included from include/linux/mm.h:2253:
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   In file included from drivers/gpu/drm/radeon/radeon_kms.c:39:
   In file included from drivers/gpu/drm/radeon/radeon.h:85:
   In file included from drivers/gpu/drm/radeon/radeon_mode.h:33:
   In file included from include/drm/display/drm_dp_helper.h:30:
>> include/drm/drm_connector.h:992:2: error: expected ';' after struct
     992 | }
         |  ^
         |  ;
   1 warning and 1 error generated.


vim +992 include/drm/drm_connector.h

   931	
   932	/*
   933	 * struct drm_connector_hdmi_state - HDMI state container
   934	 */
   935	struct drm_connector_hdmi_state {
   936		/**
   937		 * @broadcast_rgb: Connector property to pass the
   938		 * Broadcast RGB selection value.
   939		 */
   940		enum drm_hdmi_broadcast_rgb broadcast_rgb;
   941	
   942		/**
   943		 * @infoframes: HDMI Infoframes matching that state
   944		 */
   945		struct {
   946			/**
   947			 * @avi: AVI Infoframes structure matching our
   948			 * state.
   949			 */
   950			struct drm_connector_hdmi_infoframe avi;
   951	
   952			/**
   953			 * @hdr_drm: DRM (Dynamic Range and Mastering)
   954			 * Infoframes structure matching our state.
   955			 */
   956			struct drm_connector_hdmi_infoframe hdr_drm;
   957	
   958			/**
   959			 * @spd: SPD Infoframes structure matching our
   960			 * state.
   961			 */
   962			struct drm_connector_hdmi_infoframe spd;
   963	
   964			/**
   965			 * @vendor: HDMI Vendor Infoframes structure
   966			 * matching our state.
   967			 */
   968			struct drm_connector_hdmi_infoframe hdmi;
   969		} infoframes;
   970	
   971		/**
   972		 * @is_limited_range: Is the output supposed to use a limited
   973		 * RGB Quantization Range or not?
   974		 */
   975		bool is_limited_range;
   976	
   977		/**
   978		 * @output_bpc: Bits per color channel to output.
   979		 */
   980		unsigned int output_bpc;
   981	
   982		/**
   983		 * @output_format: Pixel format to output in.
   984		 */
   985		enum hdmi_colorspace output_format;
   986	
   987		/**
   988		 * @tmds_char_rate: TMDS Character Rate, in Hz.
   989		 */
   990		unsigned long long tmds_char_rate;
   991	
 > 992	}
   993
kernel test robot June 10, 2024, 4:15 p.m. UTC | #3
Hi Maxime,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-misc/drm-misc-next]
[also build test ERROR on drm-tip/drm-tip]
[cannot apply to linus/master v6.10-rc3 next-20240607]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Maxime-Ripard/drm-connector-hdmi-Fix-kerneldoc-warnings/20240610-191427
base:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link:    https://lore.kernel.org/r/20240610111200.428224-1-mripard%40kernel.org
patch subject: [PATCH] drm/connector: hdmi: Fix kerneldoc warnings
config: parisc-defconfig (https://download.01.org/0day-ci/archive/20240610/202406102348.TVIh790U-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240610/202406102348.TVIh790U-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406102348.TVIh790U-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from include/drm/drm_modes.h:33,
                    from include/drm/drm_crtc.h:32,
                    from include/drm/drm_atomic.h:31,
                    from drivers/gpu/drm/drm_atomic.c:32:
>> include/drm/drm_connector.h:997:1: error: expected ';', identifier or '(' before 'struct'
     997 | struct drm_connector_state {
         | ^~~~~~


vim +997 include/drm/drm_connector.h

5b530587b3eb3e Maxime Ripard        2024-06-10   993  
52217195176115 Daniel Vetter        2016-08-12   994  /**
52217195176115 Daniel Vetter        2016-08-12   995   * struct drm_connector_state - mutable connector state
52217195176115 Daniel Vetter        2016-08-12   996   */
52217195176115 Daniel Vetter        2016-08-12  @997  struct drm_connector_state {
aab999a66e4bc4 Daniel Vetter        2018-07-09   998  	/** @connector: backpointer to the connector */
52217195176115 Daniel Vetter        2016-08-12   999  	struct drm_connector *connector;
52217195176115 Daniel Vetter        2016-08-12  1000  
afb21ea63d815d Daniel Vetter        2016-08-31  1001  	/**
afb21ea63d815d Daniel Vetter        2016-08-31  1002  	 * @crtc: CRTC to connect connector to, NULL if disabled.
afb21ea63d815d Daniel Vetter        2016-08-31  1003  	 *
afb21ea63d815d Daniel Vetter        2016-08-31  1004  	 * Do not change this directly, use drm_atomic_set_crtc_for_connector()
afb21ea63d815d Daniel Vetter        2016-08-31  1005  	 * instead.
afb21ea63d815d Daniel Vetter        2016-08-31  1006  	 */
afb21ea63d815d Daniel Vetter        2016-08-31  1007  	struct drm_crtc *crtc;
52217195176115 Daniel Vetter        2016-08-12  1008  
aab999a66e4bc4 Daniel Vetter        2018-07-09  1009  	/**
aab999a66e4bc4 Daniel Vetter        2018-07-09  1010  	 * @best_encoder:
aab999a66e4bc4 Daniel Vetter        2018-07-09  1011  	 *
aab999a66e4bc4 Daniel Vetter        2018-07-09  1012  	 * Used by the atomic helpers to select the encoder, through the
aab999a66e4bc4 Daniel Vetter        2018-07-09  1013  	 * &drm_connector_helper_funcs.atomic_best_encoder or
aab999a66e4bc4 Daniel Vetter        2018-07-09  1014  	 * &drm_connector_helper_funcs.best_encoder callbacks.
27edadf6df811b Daniel Vetter        2019-05-06  1015  	 *
1b27fbdde1df17 Laurent Pinchart     2019-06-11  1016  	 * This is also used in the atomic helpers to map encoders to their
1b27fbdde1df17 Laurent Pinchart     2019-06-11  1017  	 * current and previous connectors, see
12db36bc3cec76 Sean Paul            2019-08-12  1018  	 * drm_atomic_get_old_connector_for_encoder() and
12db36bc3cec76 Sean Paul            2019-08-12  1019  	 * drm_atomic_get_new_connector_for_encoder().
1b27fbdde1df17 Laurent Pinchart     2019-06-11  1020  	 *
27edadf6df811b Daniel Vetter        2019-05-06  1021  	 * NOTE: Atomic drivers must fill this out (either themselves or through
27edadf6df811b Daniel Vetter        2019-05-06  1022  	 * helpers), for otherwise the GETCONNECTOR and GETENCODER IOCTLs will
27edadf6df811b Daniel Vetter        2019-05-06  1023  	 * not return correct data to userspace.
aab999a66e4bc4 Daniel Vetter        2018-07-09  1024  	 */
52217195176115 Daniel Vetter        2016-08-12  1025  	struct drm_encoder *best_encoder;
52217195176115 Daniel Vetter        2016-08-12  1026  
40ee6fbef75fe6 Manasi Navare        2016-12-16  1027  	/**
40ee6fbef75fe6 Manasi Navare        2016-12-16  1028  	 * @link_status: Connector link_status to keep track of whether link is
40ee6fbef75fe6 Manasi Navare        2016-12-16  1029  	 * GOOD or BAD to notify userspace if retraining is necessary.
40ee6fbef75fe6 Manasi Navare        2016-12-16  1030  	 */
40ee6fbef75fe6 Manasi Navare        2016-12-16  1031  	enum drm_link_status link_status;
40ee6fbef75fe6 Manasi Navare        2016-12-16  1032  
aab999a66e4bc4 Daniel Vetter        2018-07-09  1033  	/** @state: backpointer to global drm_atomic_state */
52217195176115 Daniel Vetter        2016-08-12  1034  	struct drm_atomic_state *state;
299a16b163c95f Boris Brezillon      2016-12-02  1035  
21a01abbe32a3c Maarten Lankhorst    2017-09-04  1036  	/**
21a01abbe32a3c Maarten Lankhorst    2017-09-04  1037  	 * @commit: Tracks the pending commit to prevent use-after-free conditions.
21a01abbe32a3c Maarten Lankhorst    2017-09-04  1038  	 *
21a01abbe32a3c Maarten Lankhorst    2017-09-04  1039  	 * Is only set when @crtc is NULL.
21a01abbe32a3c Maarten Lankhorst    2017-09-04  1040  	 */
21a01abbe32a3c Maarten Lankhorst    2017-09-04  1041  	struct drm_crtc_commit *commit;
21a01abbe32a3c Maarten Lankhorst    2017-09-04  1042  
aab999a66e4bc4 Daniel Vetter        2018-07-09  1043  	/** @tv: TV connector state */
299a16b163c95f Boris Brezillon      2016-12-02  1044  	struct drm_tv_connector_state tv;
0e9f25d0e15fd9 Maarten Lankhorst    2017-05-01  1045  
1452c25b0e6027 Sean Paul            2019-06-12  1046  	/**
1452c25b0e6027 Sean Paul            2019-06-12  1047  	 * @self_refresh_aware:
1452c25b0e6027 Sean Paul            2019-06-12  1048  	 *
1452c25b0e6027 Sean Paul            2019-06-12  1049  	 * This tracks whether a connector is aware of the self refresh state.
1452c25b0e6027 Sean Paul            2019-06-12  1050  	 * It should be set to true for those connector implementations which
1452c25b0e6027 Sean Paul            2019-06-12  1051  	 * understand the self refresh state. This is needed since the crtc
1452c25b0e6027 Sean Paul            2019-06-12  1052  	 * registers the self refresh helpers and it doesn't know if the
1452c25b0e6027 Sean Paul            2019-06-12  1053  	 * connectors downstream have implemented self refresh entry/exit.
1452c25b0e6027 Sean Paul            2019-06-12  1054  	 *
1452c25b0e6027 Sean Paul            2019-06-12  1055  	 * Drivers should set this to true in atomic_check if they know how to
1452c25b0e6027 Sean Paul            2019-06-12  1056  	 * handle self_refresh requests.
1452c25b0e6027 Sean Paul            2019-06-12  1057  	 */
1452c25b0e6027 Sean Paul            2019-06-12  1058  	bool self_refresh_aware;
1452c25b0e6027 Sean Paul            2019-06-12  1059  
0e9f25d0e15fd9 Maarten Lankhorst    2017-05-01  1060  	/**
0e9f25d0e15fd9 Maarten Lankhorst    2017-05-01  1061  	 * @picture_aspect_ratio: Connector property to control the
0e9f25d0e15fd9 Maarten Lankhorst    2017-05-01  1062  	 * HDMI infoframe aspect ratio setting.
0e9f25d0e15fd9 Maarten Lankhorst    2017-05-01  1063  	 *
8f6e1e22e7d0d4 Maarten Lankhorst    2017-05-01  1064  	 * The %DRM_MODE_PICTURE_ASPECT_\* values much match the
0e9f25d0e15fd9 Maarten Lankhorst    2017-05-01  1065  	 * values for &enum hdmi_picture_aspect
0e9f25d0e15fd9 Maarten Lankhorst    2017-05-01  1066  	 */
0e9f25d0e15fd9 Maarten Lankhorst    2017-05-01  1067  	enum hdmi_picture_aspect picture_aspect_ratio;
8f6e1e22e7d0d4 Maarten Lankhorst    2017-05-01  1068  
50525c332b55f8 Stanislav Lisovskiy  2018-05-15  1069  	/**
50525c332b55f8 Stanislav Lisovskiy  2018-05-15  1070  	 * @content_type: Connector property to control the
50525c332b55f8 Stanislav Lisovskiy  2018-05-15  1071  	 * HDMI infoframe content type setting.
50525c332b55f8 Stanislav Lisovskiy  2018-05-15  1072  	 * The %DRM_MODE_CONTENT_TYPE_\* values much
50525c332b55f8 Stanislav Lisovskiy  2018-05-15  1073  	 * match the values.
50525c332b55f8 Stanislav Lisovskiy  2018-05-15  1074  	 */
50525c332b55f8 Stanislav Lisovskiy  2018-05-15  1075  	unsigned int content_type;
50525c332b55f8 Stanislav Lisovskiy  2018-05-15  1076  
7672dbba85d30d Ramalingam C         2019-08-01  1077  	/**
7672dbba85d30d Ramalingam C         2019-08-01  1078  	 * @hdcp_content_type: Connector property to pass the type of
7672dbba85d30d Ramalingam C         2019-08-01  1079  	 * protected content. This is most commonly used for HDCP.
7672dbba85d30d Ramalingam C         2019-08-01  1080  	 */
7672dbba85d30d Ramalingam C         2019-08-01  1081  	unsigned int hdcp_content_type;
7672dbba85d30d Ramalingam C         2019-08-01  1082  
8f6e1e22e7d0d4 Maarten Lankhorst    2017-05-01  1083  	/**
8f6e1e22e7d0d4 Maarten Lankhorst    2017-05-01  1084  	 * @scaling_mode: Connector property to control the
8f6e1e22e7d0d4 Maarten Lankhorst    2017-05-01  1085  	 * upscaling, mostly used for built-in panels.
8f6e1e22e7d0d4 Maarten Lankhorst    2017-05-01  1086  	 */
8f6e1e22e7d0d4 Maarten Lankhorst    2017-05-01  1087  	unsigned int scaling_mode;
24557865c8b1a6 Sean Paul            2018-01-08  1088  
24557865c8b1a6 Sean Paul            2018-01-08  1089  	/**
24557865c8b1a6 Sean Paul            2018-01-08  1090  	 * @content_protection: Connector property to request content
24557865c8b1a6 Sean Paul            2018-01-08  1091  	 * protection. This is most commonly used for HDCP.
24557865c8b1a6 Sean Paul            2018-01-08  1092  	 */
24557865c8b1a6 Sean Paul            2018-01-08  1093  	unsigned int content_protection;
935774cd71fe60 Brian Starkey        2017-03-29  1094  
d2c6a405846c24 Uma Shankar          2019-02-19  1095  	/**
d2c6a405846c24 Uma Shankar          2019-02-19  1096  	 * @colorspace: State variable for Connector property to request
d2c6a405846c24 Uma Shankar          2019-02-19  1097  	 * colorspace change on Sink. This is most commonly used to switch
d2c6a405846c24 Uma Shankar          2019-02-19  1098  	 * to wider color gamuts like BT2020.
d2c6a405846c24 Uma Shankar          2019-02-19  1099  	 */
1626761ee4406c Harry Wentland       2023-02-03  1100  	enum drm_colorspace colorspace;
d2c6a405846c24 Uma Shankar          2019-02-19  1101  
935774cd71fe60 Brian Starkey        2017-03-29  1102  	/**
935774cd71fe60 Brian Starkey        2017-03-29  1103  	 * @writeback_job: Writeback job for writeback connectors
935774cd71fe60 Brian Starkey        2017-03-29  1104  	 *
b13cc8dd588434 Brian Starkey        2017-03-29  1105  	 * Holds the framebuffer and out-fence for a writeback connector. As
b13cc8dd588434 Brian Starkey        2017-03-29  1106  	 * the writeback completion may be asynchronous to the normal commit
b13cc8dd588434 Brian Starkey        2017-03-29  1107  	 * cycle, the writeback job lifetime is managed separately from the
b13cc8dd588434 Brian Starkey        2017-03-29  1108  	 * normal atomic state by this object.
935774cd71fe60 Brian Starkey        2017-03-29  1109  	 *
935774cd71fe60 Brian Starkey        2017-03-29  1110  	 * See also: drm_writeback_queue_job() and
935774cd71fe60 Brian Starkey        2017-03-29  1111  	 * drm_writeback_signal_completion()
935774cd71fe60 Brian Starkey        2017-03-29  1112  	 */
935774cd71fe60 Brian Starkey        2017-03-29  1113  	struct drm_writeback_job *writeback_job;
47e22ff1a9e0c1 Radhakrishna Sripada 2018-10-12  1114  
47e22ff1a9e0c1 Radhakrishna Sripada 2018-10-12  1115  	/**
47e22ff1a9e0c1 Radhakrishna Sripada 2018-10-12  1116  	 * @max_requested_bpc: Connector property to limit the maximum bit
47e22ff1a9e0c1 Radhakrishna Sripada 2018-10-12  1117  	 * depth of the pixels.
47e22ff1a9e0c1 Radhakrishna Sripada 2018-10-12  1118  	 */
47e22ff1a9e0c1 Radhakrishna Sripada 2018-10-12  1119  	u8 max_requested_bpc;
47e22ff1a9e0c1 Radhakrishna Sripada 2018-10-12  1120  
47e22ff1a9e0c1 Radhakrishna Sripada 2018-10-12  1121  	/**
47e22ff1a9e0c1 Radhakrishna Sripada 2018-10-12  1122  	 * @max_bpc: Connector max_bpc based on the requested max_bpc property
47e22ff1a9e0c1 Radhakrishna Sripada 2018-10-12  1123  	 * and the connector bpc limitations obtained from edid.
47e22ff1a9e0c1 Radhakrishna Sripada 2018-10-12  1124  	 */
47e22ff1a9e0c1 Radhakrishna Sripada 2018-10-12  1125  	u8 max_bpc;
fbb5d0353c62d1 Uma Shankar          2019-05-16  1126  
107fe904302092 Rajat Jain           2021-10-05  1127  	/**
107fe904302092 Rajat Jain           2021-10-05  1128  	 * @privacy_screen_sw_state: See :ref:`Standard Connector
107fe904302092 Rajat Jain           2021-10-05  1129  	 * Properties<standard_connector_properties>`
107fe904302092 Rajat Jain           2021-10-05  1130  	 */
107fe904302092 Rajat Jain           2021-10-05  1131  	enum drm_privacy_screen_status privacy_screen_sw_state;
107fe904302092 Rajat Jain           2021-10-05  1132  
fbb5d0353c62d1 Uma Shankar          2019-05-16  1133  	/**
fbb5d0353c62d1 Uma Shankar          2019-05-16  1134  	 * @hdr_output_metadata:
fbb5d0353c62d1 Uma Shankar          2019-05-16  1135  	 * DRM blob property for HDR output metadata
fbb5d0353c62d1 Uma Shankar          2019-05-16  1136  	 */
fbb5d0353c62d1 Uma Shankar          2019-05-16  1137  	struct drm_property_blob *hdr_output_metadata;
54cb39e2293b1e Maxime Ripard        2024-05-27  1138  
54cb39e2293b1e Maxime Ripard        2024-05-27  1139  	/**
54cb39e2293b1e Maxime Ripard        2024-05-27  1140  	 * @hdmi: HDMI-related variable and properties. Filled by
54cb39e2293b1e Maxime Ripard        2024-05-27  1141  	 * @drm_atomic_helper_connector_hdmi_check().
54cb39e2293b1e Maxime Ripard        2024-05-27  1142  	 */
5b530587b3eb3e Maxime Ripard        2024-06-10  1143  	struct drm_connector_hdmi_state hdmi;
52217195176115 Daniel Vetter        2016-08-12  1144  };
52217195176115 Daniel Vetter        2016-08-12  1145
Dmitry Baryshkov June 10, 2024, 6:05 p.m. UTC | #4
On Mon, Jun 10, 2024 at 01:12:00PM +0200, Maxime Ripard wrote:
> It looks like the documentation for the HDMI-related fields recently
> added to both the drm_connector and drm_connector_state structures
> trigger some warnings because of their use of anonymous structures:
> 
>   $ scripts/kernel-doc -none include/drm/drm_connector.h
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'broadcast_rgb' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'infoframes' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'avi' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'hdr_drm' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'spd' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'vendor' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'is_limited_range' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'output_bpc' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'output_format' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'tmds_char_rate' description in 'drm_connector_state'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'vendor' description in 'drm_connector'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'product' description in 'drm_connector'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'supported_formats' description in 'drm_connector'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'infoframes' description in 'drm_connector'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'lock' description in 'drm_connector'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'audio' description in 'drm_connector'
> 
> Create some intermediate structures instead of anonymous ones to silence
> the warnings.
> 
> Reported-by: Jani Nikula <jani.nikula@linux.intel.com>
> Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
> Fixes: 54cb39e2293b ("drm/connector: hdmi: Create an HDMI sub-state")
> Fixes: 948f01d5e559 ("drm/connector: hdmi: Add support for output format")
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
>  include/drm/drm_connector.h | 207 +++++++++++++++++++-----------------
>  1 file changed, 109 insertions(+), 98 deletions(-)
> 

With the semicolon fixed:

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Maxime Ripard June 13, 2024, 2:59 p.m. UTC | #5
On Mon, 10 Jun 2024 13:12:00 +0200, Maxime Ripard wrote:
> It looks like the documentation for the HDMI-related fields recently
> added to both the drm_connector and drm_connector_state structures
> trigger some warnings because of their use of anonymous structures:
> 
>   $ scripts/kernel-doc -none include/drm/drm_connector.h
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'broadcast_rgb' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'infoframes' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'avi' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'hdr_drm' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'spd' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'vendor' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'is_limited_range' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'output_bpc' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'output_format' description in 'drm_connector_state'
>   include/drm/drm_connector.h:1138: warning: Excess struct member 'tmds_char_rate' description in 'drm_connector_state'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'vendor' description in 'drm_connector'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'product' description in 'drm_connector'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'supported_formats' description in 'drm_connector'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'infoframes' description in 'drm_connector'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'lock' description in 'drm_connector'
>   include/drm/drm_connector.h:2112: warning: Excess struct member 'audio' description in 'drm_connector'
> 
> [...]

Applied to misc/kernel.git (drm-misc-next).

Thanks!
Maxime
diff mbox series

Patch

diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index e04a8a0d1bbd..1afee2939b71 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -927,10 +927,72 @@  struct drm_connector_hdmi_infoframe {
 	 * @set: Is the content of @data valid?
 	 */
 	bool set;
 };
 
+/*
+ * struct drm_connector_hdmi_state - HDMI state container
+ */
+struct drm_connector_hdmi_state {
+	/**
+	 * @broadcast_rgb: Connector property to pass the
+	 * Broadcast RGB selection value.
+	 */
+	enum drm_hdmi_broadcast_rgb broadcast_rgb;
+
+	/**
+	 * @infoframes: HDMI Infoframes matching that state
+	 */
+	struct {
+		/**
+		 * @avi: AVI Infoframes structure matching our
+		 * state.
+		 */
+		struct drm_connector_hdmi_infoframe avi;
+
+		/**
+		 * @hdr_drm: DRM (Dynamic Range and Mastering)
+		 * Infoframes structure matching our state.
+		 */
+		struct drm_connector_hdmi_infoframe hdr_drm;
+
+		/**
+		 * @spd: SPD Infoframes structure matching our
+		 * state.
+		 */
+		struct drm_connector_hdmi_infoframe spd;
+
+		/**
+		 * @vendor: HDMI Vendor Infoframes structure
+		 * matching our state.
+		 */
+		struct drm_connector_hdmi_infoframe hdmi;
+	} infoframes;
+
+	/**
+	 * @is_limited_range: Is the output supposed to use a limited
+	 * RGB Quantization Range or not?
+	 */
+	bool is_limited_range;
+
+	/**
+	 * @output_bpc: Bits per color channel to output.
+	 */
+	unsigned int output_bpc;
+
+	/**
+	 * @output_format: Pixel format to output in.
+	 */
+	enum hdmi_colorspace output_format;
+
+	/**
+	 * @tmds_char_rate: TMDS Character Rate, in Hz.
+	 */
+	unsigned long long tmds_char_rate;
+
+}
+
 /**
  * struct drm_connector_state - mutable connector state
  */
 struct drm_connector_state {
 	/** @connector: backpointer to the connector */
@@ -1076,67 +1138,11 @@  struct drm_connector_state {
 
 	/**
 	 * @hdmi: HDMI-related variable and properties. Filled by
 	 * @drm_atomic_helper_connector_hdmi_check().
 	 */
-	struct {
-		/**
-		 * @broadcast_rgb: Connector property to pass the
-		 * Broadcast RGB selection value.
-		 */
-		enum drm_hdmi_broadcast_rgb broadcast_rgb;
-
-		/**
-		 * @infoframes: HDMI Infoframes matching that state
-		 */
-		struct {
-			/**
-			 * @avi: AVI Infoframes structure matching our
-			 * state.
-			 */
-			struct drm_connector_hdmi_infoframe avi;
-
-			/**
-			 * @hdr_drm: DRM (Dynamic Range and Mastering)
-			 * Infoframes structure matching our state.
-			 */
-			struct drm_connector_hdmi_infoframe hdr_drm;
-
-			/**
-			 * @spd: SPD Infoframes structure matching our
-			 * state.
-			 */
-			struct drm_connector_hdmi_infoframe spd;
-
-			/**
-			 * @vendor: HDMI Vendor Infoframes structure
-			 * matching our state.
-			 */
-			struct drm_connector_hdmi_infoframe hdmi;
-		} infoframes;
-
-		/**
-		 * @is_limited_range: Is the output supposed to use a limited
-		 * RGB Quantization Range or not?
-		 */
-		bool is_limited_range;
-
-		/**
-		 * @output_bpc: Bits per color channel to output.
-		 */
-		unsigned int output_bpc;
-
-		/**
-		 * @output_format: Pixel format to output in.
-		 */
-		enum hdmi_colorspace output_format;
-
-		/**
-		 * @tmds_char_rate: TMDS Character Rate, in Hz.
-		 */
-		unsigned long long tmds_char_rate;
-	} hdmi;
+	struct drm_connector_hdmi_state hdmi;
 };
 
 /**
  * struct drm_connector_hdmi_funcs - drm_hdmi_connector control functions
  */
@@ -1654,10 +1660,55 @@  struct drm_cmdline_mode {
 	 * Did the mode have a preferred TV mode?
 	 */
 	bool tv_mode_specified;
 };
 
+/*
+ * struct drm_connector_hdmi - DRM Connector HDMI-related structure
+ */
+struct drm_connector_hdmi {
+#define DRM_CONNECTOR_HDMI_VENDOR_LEN	8
+	/**
+	 * @vendor: HDMI Controller Vendor Name
+	 */
+	unsigned char vendor[DRM_CONNECTOR_HDMI_VENDOR_LEN] __nonstring;
+
+#define DRM_CONNECTOR_HDMI_PRODUCT_LEN	16
+	/**
+	 * @product: HDMI Controller Product Name
+	 */
+	unsigned char product[DRM_CONNECTOR_HDMI_PRODUCT_LEN] __nonstring;
+
+	/**
+	 * @supported_formats: Bitmask of @hdmi_colorspace
+	 * supported by the controller.
+	 */
+	unsigned long supported_formats;
+
+	/**
+	 * @funcs: HDMI connector Control Functions
+	 */
+	const struct drm_connector_hdmi_funcs *funcs;
+
+	/**
+	 * @infoframes: Current Infoframes output by the connector
+	 */
+	struct {
+		/**
+		 * @lock: Mutex protecting against concurrent access to
+		 * the infoframes, most notably between KMS and ALSA.
+		 */
+		struct mutex lock;
+
+		/**
+		 * @audio: Current Audio Infoframes structure. Protected
+		 * by @lock.
+		 */
+		struct drm_connector_hdmi_infoframe audio;
+	} infoframes;
+};
+
 /**
  * struct drm_connector - central DRM connector control structure
  *
  * Each connector may be connected to one or more CRTCs, or may be clonable by
  * another connector if they can share a CRTC.  Each connector also has a specific
@@ -2066,51 +2117,11 @@  struct drm_connector {
 	struct hdr_sink_metadata hdr_sink_metadata;
 
 	/**
 	 * @hdmi: HDMI-related variable and properties.
 	 */
-	struct {
-#define DRM_CONNECTOR_HDMI_VENDOR_LEN	8
-		/**
-		 * @vendor: HDMI Controller Vendor Name
-		 */
-		unsigned char vendor[DRM_CONNECTOR_HDMI_VENDOR_LEN] __nonstring;
-
-#define DRM_CONNECTOR_HDMI_PRODUCT_LEN	16
-		/**
-		 * @product: HDMI Controller Product Name
-		 */
-		unsigned char product[DRM_CONNECTOR_HDMI_PRODUCT_LEN] __nonstring;
-
-		/**
-		 * @supported_formats: Bitmask of @hdmi_colorspace
-		 * supported by the controller.
-		 */
-		unsigned long supported_formats;
-
-		/**
-		 * @funcs: HDMI connector Control Functions
-		 */
-		const struct drm_connector_hdmi_funcs *funcs;
-
-		/**
-		 * @infoframes: Current Infoframes output by the connector
-		 */
-		struct {
-			/**
-			 * @lock: Mutex protecting against concurrent access to
-			 * the infoframes, most notably between KMS and ALSA.
-			 */
-			struct mutex lock;
-
-			/**
-			 * @audio: Current Audio Infoframes structure. Protected
-			 * by @lock.
-			 */
-			struct drm_connector_hdmi_infoframe audio;
-		} infoframes;
-	} hdmi;
+	struct drm_connector_hdmi hdmi;
 };
 
 #define obj_to_connector(x) container_of(x, struct drm_connector, base)
 
 int drm_connector_init(struct drm_device *dev,