linux-stable/drivers/gpu/drm/xlnx
Nathan Huckleberry cec9e59cae drm: xlnx: Fix return type of zynqmp_dp_bridge_mode_valid
The mode_valid field in drm_bridge_helper_funcs is expected to be of
type
enum drm_mode_status (* mode_valid) (struct drm_bridge *bridge,
                                     struct drm_display_mode *mode);

The mismatched return type breaks forward edge kCFI since the underlying
function definition does not match the function hook definition. A new
warning in clang will catch this at compile time:

  drivers/gpu/drm/xlnx/zynqmp_dp.c:1573:16: error: incompatible function pointer types initializing 'enum drm_mode_status (*)(struct drm_bridge *, const struct drm_display_info *, const struct drm_display_mode *)' with an expression of type 'int (struct drm_bridge *, const struct drm_display_info *, const struct drm_display_mode *)' [-Werror,-Wincompatible-function-pointer-types-strict]
          .mode_valid = zynqmp_dp_bridge_mode_valid,
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.

The return type of zynqmp_dp_bridge_mode_valid should be changed from
int to enum drm_mode_status.

Reported-by: Dan Carpenter <error27@gmail.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/1703
Link: https://github.com/ClangBuiltLinux/linux/issues/1750
Signed-off-by: Nathan Huckleberry <nhuck@google.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[nathan: Rebase on drm-misc-next and fix conflicts
         Add note about new clang warning]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-09 16:50:21 +02:00
..
Kconfig drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00
Makefile drm: xlnx: zynqmp_dpsub: Move DRM/KMS initialization to separate file 2022-10-19 16:51:04 +03:00
zynqmp_disp.c drm: xlnx: zynqmp_dpsub: Support operation without DMA engine 2022-10-19 16:55:40 +03:00
zynqmp_disp.h drm: xlnx: zynqmp_dpsub: Allow configuration of layer mode 2022-10-19 16:55:40 +03:00
zynqmp_disp_regs.h
zynqmp_dp.c drm: xlnx: Fix return type of zynqmp_dp_bridge_mode_valid 2022-11-09 16:50:21 +02:00
zynqmp_dp.h drm: xlnx: zynqmp_dpsub: Manage DP and DISP allocations manually 2022-10-19 16:53:57 +03:00
zynqmp_dpsub.c drm: xlnx: zynqmp_dpsub: Add support for live video input 2022-10-19 16:55:40 +03:00
zynqmp_dpsub.h drm: xlnx: zynqmp_dpsub: Support operation without DMA engine 2022-10-19 16:55:40 +03:00
zynqmp_kms.c drm: xlnx: zynqmp_dpsub: Allow configuration of layer mode 2022-10-19 16:55:40 +03:00
zynqmp_kms.h drm: xlnx: zynqmp_dpsub: Rename zynqmp_dpsub_handle_vblank with DRM prefix 2022-10-19 16:55:39 +03:00