Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp452750rwn; Thu, 15 Sep 2022 01:00:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR7eWfF2I84OgTcDpc90jv4OJts9HMcLhxR/77TF8F2U+De0WFXk3DCmkFCT3lQNyWIJ1nVu X-Received: by 2002:a17:906:974f:b0:778:ce93:38e3 with SMTP id o15-20020a170906974f00b00778ce9338e3mr22711571ejy.644.1663228812658; Thu, 15 Sep 2022 01:00:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663228812; cv=none; d=google.com; s=arc-20160816; b=k/CkaLwVq7+9XP98aNh80jtICoIe9s2IFW/TBBLevAg8dnVPyqq+5EfVpOPuftj5ef yKfvDqQtorQFWP5VbeyqiNMm/drSRDSmHti9DEtiNr0YeYYva6wUgmvaY3IeeF27aEgI qyAENLgnAAGyXkvtvGsaxww5IZdVL3knbRImgDCzkwr0xiNInLVt5okn5RBG4jvXt8eo M8ThFdTOH81tYeEN4QJGaHjhyyf+smdI6fwofzv11Y7t6fb3o/uDt7C66WF1k2/PhQo9 VyW5er5qRFwQ15YNRLBCE1B+mOZ2XiKGu2W1UxRoROE5sMZJLiQaS28xNHCGpsiw+cqG rUDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from:dkim-signature; bh=SUpzZFQLixauyVlV/PWWMiMfRWBF9DA0BF3ScTDJtH4=; b=HIrQY/VNLIM66CPB9nsntMiTBf8df+uExgHMbWwOWfmWowF2jAGU8PmsgZnyJpDHYd w4z4RAlkLVMJXQ88siEyylQJStAkNdJUDOou2tnLcbIe+wttUN3ZhJNYYj3TcxLLHdiB s3GCot4Kz865jhOB1xX6BwQC8c3e0egl03nqccfPg7wm2sMUYFk2FJg5Xf27ON5jTZM4 j6Eguuh7o/8+v/ep4RHvoAX0gFIseNBQJcWIE8yM2t1KfAVwhFCusHLDhCqWCKQpaTTo LjsYCB3R5iasx5i3TLR7Zs9qa5sAsH/2eN0kuD7XjN1KBarxUOcZNaFCqGVnrtNAE3We 0sTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IeXPL+g6; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq13-20020a1709073f0d00b0073da5c8de1asi11878642ejc.178.2022.09.15.00.59.28; Thu, 15 Sep 2022 01:00:12 -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=@intel.com header.s=Intel header.b=IeXPL+g6; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229528AbiIOHjl (ORCPT + 99 others); Thu, 15 Sep 2022 03:39:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229570AbiIOHjj (ORCPT ); Thu, 15 Sep 2022 03:39:39 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DCD9DF99 for ; Thu, 15 Sep 2022 00:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663227578; x=1694763578; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=qT4pK26WhnKxnisAOU+dg9Nial+Fkme5ipurw767x5k=; b=IeXPL+g6LkiE3ky06mbajqHhnyRl+evOsBJwu8Q2cFB5DDLdesShFKsF G6SOMMUrwmoNYdTx02L18Vx1QVQdXA/r9ofnxm/VPilluqsP+f/LKSlCx 8F+BcdkzBHbCnZ2xVzIiVPhEeiRRhuFBt9MFqyG3V1MW0jLJMOzzWKyor zWV0MvLcFIdDNjhNXvDXslokqOJBwYlxOQGdNkXMrtgb91zglhblFnT5W l6iPNY/LIiAhOFyB+XZhbFRvKmaSyMv3e6KXvy6iUcwwYFU18PX+5BSvl Vj+1tb2kvUbVVtFXdbItc0nFby4vPvUEWP50JMe8CJmrOqc8ChemNEoGh A==; X-IronPort-AV: E=McAfee;i="6500,9779,10470"; a="384932868" X-IronPort-AV: E=Sophos;i="5.93,317,1654585200"; d="scan'208";a="384932868" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.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 Cc: Dan Carpenter , llvm@lists.linux.dev, 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 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 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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, 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