From patchwork Fri Jun 7 15:25:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13690392 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 F2D0AC27C53 for ; Fri, 7 Jun 2024 15:26:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6968810ECBA; Fri, 7 Jun 2024 15:26:05 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="kq4sfSyd"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0147D10ECB9; Fri, 7 Jun 2024 15:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717773964; x=1749309964; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=h+DZEJlPOsUNPqJu0yGmIJNI0JvAMkJYYXC44pqnD9M=; b=kq4sfSydwsGh+9wMd9OYPhOmQ83UIJ1fGebOG1RW0ZVbIc2HTWMdY5ef EBC1ri4GMa6U1LDOA21MvFJBDd/v/n6AqCjOa1/TGIdvQfExpcTRb9FlL GACVGrAvCsRUBEcv3nOpkqzFefyQFkRJkFx6T6VdD0wulmh/7Ko69smMO uUfXTnWi+Tr57K28cguaY+XPI1fStF4LhWCea4WpdiR5xNk22xNkgtvUw QhwrkGp3u8t0w+J1DMvNNuxC2PNB+razwKEIMIMaPxmVLbzE1ibS/YdiZ dq/TLEuwns4JzBLajdS0d2SmzkE1WvSsKTzBLW0VZpSuFxsF/3pjv422F w==; X-CSE-ConnectionGUID: cnbgdEW0TOaaqp20i5uRMg== X-CSE-MsgGUID: WsDfl9+lTba5FS3jdjhnNg== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="14633388" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="14633388" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 08:26:04 -0700 X-CSE-ConnectionGUID: /lQM3hSDQ6W3ljeGAXCzYA== X-CSE-MsgGUID: hBG9H/QLSZme6LQuDOqflw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="43491234" Received: from cpetruta-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.246.72]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 08:26:01 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org Cc: rodrigo.vivi@intel.com, ville.syrjala@linux.intel.com, jani.nikula@intel.com, Zhenyu Wang , Zhi Wang Subject: [PATCH v2 3/6] drm/i915/gvt: rename range variable to stride Date: Fri, 7 Jun 2024 18:25:37 +0300 Message-Id: <8b8d4acee15da07845ed1779d6856d5c3f50a132.1717773890.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: 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" Range is a bit odd name for what really is stride. Rename. Switch to u32 while at it. Cc: Zhenyu Wang Cc: Zhi Wang Cc: intel-gvt-dev@lists.freedesktop.org Signed-off-by: Jani Nikula Reviewed-by: Zhi Wang --- drivers/gpu/drm/i915/gvt/handlers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c index b005ab0104ee..f79dd6cfc75b 100644 --- a/drivers/gpu/drm/i915/gvt/handlers.c +++ b/drivers/gpu/drm/i915/gvt/handlers.c @@ -887,12 +887,12 @@ static unsigned int calc_index(unsigned int offset, i915_reg_t _start, u32 start = i915_mmio_reg_offset(_start); u32 next = i915_mmio_reg_offset(_next); u32 end = i915_mmio_reg_offset(_end); - unsigned int range = next - start; + u32 stride = next - start; if (offset < start || offset > end) return INVALID_INDEX; offset -= start; - return offset / range; + return offset / stride; } #define FDI_RX_CTL_TO_PIPE(offset) \