Received: by 2002:a05:622a:1442:b0:3a5:28ea:c4b9 with SMTP id v2csp843119qtx; Mon, 31 Oct 2022 15:31:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5OntHtusAQ2vv9a8m86t0Tbb8M9MdeWNlnf73MQIrB1Aoq0c8vD2MnOqIi2jPZeQctTcVP X-Received: by 2002:a05:6402:b6b:b0:461:b9b2:6d58 with SMTP id cb11-20020a0564020b6b00b00461b9b26d58mr16088821edb.186.1667255496139; Mon, 31 Oct 2022 15:31:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667255496; cv=none; d=google.com; s=arc-20160816; b=Wg2Yqcz1ReZ6pE3vJjhgHyD9AsbhtgLNt9OGOD/DrF3No/wrLNcQemvrTnSqzbhjmq TMdrVeD8K0S8cbpQT5MGWWQEo8FS/nMvTZZp/H9/iZGx8EIap4IyUQGYE1MC3gduqWhw /5cexeU/ZD1jWFs+FU8EQ2tVQsF4UnUprcQiiYqkLWoOU65fiYVoh8jLRbu0uGRRcewr hN8yj+pdy3ZDb2K06kxE25+6XjyPKQgWK4uXPtUEjN13dHwr/Pno5kGJM6m0rLqknukS QUAh8U/Ot11/Wm50Oi9XEz7ydFA5tC2U1hZC4c8UObWhBjCTewIa/O3s1xTdXiDBupR5 Djug== 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=NlhuilVdQjwiCkJBExkX/ZjvIM98EOiGEqNZo8nqT/U=; b=a+nna8yFbIVmJ6DwtkGTOqb/Btnv9UdHTJQzDJvjq/hDXAHel2OKTH40rxGucNpO9F cgdZIoHM2akTH82X7rS3gx9YA2iL0PB8nHrWxMlcqUUSO6vw9U5YaKPRTzwivyvRrtUV AZlmMZxTuUr5DhNzIGMFI7mXnhuY8bebLj37t+Vtdm82uWEg44MBG1J0iDDKTMUVp6/C GP4Pm9FPTqlNtqDiKUtf/b9oC9bW/GFzbLdV+1AjFynZiQ6XG7RROgxkZMlUyxh5uHEa 4V6vPzFsCO7JihYbth2itDyY5vngEEv0rSFoD7U5ZGDNVfXG5OS2yMk4YQxVT6NLsxI/ zuFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pT5bW3aT; 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 dr7-20020a170907720700b007994dcae65fsi10313081ejc.613.2022.10.31.15.31.11; Mon, 31 Oct 2022 15:31:36 -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=pT5bW3aT; 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 S229993AbiJaWK7 (ORCPT + 99 others); Mon, 31 Oct 2022 18:10:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbiJaWK6 (ORCPT ); Mon, 31 Oct 2022 18:10:58 -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 9D5C4D46; Mon, 31 Oct 2022 15:10:57 -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 32DC9614C3; Mon, 31 Oct 2022 22:10:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF579C433D6; Mon, 31 Oct 2022 22:10:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667254256; bh=Ec7BYs/VjKf5gVDNbc8qVx8JTWU5+aUgupZduiEk6xY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pT5bW3aTyD2EuAVm4k/RLXpPjuRxVK6suWbYA8jfqEjE1Q69fl8B4IYe+GJDgCbzP 8Fxe8t7mGhlXUQnJtvF0NiiDCq/UDquQri93KsIYEYQnLDtc2pSpMaIYJr0moLXP1R 5nMGVpVkQY/p9let6jVce7DQaDP1Lz4c1n3QpfG2S9SiUn/iwnXXiTZD8gEQJFp6R0 W4F+nZMDWkkQaAT4SgHZTTi5GC3iEiTP3IQXUNEpompjkqoMA8gTdMRXqUIOPL9ZiM pkUxpBhCktL/UC14/5KK/IytKL99vIPn3Q3u6smUli5pwM+U6HB+iG1pesSbakBRxy zG5mV2LlKFDYQ== Date: Mon, 31 Oct 2022 15:10:54 -0700 From: Nathan Chancellor To: Nathan Huckleberry Cc: Dan Carpenter , llvm@lists.linux.dev, Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Nick Desaulniers , Tom Rix , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/msm: Fix return type of mdp4_lvds_connector_mode_valid Message-ID: References: <20220913205551.155128-1-nhuck@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220913205551.155128-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:55:48PM -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 mdp4_lvds_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/msm/disp/mdp4/mdp4_lvds_connector.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c > index 7288041dd86a..7444b75c4215 100644 > --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c > +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c > @@ -56,8 +56,9 @@ static int mdp4_lvds_connector_get_modes(struct drm_connector *connector) > return ret; > } > > -static int mdp4_lvds_connector_mode_valid(struct drm_connector *connector, > - struct drm_display_mode *mode) > +static enum drm_mode_status > +mdp4_lvds_connector_mode_valid(struct drm_connector *connector, > + struct drm_display_mode *mode) > { > struct mdp4_lvds_connector *mdp4_lvds_connector = > to_mdp4_lvds_connector(connector); > -- > 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/msm/disp/mdp4/mdp4_lvds_connector.c:89: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 = mdp4_lvds_connector_mode_valid, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Cheers, Nathan