Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7219736rwn; Tue, 13 Sep 2022 16:22:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Cr2L+Kxp/xYU6Ec364OrtvrQKKbPATNDtkpU+a9LzpcVsn93J0U7clG0LWoOJ6YdtnDtF X-Received: by 2002:aa7:df8b:0:b0:44e:882f:7c5c with SMTP id b11-20020aa7df8b000000b0044e882f7c5cmr28086041edy.418.1663111353552; Tue, 13 Sep 2022 16:22:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663111353; cv=none; d=google.com; s=arc-20160816; b=i6oAbOE6cfwlYweCpgfBf+O4X+UuxDmDKeJi2MMUaXP8YG55oVraQq1SSKlaJqdPgC wjI7MxmIrnDoKvaeYT1Rr5YhvcxTqFwvMP6bQulPUHbe6z1EJIqjDiw13gJcVDFTc78O bVhKhQ8OMKoadk40/x2DkY2O1O/xTVvNppJ6mgzbFLzx+85p09nflvWMPYGL+X6cDKEI myj7XqEj7Lp4tGYmMcCPNO6wO8fnFiToLEnkljZiGaDkKCrBOlBbY72ePF7NrYMY1pci cDjIAQRMKXtZj2/YGty746f2dD9oqME0Gzr25g//SLbY9TQR+Wg0tZ6bVo8/N9UWEbOu epaw== 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=5ZxiQveXIFtbepu0TLpPtYA3vBzFOjrbEJB56Vv5d4g=; b=JIbVkQoF5RJQ4ed6K9jlPP5xy+VaqZNmRuljaL60ztZRASP3oC05c+scNN9jLug+va FdXy64ilNg8ApYZwRntWVQTQaA7HvMmpBw1eETOf4vAiI8EC+j/5B2T6FTmP2o9MMuRk C0i/rBwsj7xLp6e5k7GXnQtd0Z4lUX8r9P0hXT0kw6WZ9ue02b5YSpHjLrHb0NEN77YJ ScZArad3ej3dEqK3RFEoEDkaYwtY5L+d4F9reS5YE9WMdvGotKE6a7VTQth3dgi+xroM ZjdbdYmQh6R5rgF7VvSBGcyVthZS7dRvKLAmbKIUIGP7jYeQPC7XsSAe62KFjeAX6uUa v1sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GkBVk6Oj; 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 h6-20020a05640250c600b00451fb0ece9asi6178216edb.485.2022.09.13.16.22.07; Tue, 13 Sep 2022 16:22:33 -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=GkBVk6Oj; 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 S229759AbiIMXTQ (ORCPT + 99 others); Tue, 13 Sep 2022 19:19:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbiIMXTP (ORCPT ); Tue, 13 Sep 2022 19:19:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E6236EF03 for ; Tue, 13 Sep 2022 16:19:14 -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 ams.source.kernel.org (Postfix) with ESMTPS id 0A7F7B8110A for ; Tue, 13 Sep 2022 23:19:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD805C433C1; Tue, 13 Sep 2022 23:19:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663111151; bh=6khS5XPU33uH8kkng189ibUp6LbN758Z6u5O1YtiFGA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GkBVk6Oj0bb1wf0nvQXq3/tf9PvLhEyyK6fPNyUDl2itwvz1JtSpSvWCdE+T03FbG ivmD9Hf/JFIp4Ek9eSUvcendL7CvbrBidPmGhUlsQUMP/9U3o6KWXGNLed/XewuQE1 PEnYfLS77abuxruBI5fi3T7/ylzY7NxK+qxch/NRHuoubzOrFALyA7FF1JpgdNIsWd HMQGT79k4SsA0Ail2gUjxdLi83kTmzkhhupBtQZoGblQrcEM0lti9KkB8K93wLWFwh e18zCvBnSrBlxNl8l8rAyUSB4AiBnr1z2nMdCdSv9wJxalnPTti55tXmvnz8gyEcMu EEK5rQrIag/5Q== Date: Tue, 13 Sep 2022 16:19:09 -0700 From: Nathan Chancellor To: Nathan Huckleberry Cc: Dan Carpenter , llvm@lists.linux.dev, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Nick Desaulniers , Tom Rix , Matt Roper , Lucas De Marchi , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/i915: Fix return type of mode_valid function hook Message-ID: References: <20220913205531.155046-1-nhuck@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220913205531.155046-1-nhuck@google.com> X-Spam-Status: No, score=-7.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,T_SCC_BODY_TEXT_LINE 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 On Tue, Sep 13, 2022 at 01:55:27PM -0700, Nathan Huckleberry wrote: > All of the functions used for intel_dvo_dev_ops.mode_valid have a return > type of enum drm_mode_status, but the mode_valid field in the struct > definition has a return type of int. > > The mismatched return type breaks forward edge kCFI since the underlying > function definitions do not match the function hook definition. > > The return type of the mode_valid field 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: Nathan Chancellor > --- > drivers/gpu/drm/i915/display/intel_dvo_dev.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_dvo_dev.h b/drivers/gpu/drm/i915/display/intel_dvo_dev.h > index d96c3cc46e50..50205f064d93 100644 > --- a/drivers/gpu/drm/i915/display/intel_dvo_dev.h > +++ b/drivers/gpu/drm/i915/display/intel_dvo_dev.h > @@ -75,8 +75,8 @@ struct intel_dvo_dev_ops { > * > * \return MODE_OK if the mode is valid, or another MODE_* otherwise. > */ > - int (*mode_valid)(struct intel_dvo_device *dvo, > - struct drm_display_mode *mode); > + enum drm_mode_status (*mode_valid)(struct intel_dvo_device *dvo, > + struct drm_display_mode *mode); > > /* > * Callback for preparing mode changes on an output > -- > 2.37.2.789.g6183377224-goog >