diff mbox series

[1/4] cxl/acpi: Store interleave granularity absolutely

Message ID 20220127212911.127741-2-ben.widawsky@intel.com
State New, archived
Headers show
Series Unify meaning of interleave attributes | expand

Commit Message

Ben Widawsky Jan. 27, 2022, 9:29 p.m. UTC
This matches the usages everywhere else in the driver and matches the
existing kernel documentation defined for CXL decoders.

Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
---
 drivers/cxl/acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dan Williams Jan. 27, 2022, 10:46 p.m. UTC | #1
On Thu, Jan 27, 2022 at 1:29 PM Ben Widawsky <ben.widawsky@intel.com> wrote:
>
> This matches the usages everywhere else in the driver and matches the
> existing kernel documentation defined for CXL decoders.
>
> Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
> ---
>  drivers/cxl/acpi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
> index f64d98bfcb3b..f99cad8350fd 100644
> --- a/drivers/cxl/acpi.c
> +++ b/drivers/cxl/acpi.c
> @@ -11,7 +11,7 @@
>
>  /* Encode defined in CXL 2.0 8.2.5.12.7 HDM Decoder Control Register */
>  #define CFMWS_INTERLEAVE_WAYS(x)       (1 << (x)->interleave_ways)
> -#define CFMWS_INTERLEAVE_GRANULARITY(x)        ((x)->granularity + 8)
> +#define CFMWS_INTERLEAVE_GRANULARITY(x)        (1 << ((x)->granularity + 8))

Looks good.
diff mbox series

Patch

diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
index f64d98bfcb3b..f99cad8350fd 100644
--- a/drivers/cxl/acpi.c
+++ b/drivers/cxl/acpi.c
@@ -11,7 +11,7 @@ 
 
 /* Encode defined in CXL 2.0 8.2.5.12.7 HDM Decoder Control Register */
 #define CFMWS_INTERLEAVE_WAYS(x)	(1 << (x)->interleave_ways)
-#define CFMWS_INTERLEAVE_GRANULARITY(x)	((x)->granularity + 8)
+#define CFMWS_INTERLEAVE_GRANULARITY(x)	(1 << ((x)->granularity + 8))
 
 static unsigned long cfmws_to_decoder_flags(int restrictions)
 {