[PATCH v2] common/sfc: replace out of bounds condition with static_assert
Ferruh Yigit
ferruh.yigit at amd.com
Thu Feb 8 00:30:07 CET 2024
On 2/7/2024 10:36 PM, Stephen Hemminger wrote:
> On Wed, 7 Feb 2024 19:10:37 +0000
> Ferruh Yigit <ferruh.yigit at amd.com> wrote:
>
>> ../drivers/common/sfc_efx/base/ef10_filter.c:1246:18: error: shift count
>>> = width of type [-Werror,-Wshift-count-overflow]
>> matches_count = MCDI_OUT_DWORD(req,
>> ^~~~~~~~~~~~~~~~~~~
>> ../drivers/common/sfc_efx/base/efx_mcdi.h:493:2: note: expanded from
>> macro 'MCDI_OUT_DWORD'
>> EFX_DWORD_FIELD(*MCDI_OUT2(_emr, efx_dword_t, _ofst), \
>> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ../drivers/common/sfc_efx/base/efx_types.h:533:30: note: expanded from
>> macro 'EFX_DWORD_FIELD'
>> EFX_HIGH_BIT(_field)) & EFX_MASK32(_field))
>> ^~~~~~~~~~~~~~~~~~
>> ../drivers/common/sfc_efx/base/efx_types.h:145:23: note: expanded from
>> macro 'EFX_MASK32'
>> (((((uint32_t)1) << EFX_WIDTH(_field))) - 1))
>
> None of this got changed by the patch. Looks like it would not compile
> even without the patch on your version of clang.
>
Nope, error only happens with the patch.
And CI seems reporting the errors:
https://mails.dpdk.org/archives/test-report/2024-January/558546.html
More information about the dev
mailing list