[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241030162522.GA2228266@thelio-3990X>
Date: Wed, 30 Oct 2024 09:25:22 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Ira Weiny <ira.weiny@...el.com>
Cc: "Jiang, Dave" <dave.jiang@...el.com>, llvm@...ts.linux.dev,
oe-kbuild-all@...ts.linux.dev,
Navneet Singh <navneet.singh@...el.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>, kees@...nel.org,
linux-hardening@...r.kernel.org
Subject: Re: [weiny2:dcd-v4-2024-10-29 9/28] drivers/cxl/cxlmem.h:755:35:
error: use of undeclared identifier 'regions_retunred'
On Wed, Oct 30, 2024 at 09:50:42AM -0500, Ira Weiny wrote:
> [snip]
>
> > >> drivers/cxl/cxlmem.h:755:35: error: use of undeclared identifier 'regions_retunred'
> > 755 | } __packed region[] __counted_by(regions_retunred);
> > | ^
> > 16 warnings and 1 error generated.
> >
> >
> > vim +/regions_retunred +755 drivers/cxl/cxlmem.h
> >
> > 740
> > 741 /* See CXL 3.1 Table 8-164 get dynamic capacity config Output Payload */
> > 742 struct cxl_mbox_get_dc_config_out {
> > 743 u8 avail_region_count;
> > 744 u8 regions_returned;
> > 745 u8 rsvd[6];
> > 746 /* See CXL 3.1 Table 8-165 */
> > 747 struct cxl_dc_region_config {
> > 748 __le64 region_base;
> > 749 __le64 region_decode_length;
> > 750 __le64 region_length;
> > 751 __le64 region_block_size;
> > 752 __le32 region_dsmad_handle;
> > 753 u8 flags;
> > 754 u8 rsvd[3];
> > > 755 } __packed region[] __counted_by(regions_retunred);
>
> I'm not sure why my config/compiler did not catch this typo. I'm looking
> into it.
You are likely not using a compiler that supports __counted_by, which is
currently clang 18 (although soon to be 19.1.3 [1]) and GCC 15 (tip of
tree), in which case, the macro just evaluates to nothing, so there is
no validation of the value to the macro. It would be nice if there could
be but nothing immediately comes to mind because of where this macro is
being placed.
[1]: https://lore.kernel.org/20241029140036.577804-2-kernel@jfarr.cc/
Cheers,
Nathan
Powered by blists - more mailing lists