diff mbox series

cxl: update var names for interleave granularity conversion macros

Message ID 166552460832.1940763.12713460501172006832.stgit@djiang5-desk3.ch.intel.com
State New, archived
Headers show
Series cxl: update var names for interleave granularity conversion macros | expand

Commit Message

Dave Jiang Oct. 11, 2022, 9:43 p.m. UTC
Change var names for granularity macros to clearly indicate which
variable is encoded and which is the actual granularity.

ig == interleave granularity
enig == encoded interleave granularity

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 drivers/cxl/cxl.h |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Davidlohr Bueso Oct. 13, 2022, 12:48 a.m. UTC | #1
On Tue, 11 Oct 2022, Dave Jiang wrote:

>Change var names for granularity macros to clearly indicate which
>variable is encoded and which is the actual granularity.
>
>ig == interleave granularity
>enig == encoded interleave granularity
>
>Signed-off-by: Dave Jiang <dave.jiang@intel.com>

Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
diff mbox series

Patch

diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h
index f680450f0b16..7a4f740d710c 100644
--- a/drivers/cxl/cxl.h
+++ b/drivers/cxl/cxl.h
@@ -69,11 +69,11 @@  static inline int cxl_hdm_decoder_count(u32 cap_hdr)
 }
 
 /* Encode defined in CXL 2.0 8.2.5.12.7 HDM Decoder Control Register */
-static inline int cxl_to_granularity(u16 ig, unsigned int *val)
+static inline int cxl_to_granularity(u16 enig, unsigned int *ig)
 {
-	if (ig > 6)
+	if (enig > 6)
 		return -EINVAL;
-	*val = 256 << ig;
+	*ig = 256 << enig;
 	return 0;
 }
 
@@ -94,11 +94,11 @@  static inline int cxl_to_ways(u8 eniw, unsigned int *val)
 	return 0;
 }
 
-static inline int granularity_to_cxl(int g, u16 *ig)
+static inline int granularity_to_cxl(int ig, u16 *enig)
 {
-	if (g > SZ_16K || g < 256 || !is_power_of_2(g))
+	if (ig > SZ_16K || ig < 256 || !is_power_of_2(ig))
 		return -EINVAL;
-	*ig = ilog2(g) - 8;
+	*enig = ilog2(ig) - 8;
 	return 0;
 }