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 E0CA6ECAAA1 for ; Thu, 15 Sep 2022 07:39:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D26AC10EAAC; Thu, 15 Sep 2022 07:39:42 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1048510EAB0; Thu, 15 Sep 2022 07:39:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663227579; x=1694763579; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=qT4pK26WhnKxnisAOU+dg9Nial+Fkme5ipurw767x5k=; b=RzMa89iJ/S0RSC0NIozaptmgJ6JLx4PQC6Znkk9ydsZwkczZnch4Ptmd ZeBRdVk1VCCejbcv8KH9CkFg4NcvJ7cH6v1Bkj9SFJZGWBdxWmA6kxrDo Lrgg0UxQYtxUcSLULB0PyRwUp7/ubibQSbkX1T2SsOKMqYu790lgXx43m 3z9efDS3ov2/9qiScl6xtElH7qtZ9U1IfGsufX3xAwY9tm6Rk4hiuHg1M jPvK1DJVy+6c+RZ5+pEgZEBUpLKeAey2AClKgtr55sdgdtGFFsiIfppW+ Q0jCbcrYT4i7Q/pQpEla7OjF9+9zU+CRE+Xb/R0TVKtrBA4BFabxsaZIR Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10470"; a="324901042" X-IronPort-AV: E=Sophos;i="5.93,317,1654585200"; d="scan'208";a="324901042" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2022 00:39:38 -0700 X-IronPort-AV: E=Sophos;i="5.93,317,1654585200"; d="scan'208";a="685618048" Received: from edgarisx-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.58.204]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2022 00:39:33 -0700 From: Jani Nikula To: Nathan Chancellor , Nathan Huckleberry In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20220913205531.155046-1-nhuck@google.com> Date: Thu, 15 Sep 2022 10:39:26 +0300 Message-ID: <87v8pp13yp.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix return type of mode_valid function hook X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lucas De Marchi , llvm@lists.linux.dev, Dan Carpenter , David Airlie , Tom Rix , intel-gfx@lists.freedesktop.org, Nick Desaulniers , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Rodrigo Vivi Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, 13 Sep 2022, Nathan Chancellor wrote: > 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 Thanks for the patch and reviews, pushed to drm-intel-next. BR, Jani. > >> --- >> 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 >> -- Jani Nikula, Intel Open Source Graphics Center