@@ -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;
}
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(-)