diff mbox series

[v2,3/6] drm/i915/gvt: rename range variable to stride

Message ID 8b8d4acee15da07845ed1779d6856d5c3f50a132.1717773890.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: gvt register macro cleanups, unused macro removals | expand

Commit Message

Jani Nikula June 7, 2024, 3:25 p.m. UTC
Range is a bit odd name for what really is stride. Rename. Switch to u32
while at it.

Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Zhi Wang <zhi.wang.linux@gmail.com>
Cc: intel-gvt-dev@lists.freedesktop.org
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/gvt/handlers.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Zhi Wang June 10, 2024, 10:57 a.m. UTC | #1
On Fri,  7 Jun 2024 18:25:37 +0300
Jani Nikula <jani.nikula@intel.com> wrote:

> Range is a bit odd name for what really is stride. Rename. Switch to
> u32 while at it.
> 
> Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
> Cc: Zhi Wang <zhi.wang.linux@gmail.com>
> Cc: intel-gvt-dev@lists.freedesktop.org
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  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) \

Reviewed-by: Zhi Wang <zhiwang@kernel.org>
diff mbox series

Patch

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) \