[Public] > -----Original Message----- > From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Mario > Limonciello > Sent: Friday, June 14, 2024 1:06 PM > To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx > Cc: Limonciello, Mario <Mario.Limonciello@xxxxxxx>; Tasos Sahanidis > <tasos@xxxxxxxxxxxx> > Subject: [PATCH 1/2] drm/amdgpu/pptable: Fix __counted_by attribute > > The attribute is not helpful if commented out. It's commented out on purpose because it breaks clang 19. See: https://lists.freedesktop.org/archives/amd-gfx/2024-May/109223.html Alex > > Cc: Tasos Sahanidis <tasos@xxxxxxxxxxxx> > Fixes: c6c4dd540125 ("drm/amdgpu/pptable: Fix UBSAN array-index-out-of- > bounds") > Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxx> > --- > drivers/gpu/drm/amd/include/pptable.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/include/pptable.h > b/drivers/gpu/drm/amd/include/pptable.h > index f83ace2d7ec3..984770d0eb4c 100644 > --- a/drivers/gpu/drm/amd/include/pptable.h > +++ b/drivers/gpu/drm/amd/include/pptable.h > @@ -480,7 +480,7 @@ typedef struct _StateArray{ > //how many states we have > UCHAR ucNumEntries; > > - ATOM_PPLIB_STATE_V2 states[] /* __counted_by(ucNumEntries) */; > + ATOM_PPLIB_STATE_V2 states[] __counted_by(ucNumEntries); > }StateArray; > > > -- > 2.43.0