# \[PATCH 06/65\] powerpc/cxl: Use REGION\_ID instead of opencoding

- From: Aneesh Kumar K.V \<hidden\>
- Date: 2016-03-27 08:24:42 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2016/03/9489018
- Thread: https://ratatoskr.run/linuxppc-dev/2016/03/9489013/t.md

```text
Signed-off-by: Aneesh Kumar K.V <redacted>
---
 drivers/misc/cxl/fault.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/cxl/fault.c b/drivers/misc/cxl/fault.c
index 33bd0ee30edd..67cc657e96cc 100644
--- a/drivers/misc/cxl/fault.c
+++ b/drivers/misc/cxl/fault.c
@@ -154,7 +154,7 @@ static void cxl_handle_page_fault(struct cxl_context *ctx,
 		access |= _PAGE_WRITE;
 
 	access |= _PAGE_PRIVILEGED;
-	if ((!ctx->kernel) || ~(dar & (1ULL << 63)))
+	if ((!ctx->kernel) || (REGION_ID(dar) == USER_REGION_ID))
 		access &= ~_PAGE_PRIVILEGED;
 
 	if (dsisr & DSISR_NOHPTE)
-- 
2.5.0
```
