Failed compiling with ofa_kernel headers, on u24 with ofed version MLNX_OFED_LINUX-24.04-0.7.0.0

If I compile against the headers under “/usr/src/ofa_kernel” I get:

In file included from :
././include/linux/compiler_types.h:323: error: "__counted_by" redefined [-Werror]
323 | # define __counted_by(member)

In order to fix that, I needed to comment out the line #include <linux/types.h> in the file
/usr/src/ofa_kernel/x86_64/6.8.0-60-generic/include/linux/compiler_attributes.h

the problem starts at ubuntu kernel version Ubuntu-6.8.0-58.60 due to commit

I asked why the define of __counted_by moved down the include path, and I was answered, that the ofed headers should probably be fixed: