From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 C308DC433FE for ; Wed, 9 Nov 2022 14:21:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 20DFE10E5DF; Wed, 9 Nov 2022 14:21:48 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1865310E5DF for ; Wed, 9 Nov 2022 14:21:44 +0000 (UTC) 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kees Cook , Hyun Kwon , Tom Rix , llvm@lists.linux.dev, Nick Desaulniers , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, patches@lists.linux.dev, Sami Tolvanen , Nathan Huckleberry , linux-arm-kernel@lists.infradead.org, Dan Carpenter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 From mboxrd@z Thu Jan 1 00:00:00 1970 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 DB3A4C4332F for ; Wed, 9 Nov 2022 14:22:51 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fpGMaZugQNZra8Yvc5eCRrYir++B+8QEJKDJUCUqEDI=; b=12R8W3FYo0L9F9 0Djq0SUrTjXCCeW16amKWdILYZkFOsgdjrVRIXgvkmGqQwDgMEUBjktF0mMxdFpoisgkblxvKQgtz ycVafKwz/tGr1LrhqPRHrzuekyxhqZwflDKyJpCBNbisFncNaln0ddvSkkECOmkaWYVF2JfmkwDjm RQ7w8gioHhgEVOPwo2ESN+qndNQ3KVw9JvLpook/AolGAl1w6+9SuX4farlAV3TbLQrSnrmidQH6n 7aF6qsJI+6+fzPPeWwBHaW7kzsf2R+j891V8oyVy+x+dhpWxn117lvYfTZXvhc4B+uc1xMM3tNTpt 9isF5w/I9JG8xApC7EGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oslxc-00E6GF-FB; Wed, 09 Nov 2022 14:21:48 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oslxZ-00E6Eo-83 for linux-arm-kernel@lists.infradead.org; Wed, 09 Nov 2022 14:21:46 +0000 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-Disposition: inline In-Reply-To: <20221109001424.1422495-1-nathan@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221109_062145_454766_93C3B5DB X-CRM114-Status: GOOD ( 24.55 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F077717CD3; Wed, 9 Nov 2022 14:28:39 +0000 (UTC) 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> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221109001424.1422495-1-nathan@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