Skip to content

Commit 0265d0e

Browse files
nathanchancetdz
authored andcommitted
drm/pixpaper: Fix return type of pixpaper_mode_valid()
When building with -Wincompatible-function-pointer-types-strict, a warning designed to catch kernel control flow integrity (kCFI) issues at build time, there is an instance in the new tiny DRM pixpaper driver: drivers/gpu/drm/tiny/pixpaper.c:982:16: error: incompatible function pointer types initializing 'enum drm_mode_status (*)(struct drm_crtc *, const struct drm_display_mode *)' with an expression of type 'int (struct drm_crtc *, const struct drm_display_mode *)' [-Werror,-Wincompatible-function-pointer-types-strict] 982 | .mode_valid = pixpaper_mode_valid, | ^~~~~~~~~~~~~~~~~~~ While 'int' and 'enum drm_mode_status' are ABI compatible, hence no regular warning from -Wincompatible-function-pointer-types, the mismatch will trigger a kCFI violation when pixpaper_mode_valid() is called indirectly. Update the return type of pixpaper_mode_valid() to be 'enum drm_mode_status' to clear up the warning and kCFI violation. Fixes: c9e7063 ("drm: tiny: Add support for Mayqueen Pixpaper e-ink panel") Signed-off-by: Nathan Chancellor <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://lore.kernel.org/r/20250908-drm-pixpaper-fix-mode_valid-return-type-v1-1-705ceaf03757@kernel.org
1 parent b4d90db commit 0265d0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/tiny/pixpaper.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -968,8 +968,8 @@ static const struct drm_crtc_funcs pixpaper_crtc_funcs = {
968968
.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
969969
};
970970

971-
static int pixpaper_mode_valid(struct drm_crtc *crtc,
972-
const struct drm_display_mode *mode)
971+
static enum drm_mode_status
972+
pixpaper_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode)
973973
{
974974
if (mode->hdisplay == PIXPAPER_WIDTH &&
975975
mode->vdisplay == PIXPAPER_HEIGHT) {

0 commit comments

Comments
 (0)