From patchwork Mon Jun 17 18:42:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 13701272 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 54E9AC2BA1A for ; Mon, 17 Jun 2024 18:43:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D0F1E10E4B2; Mon, 17 Jun 2024 18:43:03 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="baTqwTHg"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C6F410E4B2; Mon, 17 Jun 2024 18:43:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718649783; x=1750185783; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WSWDaeP5xjeda75dldf75dbBeBpk6nASmv6UBXIRI9Q=; b=baTqwTHgma/M7e7Q6RV8wHVCGmvmnvT8Yk5VD1P4nDZFHkUUnt+yT9EH rmArPx38ZUsywR1FqqAqYePqNwbdC73VozcPS/Gdg8gfO7t5WQ5X1evXY XgzV1or4TkHrpB4wjWJ5jPrrFFgxqm8Hi7yEz75J8OhJbMTjeqssv8CBA wTNF85MFgtqpHH1hF0M5vbb5HEfXWpCcMVNHstHcA7bfRYVMnz0XCIRP/ GiqtBA6/ks6/Ged37qNmOXE0xG7TJ6EzRqHnCNZUvj1+ukKRyozco/Ptw OueeMiDb/62x8JWInezKShNrng66v3MqTybE+EMxDv4iSguxamQ8RwvgG w==; X-CSE-ConnectionGUID: 4BdiyYuwTZW8WUajY9GO+w== X-CSE-MsgGUID: N2PWz3NDSaSAjp0l00QOow== X-IronPort-AV: E=McAfee;i="6700,10204,11106"; a="15726671" X-IronPort-AV: E=Sophos;i="6.08,245,1712646000"; d="scan'208";a="15726671" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2024 11:43:02 -0700 X-CSE-ConnectionGUID: 5I/Yqcm0SyyXqa3qtERM6g== X-CSE-MsgGUID: xKVsw96gRSascWybF4fqGw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,245,1712646000"; d="scan'208";a="41213606" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO intel.com) ([10.245.246.127]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2024 11:43:00 -0700 From: Andi Shyti To: intel-gfx , dri-devel Cc: Andi Shyti , Jonathan Cavitt , Lucas De Marchi Subject: [PATCH v2 1/2] drm/i915/gem: Return NULL instead of '0' Date: Mon, 17 Jun 2024 20:42:42 +0200 Message-ID: <20240617184243.330231-2-andi.shyti@linux.intel.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240617184243.330231-1-andi.shyti@linux.intel.com> References: <20240617184243.330231-1-andi.shyti@linux.intel.com> MIME-Version: 1.0 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" Commit 05da7d9f717b ("drm/i915/gem: Downgrade stolen lmem setup warning") returns '0' from i915_gem_stolen_lmem_setup(), but it's supposed to return a pointer to the intel_memory_region structure. Sparse complains with the following message: >> drivers/gpu/drm/i915/gem/i915_gem_stolen.c:943:32: sparse: sparse: Using plain integer as NULL pointer Return NULL. Signed-off-by: Andi Shyti Cc: Jonathan Cavitt Reviewed-by: Lucas De Marchi --- Cc: Lucas De Marchi drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c index 004471f60117..9ca73936dc5e 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c @@ -940,7 +940,7 @@ i915_gem_stolen_lmem_setup(struct drm_i915_private *i915, u16 type, drm_dbg(&i915->drm, "Disabling stolen memory support due to OOB placement: lmem_size = %lli vs dsm_base = %lli\n", lmem_size, dsm_base); - return 0; + return NULL; } dsm_size = ALIGN_DOWN(lmem_size - dsm_base, SZ_1M); }