summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Chancellor <nathan@kernel.org>2025-09-08 13:24:59 -0700
committerThomas Zimmermann <tzimmermann@suse.de>2025-09-15 12:29:37 +0200
commit0265d0ebb409a25d3bb3a19494e0173d06d9d132 (patch)
tree659391e5b540b6f989427ad0e9c895fb4857af87
parentb4d90dbc4c1bc4bd3eb2d2989330af0eb95c98e8 (diff)
drm/pixpaper: Fix return type of pixpaper_mode_valid()drm-misc-next-fixes-2025-09-18
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: c9e70639f591 ("drm: tiny: Add support for Mayqueen Pixpaper e-ink panel") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20250908-drm-pixpaper-fix-mode_valid-return-type-v1-1-705ceaf03757@kernel.org
-rw-r--r--drivers/gpu/drm/tiny/pixpaper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/tiny/pixpaper.c b/drivers/gpu/drm/tiny/pixpaper.c
index b1379cb5f030..32598fb2fee7 100644
--- a/drivers/gpu/drm/tiny/pixpaper.c
+++ b/drivers/gpu/drm/tiny/pixpaper.c
@@ -968,8 +968,8 @@ static const struct drm_crtc_funcs pixpaper_crtc_funcs = {
.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
};
-static int pixpaper_mode_valid(struct drm_crtc *crtc,
- const struct drm_display_mode *mode)
+static enum drm_mode_status
+pixpaper_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode)
{
if (mode->hdisplay == PIXPAPER_WIDTH &&
mode->vdisplay == PIXPAPER_HEIGHT) {