From patchwork Tue Sep 13 20:56:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Huckleberry X-Patchwork-Id: 12975371 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 A03F4C54EE9 for ; Tue, 13 Sep 2022 20:57:57 +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=EaysnNVXAPHgWdBog87j+zyeroxhXJEyczROsbbmFfQ=; b=yPFdzdsAFh5u+w yjUw+Hkd3R/ef9wnBMeHZR3QU0XgSFFawplTlGpSX/B2wxXIVBHUI+isViKdmyg8R2Uh0ROO+6YxN bSEk8sye0zSTGW5/r3Z5kz31tvAMxHHOfkuTWTi2BKHAgrla0wR6RpkWiG5ANAqCKyM+PXlpTbPwh Yc9WB9627vbjEFIfYGHk10NejdmrED2tAa6lqC6sss23f+Z+h1JEZ5RFT97wyhjz+Uu7OWaSPAQZq GagiTRhPn0H+T47Svw7lHZy2dR7B83vK/y6sArouEzF9XGlP/xVJaAJCl1s9K1J6Ug9Rhmi5q63Ls v9KmzpYRxrt69qNtC1wg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYCxW-00Gh1j-A6; Tue, 13 Sep 2022 20:56:42 +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 1oYCwu-00GgUF-Sg for linux-arm-kernel@lists.infradead.org; Tue, 13 Sep 2022 20:56:06 +0000 Received: by mail-ua1-x94a.google.com with SMTP id t10-20020ab046ca000000b003b39d8c5505so3886817uab.6 for ; Tue, 13 Sep 2022 13:56:03 -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=pCfRO3751PIceEFZobkVS7s+2QyKwW6/+h1LD3cCIeQ=; b=ZeVfR8Tnh5hBzCUV1+CS8+Iy1lLHRA/k5WbydQvejPxhARt8JYQuZEKNPKlx0P6GVg yS3MHFnOdeg2h6R2IoY/R5kf5QFzevs7rUHzS+y/eTO2MFlEPFSZAPH0d6AiPWeEEbkG P8yv/iZAbdsPOPomC15hdY9X8Cdkt9oBG8dVJYoUQd/wQYrVjWRYCDu9hUlrAbSWb8sI 4MkZuUL4ANwsnuUqTzJVq6CA5qkgBDyKNfPRJHNlV+OJp8RbhrrgpNXkwdr3YRqhsqz9 Npjq1zQ67uMxgk6qwpGWxv5ASBroZ28r1RSSts4jAHaN32pCKG+osEKJzn2sy9Tir86b pzow== 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=pCfRO3751PIceEFZobkVS7s+2QyKwW6/+h1LD3cCIeQ=; b=m2xFFvpawGm4NQx2p+uaRLVb704f17kC1ABEBUP7BN5gx7qKVVExexUU0tA9BXX08R cRWuu4Rjo7ChmLbTpAjpkFJnma5KO8+H0cewP35O9q6aFrI2L3vF9NZ80Kl0mky/5srX 3duPjJdeCfVh6PiRy4KBib+ckuMIaiSDJL+CY2cRADhPf9QKUJAGi/uFb7U1FdrmktXL df4Uf7Qh0EJze17ZOvjtwR7Bx5B3jJhrXP/qGtXUpSqh1ewP6avauqc+3Qj1Tw8cZXGW qemGsmp1lLYawJrNdeAaLfyjgthqY0M8yIXXHR5jrItz5mlI02UPlLb7naZCseSHPqqm Gugw== X-Gm-Message-State: ACgBeo1CF8mUAHx5Wu+/P4dpxp8yH082UYyVi5dNA1z5TSy0sry+/fPH xohugJi7MHaXF6ljvSGmvtuvXeXwEQ== X-Google-Smtp-Source: AA6agR56+CRX4Jw5oLwN56hGQ9u1QOvQ42gdvdnD0+27lrgrALWWvOvWch3l4gfgBdyZy9SYZgradcpnhQ== X-Received: from nhuck.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:39cc]) (user=nhuck job=sendgmr) by 2002:a1f:2ed8:0:b0:3a2:a7f:3e9e with SMTP id u207-20020a1f2ed8000000b003a20a7f3e9emr6201265vku.7.1663102563103; Tue, 13 Sep 2022 13:56:03 -0700 (PDT) Date: Tue, 13 Sep 2022 13:56:00 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220913205600.155172-1-nhuck@google.com> Subject: [PATCH] drm: xlnx: Fix return type of zynqmp_dp_connector_mode_valid From: Nathan Huckleberry Cc: Nathan Huckleberry , Dan Carpenter , llvm@lists.linux.dev, Hyun Kwon , Laurent Pinchart , David Airlie , Daniel Vetter , Michal Simek , Nathan Chancellor , Nick Desaulniers , Tom Rix , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220913_135604_967744_EFB9D973 X-CRM114-Status: GOOD ( 11.98 ) 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 mode_valid field in drm_connector_helper_funcs is expected to be of type enum drm_mode_status (* mode_valid) (struct drm_connector *connector, 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. The return type of zynqmp_dp_connector_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 Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/xlnx/zynqmp_dp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c index d14612b34796..f571b08d23d3 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c @@ -1352,8 +1352,9 @@ zynqmp_dp_connector_best_encoder(struct drm_connector *connector) return &dp->encoder; } -static int zynqmp_dp_connector_mode_valid(struct drm_connector *connector, - struct drm_display_mode *mode) +static enum drm_mode_status +zynqmp_dp_connector_mode_valid(struct drm_connector *connector, + struct drm_display_mode *mode) { struct zynqmp_dp *dp = connector_to_dp(connector); u8 max_lanes = dp->link_config.max_lanes;