From patchwork Wed Apr 24 11:10:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13641744 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 C77FDC07E8E for ; Wed, 24 Apr 2024 11:11:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC71B113A4E; Wed, 24 Apr 2024 11:11:09 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="nUKOVbZv"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 08A7A113A4E for ; Wed, 24 Apr 2024 11:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713957068; x=1745493068; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=wvZYy826tBBdvmQl/C4YKRX15ERbDeplQoy2E92ILco=; b=nUKOVbZv0otcxHwHiFfEucSHBvaZ0Dl6ba9CsVr6f452zvYuM7/jYseG 1/tCdiXOdxh/BTYFzWsFLQi6HWlpTVtrr0d/VvGLxhkx1rjGwTMuXNoGp MduSESr6rpRn5jBt8vIpE8Q43W0t9T5vhCxYrQ7puwKyV0n8o7kwgeadk hmbm8M9BVOXDO4rtzaUL+M5+/7COtmTkMMdn2dOO5YXZqQwy1OgBRo178 KkICNXuoxI6EhGgXRejcQDKmXBB+op8BLJ+rWykcr3J+Zp3Zo36OM+1SB NmT8euO7R91esdgkaXGtDjlAo9imYulFXc5mXthByz7lkKGkbyu74PnqV g==; X-CSE-ConnectionGUID: EpbCe54vTheGM2XcTwEKjw== X-CSE-MsgGUID: 9JZJekwjQUejMtxWhvX/EQ== X-IronPort-AV: E=McAfee;i="6600,9927,11053"; a="9453124" X-IronPort-AV: E=Sophos;i="6.07,226,1708416000"; d="scan'208";a="9453124" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 04:11:08 -0700 X-CSE-ConnectionGUID: mpUcMrxAQ8i6vDZ+sF2gLQ== X-CSE-MsgGUID: pFbqpln5TUeYIiN8+VCNhQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,226,1708416000"; d="scan'208";a="24692565" Received: from vgrigo2x-mobl.ger.corp.intel.com (HELO localhost) ([10.252.48.49]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 04:11:06 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@intel.com Subject: [PATCH 1/4] drm/i915/dvo: return proper error code instead of magic -1 Date: Wed, 24 Apr 2024 14:10:58 +0300 Message-Id: <20240424111101.1152824-1-jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Use proper negative error codes intead of magic -1. Don't set a bad example, as -1 is -EPERM. Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/display/dvo_tfp410.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/dvo_tfp410.c b/drivers/gpu/drm/i915/display/dvo_tfp410.c index 0939e097f4f9..b36a526df52b 100644 --- a/drivers/gpu/drm/i915/display/dvo_tfp410.c +++ b/drivers/gpu/drm/i915/display/dvo_tfp410.c @@ -162,7 +162,7 @@ static int tfp410_getid(struct intel_dvo_device *dvo, int addr) tfp410_readb(dvo, addr+1, &ch2)) return ((ch2 << 8) & 0xFF00) | (ch1 & 0x00FF); - return -1; + return -EINVAL; } /* Ti TFP410 driver for chip on i2c bus */ From patchwork Wed Apr 24 11:10:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13641745 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 EC42BC10F15 for ; Wed, 24 Apr 2024 11:11:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5BBA0113A4F; Wed, 24 Apr 2024 11:11:13 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="X0NZ9fVd"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 71B13113A4F for ; Wed, 24 Apr 2024 11:11:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713957073; x=1745493073; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=J+ue6yD2Xuc/EtbDsMj/4in2VbKA8Z4eZt1CK3F/LmE=; b=X0NZ9fVd/AXFpXLIEsOSe5Qkj9+8J+NIsbh56+ljiab0XyKuxDFG36Yu 6TLjMKRCCyP9VWBM6lQQSgIWZ6d7CqTM41Zz33MedDd8s/ULZWMFHFmeX c/ZXhW175DBxhJ8RZMtJNx1ZZ3Il/9tUoz0EYLCL4eM13+z6PVp6kEryU vbbIJ53MIYBLokeCYy9Ks+lxxse1noB/jFQZx7rKrYtp/PSXZMZRqpqBU /ymFk3idrLCYgz8IluIT/oN+Is7JshMXfkFQrstDH8oGdrSfzrP4fGcO6 bpWNWgmKxd0sTkvw6h/dnI6rH7bqaC+52saIYalEa7sNgqbs9xmS+7URw g==; X-CSE-ConnectionGUID: EpAF3JZYSX+6eNKb9lecvg== X-CSE-MsgGUID: rKbQNMLaQ8GaEOiZ9s1dTg== X-IronPort-AV: E=McAfee;i="6600,9927,11053"; a="9412237" X-IronPort-AV: E=Sophos;i="6.07,226,1708416000"; d="scan'208";a="9412237" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 04:11:12 -0700 X-CSE-ConnectionGUID: GBRK2EUJSL28aRh6gFqK9Q== X-CSE-MsgGUID: OGrxdxS+Sx2bCsFygWBqvA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,226,1708416000"; d="scan'208";a="24564822" Received: from vgrigo2x-mobl.ger.corp.intel.com (HELO localhost) ([10.252.48.49]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 04:11:10 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@intel.com Subject: [PATCH 2/4] drm/i915/bios: return proper error codes instead of magic -1 Date: Wed, 24 Apr 2024 14:10:59 +0300 Message-Id: <20240424111101.1152824-2-jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240424111101.1152824-1-jani.nikula@intel.com> References: <20240424111101.1152824-1-jani.nikula@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Use proper negative error codes intead of magic -1. Don't set a bad example, as -1 is -EPERM. -1 might be fine for "invalid index" for a function that returns indices, but e.g. opregion_get_panel_type() already returns negative error codes so all the other code needs to cope with them anyway. Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/display/intel_bios.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index 661842a3c2e6..e1d9e6891ebb 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -631,13 +631,13 @@ static int vbt_get_panel_type(struct drm_i915_private *i915, lvds_options = bdb_find_section(i915, BDB_LVDS_OPTIONS); if (!lvds_options) - return -1; + return -ENOENT; if (lvds_options->panel_type > 0xf && lvds_options->panel_type != 0xff) { drm_dbg_kms(&i915->drm, "Invalid VBT panel type 0x%x\n", lvds_options->panel_type); - return -1; + return -EINVAL; } if (devdata && devdata->child.handle == DEVICE_HANDLE_LFP2) @@ -656,10 +656,10 @@ static int pnpid_get_panel_type(struct drm_i915_private *i915, const struct bdb_lvds_lfp_data_ptrs *ptrs; struct drm_edid_product_id product_id, product_id_nodate; struct drm_printer p; - int i, best = -1; + int i, best = -ENOENT; if (!drm_edid) - return -1; + return -EINVAL; drm_edid_get_product_id(drm_edid, &product_id); @@ -672,11 +672,11 @@ static int pnpid_get_panel_type(struct drm_i915_private *i915, ptrs = bdb_find_section(i915, BDB_LVDS_LFP_DATA_PTRS); if (!ptrs) - return -1; + return -ENOENT; data = bdb_find_section(i915, BDB_LVDS_LFP_DATA); if (!data) - return -1; + return -ENOENT; for (i = 0; i < 16; i++) { const struct drm_edid_product_id *vbt_id = @@ -702,7 +702,7 @@ static int fallback_get_panel_type(struct drm_i915_private *i915, const struct intel_bios_encoder_data *devdata, const struct drm_edid *drm_edid, bool use_fallback) { - return use_fallback ? 0 : -1; + return use_fallback ? 0 : -ENOENT; } enum panel_type { @@ -2568,12 +2568,12 @@ intel_bios_encoder_is_lspcon(const struct intel_bios_encoder_data *devdata) return devdata && HAS_LSPCON(devdata->i915) && devdata->child.lspcon; } -/* This is an index in the HDMI/DVI DDI buffer translation table, or -1 */ +/* This is an index in the HDMI/DVI DDI buffer translation table, or -ERANGE */ int intel_bios_hdmi_level_shift(const struct intel_bios_encoder_data *devdata) { if (!devdata || devdata->i915->display.vbt.version < 158 || DISPLAY_VER(devdata->i915) >= 14) - return -1; + return -ERANGE; return devdata->child.hdmi_level_shifter_value; } From patchwork Wed Apr 24 11:11:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13641746 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 B5AECC4345F for ; Wed, 24 Apr 2024 11:11:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0F2F0113A51; Wed, 24 Apr 2024 11:11:17 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="VqnC/5Ig"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id BA022113A51 for ; Wed, 24 Apr 2024 11:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713957076; x=1745493076; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CvyllY6NmMn3EqgKGrOLyESetqnaph2t9ouot2KOW+A=; b=VqnC/5IgDIpbnF8mBenCfVsWj8rco15SMmX+KY5O93zQTEJ3GSQwAynp 9r5D6GPwF1MUOHUPQSYSA/fbfO2tJ8miNd507XKya47A7hUndyqoGPjkS J2u22NZbpS8Gbenhp8Tjoawvw4LC+HNCuzXSoL3+nIC1Y4wBZsfO6T/za vnKXPpdedWlxKE4E1KqH9cT4T8DzZ79mDoNBLXfs+ZEzW7jRvSJrJDmUG wKL9WiADKndivy2M+sRvlJxaWHV8MGS4zIrQaMU1gYs4QSdJ+a+V1AdUo TazPaMQ+KY5gW9Gulm/qqusaex+logdpB+ZIUANVxVmZQeJlwNdBs9+bS Q==; X-CSE-ConnectionGUID: 8cCp99lzQJGBnFja+CAPOg== X-CSE-MsgGUID: wiRNfqQvQbaLRpyK0GzgwQ== X-IronPort-AV: E=McAfee;i="6600,9927,11053"; a="9412246" X-IronPort-AV: E=Sophos;i="6.07,226,1708416000"; d="scan'208";a="9412246" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 04:11:16 -0700 X-CSE-ConnectionGUID: kq7xRZtVQYuSpo3RDWT+oQ== X-CSE-MsgGUID: eoBn2umOS5KB5D49/HGnng== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,226,1708416000"; d="scan'208";a="24564835" Received: from vgrigo2x-mobl.ger.corp.intel.com (HELO localhost) ([10.252.48.49]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 04:11:14 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@intel.com Subject: [PATCH 3/4] drm/i915/dp: return proper error codes instead of magic -1 Date: Wed, 24 Apr 2024 14:11:00 +0300 Message-Id: <20240424111101.1152824-3-jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240424111101.1152824-1-jani.nikula@intel.com> References: <20240424111101.1152824-1-jani.nikula@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Use proper negative error codes intead of magic -1. Don't set a bad example, as -1 is -EPERM. Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/display/intel_dp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index e05e25cd4a94..30c1f39ff6d6 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -600,7 +600,7 @@ static int intersect_rates(const int *source_rates, int source_len, return k; } -/* return index of rate in rates array, or -1 if not found */ +/* return index of rate in rates array, or -ENOENT if not found */ static int intel_dp_rate_index(const int *rates, int len, int rate) { int i; @@ -609,7 +609,7 @@ static int intel_dp_rate_index(const int *rates, int len, int rate) if (rate == rates[i]) return i; - return -1; + return -ENOENT; } static void intel_dp_set_common_rates(struct intel_dp *intel_dp) @@ -680,7 +680,7 @@ int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp, */ if (intel_dp->is_mst) { drm_err(&i915->drm, "Link Training Unsuccessful\n"); - return -1; + return -EINVAL; } if (intel_dp_is_edp(intel_dp) && !intel_dp->use_max_params) { @@ -717,7 +717,7 @@ int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp, intel_dp->max_link_lane_count = lane_count >> 1; } else { drm_err(&i915->drm, "Link Training Unsuccessful\n"); - return -1; + return -EINVAL; } return 0; From patchwork Wed Apr 24 11:11:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13641747 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 D90B6C10F15 for ; Wed, 24 Apr 2024 11:11:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E983113A54; Wed, 24 Apr 2024 11:11:21 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="knH3vDwK"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0C3A7113A54 for ; Wed, 24 Apr 2024 11:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713957081; x=1745493081; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2EkghjWriyFuQ+9gf/BUdHxkGebnnThfqXf2dz3jaaw=; b=knH3vDwKGEjub1hvEWXJxntgWJyYH17l3o/hydI1hIFqzztulEMhvZid 4TizMYQjSW/9medMUSYqMvHylDDybzPciKJJMhDLvjVCbLWtXupyw6ioG Fe1ENIjsJd/01Fw9XGkibKiXUsWJChe6xJa7Sv5ocTYNldK7NgH0MCcWa ZRMfbAqKPuK1q5BFRQQTvVoehvUHk83DSc3/8OxM8GG6+Ag0ubAUvZlF6 Lld6iLqmN62n6t/z5A8s5+7xMJ9wISRvZ2OZOSAFxjhmiRtZjNrPna0eV Kj0fsaEn3xFaUiFRuznOVMhpZEIQJBup9aLbBJAS89csGBnfYkj8dgudC Q==; X-CSE-ConnectionGUID: Gn0f2EgoTiCwC3qve3ebpg== X-CSE-MsgGUID: QROJlZkIRqW+OSjsUVZo+g== X-IronPort-AV: E=McAfee;i="6600,9927,11053"; a="9412253" X-IronPort-AV: E=Sophos;i="6.07,226,1708416000"; d="scan'208";a="9412253" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 04:11:20 -0700 X-CSE-ConnectionGUID: A9PMZOi+Soi6wKD8//RvWw== X-CSE-MsgGUID: a0mgxnxXQJijAxQUI6l/8w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,226,1708416000"; d="scan'208";a="24564857" Received: from vgrigo2x-mobl.ger.corp.intel.com (HELO localhost) ([10.252.48.49]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 04:11:18 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@intel.com Subject: [PATCH 4/4] drm/i915/fb: return proper error codes instead of magic -1 Date: Wed, 24 Apr 2024 14:11:01 +0300 Message-Id: <20240424111101.1152824-4-jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240424111101.1152824-1-jani.nikula@intel.com> References: <20240424111101.1152824-1-jani.nikula@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Use proper negative error codes intead of magic -1. Don't set a bad example, as -1 is -EPERM. Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/display/intel_fb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c index 86b443433e8b..705f97ef677b 100644 --- a/drivers/gpu/drm/i915/display/intel_fb.c +++ b/drivers/gpu/drm/i915/display/intel_fb.c @@ -563,15 +563,15 @@ static bool intel_fb_is_gen12_ccs_aux_plane(const struct drm_framebuffer *fb, in * @fb: Framebuffer * * Returns: - * Returns the index of the color clear plane for @fb, or -1 if @fb is not a - * framebuffer using a render compression/color clear modifier. + * Returns the index of the color clear plane for @fb, or -EINVAL if @fb is not + * a framebuffer using a render compression/color clear modifier. */ int intel_fb_rc_ccs_cc_plane(const struct drm_framebuffer *fb) { const struct intel_modifier_desc *md = lookup_modifier(fb->modifier); if (!md->ccs.cc_planes) - return -1; + return -EINVAL; drm_WARN_ON_ONCE(fb->dev, hweight8(md->ccs.cc_planes) > 1);