Received: by 2002:a05:622a:1442:b0:3a5:28ea:c4b9 with SMTP id v2csp856730qtx; Mon, 31 Oct 2022 15:57:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4U2DHAFfIzwEvceDBUzV3QYZ+hM1zcqzscNWigHRmGSnx1nSqhK8JwIvghcoyjkm7vzK7i X-Received: by 2002:a63:2b90:0:b0:45b:f967:58a6 with SMTP id r138-20020a632b90000000b0045bf96758a6mr14981519pgr.313.1667256899938; Mon, 31 Oct 2022 15:54:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667256899; cv=none; d=google.com; s=arc-20160816; b=oR3vB39C4dIzfccc3RbpOawB9Jv6uDFRpSIPcPRafZmo4Bj+guxaaGAXBXjGKn9p0t e/kLMa9RxeMUPKEmrLz4jy51xCVsWYRLHTecrH9Ba6iDVpTn/J1n++QvlkJ6G2W/1Smt Yw9X8y/VnNBWZlqpun7IR3OA1RlxiZQBnHa2L3tul3nViE7V4AWOTQyWDr23AAVSo0It R+tPBr6+vjLW3XDXBSGQruVS99QI1pP8VcXWf6fbjq4quTzVrbJHKWhgMPuMPy11s56b w+AosdngS4YmVZK7d1N8TphHRqOAHMUAQzWl+pTd0IIraycVNhrQ9GmMSdXMnfo0tX1q /7/w== 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=dNuOhAGgYuP7MG9gIIOVn40GWAQ+tA7eJTmvuPOWsS0=; b=VRPK6x1xRUtmNRNRn3Lcb1kWA9VrUEVOr0mCGayqeCdWBOOxJpVT7Oh2e1om+NvPJ/ YgTj/v5EmTXxsZYfix7NX8EPoGjFxfpLpvO/PJSMmiU1RQFEW4oSz0Osdf6wbD9vGss7 dALctUlVC3/oUrn+TxR85m7d63f80TzWFPJpq47WRAt0kM5YkKGcDH0hZXl+pzAOCDth w1kTb+Sqg1HHGSwF82lcmfnUMeDAnHMIsP3CTMnCFRbYFp9oa6MfH5gWkOZd5yhPSSQI 2f30hD5zpSYVi7NDt3byrZwKRKWSkaDwT7GHGrAco4RmNsbHOayJkMPMmT+Pi+wLMand 58Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WTWhq78u; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o8-20020a654588000000b0046f6afe556bsi10918109pgq.651.2022.10.31.15.54.41; Mon, 31 Oct 2022 15:54:59 -0700 (PDT) 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 header.i=@kernel.org header.s=k20201202 header.b=WTWhq78u; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229772AbiJaWYg (ORCPT + 98 others); Mon, 31 Oct 2022 18:24:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbiJaWYe (ORCPT ); Mon, 31 Oct 2022 18:24:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D341E14082 for ; Mon, 31 Oct 2022 15:24:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 781D0614A4 for ; Mon, 31 Oct 2022 22:24:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E666C433D7; Mon, 31 Oct 2022 22:24:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667255072; bh=c430a9vtJ9VLpdvhysJooW/JnUHf5Y1ouH47JEN2P14=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WTWhq78uRNLiqVdI4TGtO46oG1p4v/zCTpBX8wI2zjC/49Ea74Bx/W3KE9TmaCzdF hxwiG13aeaNMJGIRuNr92vPbxk2TxonFCbZ1ucQ4wk+pL2aFBFyOWDzuUSV7nL3Laf 6SE3mn0W61+oV9Uf3RpX26XUKDYq/sLpULaZOHlyffJZ6BvYyJHbNSxOLMTagKFUUN xlNnIDnqGganQImu8fzJCmlVWV/U0rB3e4qfbWnRjhV4VL6J+4gqlqdxRwOGP4lDHl F39PT3miQm9J2K8S4mc0WnZHEAtfLoORFJ3cTkRpf2FsrrK6XKSPlV+PCrCaq8vk9g sHy3KIFTr/27w== Date: Mon, 31 Oct 2022 15:24:30 -0700 From: Nathan Chancellor To: Nathan Huckleberry Cc: Dan Carpenter , llvm@lists.linux.dev, Hyun Kwon , Laurent Pinchart , David Airlie , Daniel Vetter , Michal Simek , Nick Desaulniers , Tom Rix , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm: xlnx: Fix return type of zynqmp_dp_connector_mode_valid Message-ID: References: <20220913205600.155172-1-nhuck@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220913205600.155172-1-nhuck@google.com> X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 all, On Tue, Sep 13, 2022 at 01:56:00PM -0700, Nathan Huckleberry wrote: > 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 > --- > 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; > -- > 2.37.2.789.g6183377224-goog > > Did this patch get lost somewhere? I do not see it picked up. It is needed to avoid a new WIP warning from clang for catching these CFI failures: drivers/gpu/drm/xlnx/zynqmp_dp.c:1396:16: error: incompatible function pointer types initializing 'enum drm_mode_status (*)(struct drm_connector *, struct drm_display_mode *)' with an expression of type 'int (struct drm_connector *, struct drm_display_mode *)' [-Werror,-Wincompatible-function-pointer-types-strict] .mode_valid = zynqmp_dp_connector_mode_valid, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Cheers, Nathan