Skip to content

Commit

Permalink
ips_cmpxchg: remove compile-breaking bad cast-to-struct.
Browse files Browse the repository at this point in the history
uint32_t ptr argument in compare-and-swap code snippet should not be
cast to pointer-to-uint32_t[100] struct.

Signed-off-by: Brendan Cunningham <[email protected]>
  • Loading branch information
BrendanCunningham committed Dec 7, 2021
1 parent 57b70c0 commit c3a7d94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions include/linux-i386/sysdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,9 @@ static __inline__ uint32_t ips_cmpxchg(volatile uint32_t *ptr,
uint32_t old_val, uint32_t new_val)
{
uint32_t prev;
struct xchg_dummy {
uint32_t a[100];
};

asm volatile (LOCK_PREFIX "cmpxchgl %1,%2" : "=a"(prev)
: "q"(new_val), "m"(*(struct xchg_dummy *)ptr), "0"(old_val)
: "q"(new_val), "m"(*ptr), "0"(old_val)
: "memory");

return prev;
Expand Down
2 changes: 1 addition & 1 deletion rpm_release_extension
Original file line number Diff line number Diff line change
@@ -1 +1 @@
205
206

0 comments on commit c3a7d94

Please sign in to comment.