lkml.org 
[lkml]   [2014]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 1/1] use documented cmpxchg api
On 06/06/2014 06:55 AM, Peter Hurley wrote:
>
> This won't work either, and should generate a compile or link error
> on CONFIG_X86_32.
>
> The auto-sizing done by __cmpxchg() does not substitute the cmpxchg8b
> instruction for the cmpxchg instruction. __X86_CASE_Q is defined as -1 for
> CONFIG_X86_32 so the 8-byte size variant is dead-code, and calls
> __cmpxchg_wrong_size() instead.
>
>
Fixed with the following v3:

use the documented cmpxchg64 instead of __cmpxchg64.

This kills the last user of said API in drivers code.

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
drivers/iommu/intel-iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 6bb3277..270113f 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -293,7 +293,7 @@ static inline u64 dma_pte_addr(struct dma_pte *pte)
return pte->val & VTD_PAGE_MASK;
#else
/* Must have a full atomic 64-bit read */
- return __cmpxchg64(&pte->val, 0ULL, 0ULL) & VTD_PAGE_MASK;
+ return cmpxchg64(&pte->val, 0ULL, 0ULL) & VTD_PAGE_MASK;
#endif
}

-- 1.7.9.5


\
 
 \ /
  Last update: 2014-06-06 17:01    [W:0.044 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site