From patchwork Tue Sep 13 20:54:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Huckleberry X-Patchwork-Id: 12975360 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 66F32C54EE9 for ; Tue, 13 Sep 2022 20:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:From:Subject:Message-ID:Mime-Version :Date:Reply-To:To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=AEW1vsIsoqcqmb0SqhMivg6FbAHjdJRW7lHFxJYm/yg=; b=GDOwvqmIqi6Gjn Pp6ZYF5p8jLaHhLUsnF368D94AkKlgLpAT2opck5iXONQ1KT70NvIWpyuPRvbsgM5y22TifJCH9nE EmZ1fe46AcdkiwHYFyBecbg3E9omh5rxO6XMQ2ZOqRGXfIYFkezU2DMf5+ULADskcy7yq/sRLXJ9c 44Kh0TSpJw8unH1951hQy3sVHL5mkjClLs0WcwRGShG1HT68xz/hHC9G/zETmy/9WGd9tLXU/Cohp uc3b29iXNvbl1j3upTfWitO/cU5fP2N1XO1kDwnmRSzqcQ+NozlaJQ5m9vSepN5mEw5bgxqP1HMbe cY6nyI9uqJzpL+pO1KMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYCwJ-00GfzD-Ne; Tue, 13 Sep 2022 20:55:27 +0000 Received: from mail-ua1-x94a.google.com ([2607:f8b0:4864:20::94a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYCw9-00GfrL-Nk for linux-arm-kernel@lists.infradead.org; Tue, 13 Sep 2022 20:55:19 +0000 Received: by mail-ua1-x94a.google.com with SMTP id p15-20020ab0154f000000b003b806d66461so2215966uae.23 for ; Tue, 13 Sep 2022 13:55:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:from:subject:message-id:mime-version:date:from:to:cc:subject :date; bh=nJJJEPzYfSkXVdsCpO+dC++9rjlYO0nwzxMLu7tGL28=; b=kBuaNyAa7BFLRUEAj+HWAu4RAwHGJ9M57W9cIKk5MyobRXZOJfVdASqgAzWehpzyUn Y2IjOvlKDeODQuKbuNU3iikjsk79MNdjB7129WV6VfDSJNyYNNWrbljfwjvUPNHaboNr uiD84mx7PdI1dLViLrk1nug6KFyvMaOYA5/g2iznrnDGS9JbMdD4SWf2Db7rcUZGQLcG PMriKa3MzKAq1ZqqRh77D4TnN4zbttl85a6WpoJim5+T9nS0Gpmnk8hOc6Hgjloq/vak YyqkjUk+2SaZYQyLFnw2OgHqRIPyCfeeMNJtGxqxurWYcYuRL5J4RQfQpyzJPmHPv9zm QTyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date; bh=nJJJEPzYfSkXVdsCpO+dC++9rjlYO0nwzxMLu7tGL28=; b=zVHhlCWsUmYlC6v4rnU/Y1fVrRDceZirOwGPG8E2QlafNZFu712i0DnBUfFEc73uyM RRMJYCBAeEV3xdpJCYDpSS23xtKaQEoIFojUfEtuC3bO7JEMiS0mcYVN85h3DWPo4VRO 3Ig0heh0/ZZxP74zDxOCIavKgiTUV6lL5oijj5/dmCJLy31xxdu5vHaqcI0VDj/1uvHJ WNR1a5ihdpFb9Hs6EwZTRD1cuJRaGN3I1Lw0uTUK1heKTcHyrUd3oUcWltfpA5GVgNEU dQqqQAO3AFkf7tSNscZKeSQQqPD2+oKLQvOfzlTkR/J++9Q2KuO2AxfddLxHGD018ET7 A+Lg== X-Gm-Message-State: ACgBeo2QB2mLhB5yJBhJfu6owKEVWyjwqVpw07SZmv64kqhAHGR2obtd 62dqMrjQTHp/6aYVb/P8Gr0SLjdaHw== X-Google-Smtp-Source: AA6agR4lN1+7GX3YCJf/g+HqBAOkYjtAZV+sr5K0G3Nx6PLg9iKXtY/f1H3UDT4F3TWgC7ydjoSAksoqag== X-Received: from nhuck.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:39cc]) (user=nhuck job=sendgmr) by 2002:a05:6122:106e:b0:39e:e580:440 with SMTP id k14-20020a056122106e00b0039ee5800440mr10035328vko.37.1663102515183; Tue, 13 Sep 2022 13:55:15 -0700 (PDT) Date: Tue, 13 Sep 2022 13:54:49 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220913205449.154966-1-nhuck@google.com> Subject: [PATCH] drm/exynos: Fix return type for mixer_mode_valid and hdmi_mode_valid From: Nathan Huckleberry Cc: Nathan Huckleberry , Dan Carpenter , llvm@lists.linux.dev, Inki Dae , Seung-Woo Kim , Kyungmin Park , David Airlie , Daniel Vetter , Krzysztof Kozlowski , Alim Akhtar , Nathan Chancellor , Nick Desaulniers , Tom Rix , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220913_135517_799809_3F34381B X-CRM114-Status: GOOD ( 13.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The field mode_valid in exynos_drm_crtc_ops is expected to be of type enum drm_mode_status (*mode_valid)(struct exynos_drm_crtc *crtc, const struct drm_display_mode *mode); Likewise for mode_valid in drm_connector_helper_funcs. The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of mixer_mode_valid and hdmi_mode_valid should be changed from int to enum drm_mode_status. Reported-by: Dan Carpenter Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Cc: llvm@lists.linux.dev Signed-off-by: Nathan Huckleberry Reviewed-by: Nathan Chancellor --- drivers/gpu/drm/exynos/exynos_hdmi.c | 4 ++-- drivers/gpu/drm/exynos/exynos_mixer.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 10b0036f8a2e..8453359c92e8 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -922,8 +922,8 @@ static int hdmi_find_phy_conf(struct hdmi_context *hdata, u32 pixel_clock) return -EINVAL; } -static int hdmi_mode_valid(struct drm_connector *connector, - struct drm_display_mode *mode) +static enum drm_mode_status hdmi_mode_valid(struct drm_connector *connector, + struct drm_display_mode *mode) { struct hdmi_context *hdata = connector_to_hdmi(connector); int ret; diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 65260a658684..82f676e6d21b 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -1045,8 +1045,9 @@ static void mixer_atomic_disable(struct exynos_drm_crtc *crtc) clear_bit(MXR_BIT_POWERED, &ctx->flags); } -static int mixer_mode_valid(struct exynos_drm_crtc *crtc, - const struct drm_display_mode *mode) +static enum drm_mode_status +mixer_mode_valid(struct exynos_drm_crtc *crtc, + const struct drm_display_mode *mode) { struct mixer_context *ctx = crtc->ctx; u32 w = mode->hdisplay, h = mode->vdisplay;