On Jun 07 2022, Geert Uytterhoeven wrote:
On Wed, May 25, 2022 at 4:49 PM Dave Airlie airlied@gmail.com wrote:
drm/amdgpu: add nbio v7_7_0 ip headers
These header files are heavy users of large constants lacking the "U" suffix e.g.:
#define NB_ADAPTER_ID__SUBSYSTEM_ID_MASK 0xFFFF0000L
Assigning this to unsigned long on 32-bit will trigger a signed integer overflow, which is technically UB, and causes "error: initializer element is not constant" warnings with gcc-5 and -std-gnu11, cfr. [1]
That shouldn't happen here, as hexadecimal constants will be of unsigned type if they don't fit in the corresponding signed type.