Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp586977rwb; Wed, 9 Nov 2022 06:27:29 -0800 (PST) X-Google-Smtp-Source: AMsMyM4mAAtGEliFcZFbJCIR7/iWQN23I70dra/rHueakptJR7prxHEqILwKDwfueKYm/LXTbCXo X-Received: by 2002:a17:907:d04:b0:76e:e208:27ba with SMTP id gn4-20020a1709070d0400b0076ee20827bamr58464706ejc.652.1668004048816; Wed, 09 Nov 2022 06:27:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668004048; cv=none; d=google.com; s=arc-20160816; b=oXJjWvTlcAbzMPvbiOPvGRxVttcSwxhmMgzULn4STTWCY4V6jZkdfEcDiUqnoVVoUQ Q8u498b+Xpa0+F6YIvu+inE1nCeujZbFGmIzRaHFWeI0oVmCu+RCMQUabDbgQhf6HA4L 3ibF1cg7hnl+pgBtWLiB7KJ7PwJuMZB1GEkbtn1gMbhMRQ/uBMFhNn8i0MHRRmSZcs8S Qt/+KQjAY0LbxMvIs/mAmISzveTAU3/K9+5cP0bCHJ7qXfMm6sjVHlrNyUvhL8jr8vFC P624xjc/f+raKviNEwlaYljrKAcNEKMGoLeFWiosLgtLx61vXSaiIalTdtqlGTj7LhM7 wcgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vWZp9T7FbvcAtSmXO2qq0GwxBxLcXowRBfAAsD1hOD8=; b=CIwWVteIVGl4Q71Pw5ibsHXXauHOYlBstow68Klyav12ioujfpD8LF3RjmUPmDYkjI TC9VL4RxHFUaWmgIMn9Hr8nFIVcpIpH65nkUQZ8TonF4BseIJu5E9tJHe9Ifop5kNGWe 1Qoz8F9q2Pid5pe9534Pzrx+MtJqW6BJ/aQR7mFgOY7u/qjU7aB2oipcLSV8BjwpyCWq A3IhMxpEiqa9IxxjBPgRICmI7pP5cS66oHqhjLNLdyIKH+MzdImtAmvQBQ2SlqMgcfDQ iP2r3Uunkx5cuiDwJ9VK2Q7A2sePhbD7u5UURfUXsq6Hscbejqilrh8uIJ78aUmsw+C7 z3hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=YS+x2KWm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020aa7da91000000b0046187ab5c1bsi13323641eds.512.2022.11.09.06.27.06; Wed, 09 Nov 2022 06:27:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=YS+x2KWm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231519AbiKIOYD (ORCPT + 93 others); Wed, 9 Nov 2022 09:24:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231512AbiKIOXp (ORCPT ); Wed, 9 Nov 2022 09:23:45 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C171B27B0F for ; Wed, 9 Nov 2022 06:21:44 -0800 (PST) Received: from pendragon.ideasonboard.com (117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9FDB5896; Wed, 9 Nov 2022 15:21:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1668003702; bh=kP5lC0vCldZuVd7ukcL4OuhKGJfq527jSr9BMS6LjxQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YS+x2KWmsZNgtsyH6EfEhLBfJKSAlbi5DgNlGN7Y0g+/b8Luh/UiLTUtTDMqwI/Ia 1oCpbIqcqljqF9SpzFS8G5Uq5HQHqxN/o+6V5IpcqlJFHRTb5lAjS78bZiKqzj1Me0 ymo2e5OxlO3nJ0Ju3J7VpIyZqfeOUp0VzGkjBAdM= Date: Wed, 9 Nov 2022 16:21:23 +0200 From: Laurent Pinchart To: Nathan Chancellor Cc: Hyun Kwon , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, Nick Desaulniers , Tom Rix , Kees Cook , Sami Tolvanen , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Nathan Huckleberry , Dan Carpenter Subject: Re: [PATCH v2] drm: xlnx: Fix return type of zynqmp_dp_bridge_mode_valid Message-ID: References: <20221109001424.1422495-1-nathan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221109001424.1422495-1-nathan@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nathan, Thank you for the patch. On Tue, Nov 08, 2022 at 05:14:25PM -0700, Nathan Chancellor wrote: > From: Nathan Huckleberry > > The mode_valid field in drm_bridge_helper_funcs is expected to be of > type > enum drm_mode_status (* mode_valid) (struct drm_bridge *bridge, > 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. A new > warning in clang will catch this at compile time: > > drivers/gpu/drm/xlnx/zynqmp_dp.c:1573:16: error: incompatible function pointer types initializing 'enum drm_mode_status (*)(struct drm_bridge *, const struct drm_display_info *, const struct drm_display_mode *)' with an expression of type 'int (struct drm_bridge *, const struct drm_display_info *, const struct drm_display_mode *)' [-Werror,-Wincompatible-function-pointer-types-strict] > .mode_valid = zynqmp_dp_bridge_mode_valid, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > 1 error generated. > > The return type of zynqmp_dp_bridge_mode_valid should be changed from > int to enum drm_mode_status. > > Reported-by: Dan Carpenter > Link: https://github.com/ClangBuiltLinux/linux/issues/1703 > Link: https://github.com/ClangBuiltLinux/linux/issues/1750 > Signed-off-by: Nathan Huckleberry > Reviewed-by: Laurent Pinchart > [nathan: Rebase on drm-misc-next and fix conflicts > Add note about new clang warning] > Signed-off-by: Nathan Chancellor > --- > > Please consider picking this up so that it makes 6.2. I'll send a pull request shortly. > v2: > - Take over for Nathan, as he is busy with other matters. > - Rebase on drm-misc-next and resolve conflicts. > - Add a note about new clang warning that will catch this issue at > compile time. > > v1: https://lore.kernel.org/20220913205600.155172-1-nhuck@google.com/ > > drivers/gpu/drm/xlnx/zynqmp_dp.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c > index 7c9ae167eac7..0a7b466446fb 100644 > --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c > +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c > @@ -1362,9 +1362,10 @@ static void zynqmp_dp_bridge_detach(struct drm_bridge *bridge) > zynqmp_dp_aux_cleanup(dp); > } > > -static int zynqmp_dp_bridge_mode_valid(struct drm_bridge *bridge, > - const struct drm_display_info *info, > - const struct drm_display_mode *mode) > +static enum drm_mode_status > +zynqmp_dp_bridge_mode_valid(struct drm_bridge *bridge, > + const struct drm_display_info *info, > + const struct drm_display_mode *mode) > { > struct zynqmp_dp *dp = bridge_to_dp(bridge); > int rate; > > base-commit: 1a0257c352638916fdaffaac2ddedb8e049312f3 -- Regards, Laurent Pinchart