From patchwork Tue Sep 13 20:55:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Huckleberry X-Patchwork-Id: 12975361 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 CE483ECAAD8 for ; Tue, 13 Sep 2022 20:57:03 +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=alRYhJjtIV1m+q7QpdEt0C8vpvNF6jIjavEOXQLVDUQ=; b=hI5GUTBvNgV5jA ROp2Ug+Qtul524T1pq9YgixTXBQbKGmPgfzDDUHOx2dlZojutWF3/wHrSwvtId6bOtPXlEDoY2Zrr VJxsOgWBhgn9jEsuXKAzS+EZL+VOEGqtn3EQ6xO0xBJUzCUSQrOrC6nIVw0WScz1Usps0I7OzG09n ohKuDjL2x5XsZ64yDW7M6GyxneViqUMYkqZ+NAbYf+tKrmik5b0sGIpra6d7ZJswn8Fn+SRVJOwDO WrtjuIgwTGP/Bj116XGVh7HvYohhRgsjLYkgFYkk7fdjGOOTKX4iu0EC2rxnyjnYj/mSq9Rnj9wJx SIQgnOMOd8xdwi8lVEeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYCwj-00GgLU-3d; Tue, 13 Sep 2022 20:55:53 +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 1oYCwf-00GgI5-3l for linux-arm-kernel@lists.infradead.org; Tue, 13 Sep 2022 20:55:50 +0000 Received: by mail-ua1-x94a.google.com with SMTP id o43-20020ab0596e000000b0038421e4c7deso3866596uad.19 for ; Tue, 13 Sep 2022 13:55:48 -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=B2mqYDiaNl85Fwjyeejod1j2C23kkV3KpQaZ/IDd3G0=; b=n5/3ZUe5YW7iVEaFTC1C/QTXggGwKQwtjWMw3jPI0BgMfRYYaenAHMYA7hmpH78woh lZrsAverREXV5LS1eNSZiEiLKiM+JXW0zOmxWAdX3LhCwLd9Qf/j9Y5hHtz2sPDqVpOO 3LE27kbTv/4DXc2cgdQMCkC3yessqW+eRLrKkgNWQ+Ghdk/GB4Xyotg4WWPaHI8nr0ZJ DFR3Zt4imBoTKoWRLhRctbaodxm4ndTXJF9eHcqbrD4UR0gehFkZtZ22JU5AJxGutNXu 2/qLLlTx4A77Jsxp0TXTu22DWntV2xma0eZbyML/CoROivz9n2Cnhwlejron+u+9bLkh E7/A== 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=B2mqYDiaNl85Fwjyeejod1j2C23kkV3KpQaZ/IDd3G0=; b=mUC0QAQ0PrOrPo/79gF7VvtDQQ7L7iydcB83GWhDJCKFeYZoseZIyzAfJI0XDAbZKI nVrpcvf29VL3McvD6JNj3Zgo4vNMJE+ZPocquPKbygKpYSN+T1uxMa8rZU4iJmT5mY6y QJlnez2OGM92IQOsdrN+Q0rAYhU5dwKH9SeWAw48U3/PfczLYf4PbQIyMHWxgxOBgZ72 DZYuO74tPBELgqPPgH+hwH0VS18rPsyCASc05HN69H0GOur8pXFlUAShtcLtO3hFruG/ fi1ZXh6mCelSJ43UwW/5f9reHBZ7k+LDt3897F9uz8LdnnZ3c/G0j4HIczRJ3uCPxyfY uJ/w== X-Gm-Message-State: ACgBeo31Ew2vdrm+sqKNyrnJ7xaZns5r/xS+aJg1Yo9FqypQUm7BC57n S/RgC/+NZxlODhmKiZjz6DK1clkk2g== X-Google-Smtp-Source: AA6agR6tnOJoQpNye/EaN3VzNTXwqOI2huVgh67Hj9kUaRNfdC+l6rBv/TSOXU4i5MQmCNQ7VhuyBZdcNQ== X-Received: from nhuck.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:39cc]) (user=nhuck job=sendgmr) by 2002:a67:f6d5:0:b0:398:3cdb:3f99 with SMTP id v21-20020a67f6d5000000b003983cdb3f99mr9320922vso.85.1663102547645; Tue, 13 Sep 2022 13:55:47 -0700 (PDT) Date: Tue, 13 Sep 2022 13:55:44 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220913205544.155106-1-nhuck@google.com> Subject: [PATCH] drm/imx: imx-tve: Fix return type of imx_tve_connector_mode_valid From: Nathan Huckleberry Cc: Nathan Huckleberry , Dan Carpenter , llvm@lists.linux.dev, Philipp Zabel , David Airlie , Daniel Vetter , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , 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_135549_243284_A251B9C6 X-CRM114-Status: GOOD ( 12.60 ) 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 imx_tve_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: Fabio Estevam Reviewed-by: Nathan Chancellor Reviewed-by: Philipp Zabel --- drivers/gpu/drm/imx/imx-tve.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/imx/imx-tve.c b/drivers/gpu/drm/imx/imx-tve.c index 6b34fac3f73a..ab4d1c878fda 100644 --- a/drivers/gpu/drm/imx/imx-tve.c +++ b/drivers/gpu/drm/imx/imx-tve.c @@ -218,8 +218,9 @@ static int imx_tve_connector_get_modes(struct drm_connector *connector) return ret; } -static int imx_tve_connector_mode_valid(struct drm_connector *connector, - struct drm_display_mode *mode) +static enum drm_mode_status +imx_tve_connector_mode_valid(struct drm_connector *connector, + struct drm_display_mode *mode) { struct imx_tve *tve = con_to_tve(connector); unsigned long rate;