]> git.baikalelectronics.ru Git - kernel.git/commit
drm/fourcc: fix integer type usage in uapi header
authorCarlos Llamas <cmllamas@google.com>
Tue, 21 Jun 2022 20:39:21 +0000 (20:39 +0000)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 29 Jun 2022 18:50:51 +0000 (14:50 -0400)
commit74e632979a7cb535437d63e2eca1d3504fcc42ab
tree762f50b392dca80778582d3be1581cf210c699c8
parent7ecd0cf94ad29df0d87edde68ef3754361094398
drm/fourcc: fix integer type usage in uapi header

Kernel uapi headers are supposed to use __[us]{8,16,32,64} types defined
by <linux/types.h> as opposed to 'uint32_t' and similar. See [1] for the
relevant discussion about this topic. In this particular case, the usage
of 'uint64_t' escaped headers_check as these macros are not being called
here. However, the following program triggers a compilation error:

  #include <drm/drm_fourcc.h>

  int main()
  {
   unsigned long x = AMD_FMT_MOD_CLEAR(RB);
   return 0;
  }

gcc error:
  drm.c:5:27: error: ‘uint64_t’ undeclared (first use in this function)
      5 |         unsigned long x = AMD_FMT_MOD_CLEAR(RB);
        |                           ^~~~~~~~~~~~~~~~~

This patch changes AMD_FMT_MOD_{SET,CLEAR} macros to use the correct
integer types, which fixes the above issue.

  [1] https://lkml.org/lkml/2019/6/5/18

Fixes: 12f6834d9e40 ("drm/fourcc: Add AMD DRM modifiers.")
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
include/uapi/drm/drm_fourcc.h