From patchwork Tue Sep 13 20:55:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Huckleberry X-Patchwork-Id: 12975370 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 DB966C54EE9 for ; Tue, 13 Sep 2022 20:57:36 +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=vbJzV/Ljg4ManHWIM7mABOHges5klInl+QgMUCgjBH4=; b=NdHj8iQYaHIUVC ZKv5DG0udI4Hbmz3cujKuPZFioJ7Wr4/rfAQ23zjAawh5Skh62zMVKZy0gLtjFCmZsF/w1jLfkwXp cVfUgwStm5Lx4UpY8DwbDvGCUUnOjH52vCTBzrhkp9+udZs9iXDEiNReCx20X8xaeZaqY+BGN7wPA YRs2afQiPUK8PwD0jDIQxjMdTGEI5oo4Szyhg8ihT6kwVWFzAQGmp8qjD3YZVttLrt7shijIc9U74 LeDhryYNFM1FOVM4neeJzSU/kV4A5Jv3HAhpP0JZKbLnuzaL2mdDy7LEYyE+qDRN3ZNERmtWsfdzW juC9H5+fsXdxH79yTgbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYCx9-00GggF-Cl; Tue, 13 Sep 2022 20:56:19 +0000 Received: from mail-vk1-xa4a.google.com ([2607:f8b0:4864:20::a4a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYCwr-00GgQQ-C1 for linux-arm-kernel@lists.infradead.org; Tue, 13 Sep 2022 20:56:03 +0000 Received: by mail-vk1-xa4a.google.com with SMTP id w6-20020a1f9406000000b00388997b8d31so2874324vkd.3 for ; Tue, 13 Sep 2022 13:55:59 -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=uR2BlBWxNwDXVN8KePRFZ054d83TeFIdqVCYAABhYhE=; b=KNxgHGMC5WX5o28iqf/s0dskwm5mmsxJ0wZRSSxynx4xdtWEgEz4Flo8Cw99zS5s5s KAgUjuccBs2bLOd+3qcCyeG9WsVLDIBdnmLU4P4jHYoMtXT6Phl4Z4EUd4Dvui5ye1K7 XDHlIbQoqA3IcdUsiiZKKxznchTLyYiYmaH5m2Vpp0C5T47szsZiVlY0XKyreM127+RP vUY8sBQZx279lJcP8CQYOAXLV3rSP1srdtBWVGET+LZpJPkv0Mg+V7WNt997ptz2QJLh 9kDaguBL6H0iTkRLN4T0gz+ptaMbOH5YcxaupcZmV+Vox7o6ANx6jw7gZsCWJSBZ4lMQ ZFwQ== 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=uR2BlBWxNwDXVN8KePRFZ054d83TeFIdqVCYAABhYhE=; b=BS0pg/wJKSof5w3/OmMYUG9TJ1huVN3e42Bxu7Dbzt8qLWub7C0qavLjsWLhYipyxx xYPyWsY1wF0F3/UFEgaVhg5fghAk77pB2KDYAAmAmswhn6P9qnWqbbfj3ZW0Cvalr59B b90QYXzbdB/I/XyFCVJ0oKnRE8MQIcoWncDr9QmOQrWRX7m9JllwpsLWL5oX1xCLGsjE lLIkGHW81ZE7p4aGH6dXHaf102UoJFcwTWvvEt1abeiR4uTxTalHNANTydNqfL3SVZ8A sGWYsg/qid7iU8aaO30HRItvSbebB/cZsQvh9BNgrgfG//sk/QU0mXRz6XUAEBbwXKdC Fbqw== X-Gm-Message-State: ACgBeo3wpf59TUohhvnBUiXvne5OCF7QYU7goh97vMQo/hh2wqK8Huhp kf0DZd89XoLkBWkxE8JESD7PEaogug== X-Google-Smtp-Source: AA6agR6BKp9O4/iCA7qsoXlt+ctid4gFcnrvB+lLTtzXiws1cBAzJPZ8bBFJc6NV4pZunK7Q1bkvTIRxbQ== X-Received: from nhuck.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:39cc]) (user=nhuck job=sendgmr) by 2002:a1f:b40a:0:b0:3a2:5af2:4750 with SMTP id d10-20020a1fb40a000000b003a25af24750mr3582947vkf.0.1663102558921; Tue, 13 Sep 2022 13:55:58 -0700 (PDT) Date: Tue, 13 Sep 2022 13:55:55 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220913205555.155149-1-nhuck@google.com> Subject: [PATCH] drm/rockchip: Fix return type of cdn_dp_connector_mode_valid From: Nathan Huckleberry Cc: Nathan Huckleberry , Dan Carpenter , llvm@lists.linux.dev, Sandy Huang , " =?utf-8?q?Heiko_?= =?utf-8?q?St=C3=BCbner?= " , David Airlie , Daniel Vetter , Nathan Chancellor , Nick Desaulniers , Tom Rix , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@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_135601_529244_AD5E62EF X-CRM114-Status: GOOD ( 12.20 ) 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 cdn_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 --- drivers/gpu/drm/rockchip/cdn-dp-core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c index c204e9b95c1f..518ee13b1d6f 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -283,8 +283,9 @@ static int cdn_dp_connector_get_modes(struct drm_connector *connector) return ret; } -static int cdn_dp_connector_mode_valid(struct drm_connector *connector, - struct drm_display_mode *mode) +static enum drm_mode_status +cdn_dp_connector_mode_valid(struct drm_connector *connector, + struct drm_display_mode *mode) { struct cdn_dp_device *dp = connector_to_dp(connector); struct drm_display_info *display_info = &dp->connector.display_info;