Skip to content

Commit a3d0245

Browse files
committed
xtensa: fix xtensa_wsr always writing 0
The commit cad6fad ("xtensa: clean up WSR*/RSR*/get_sr/set_sr") replaced 'WSR' macro in the function xtensa_wsr with 'xtensa_set_sr', but variable 'v' in the xtensa_set_sr body shadowed the argument 'v' passed to it, resulting in wrong value written to debug registers. Fix that by removing intermediate variable from the xtensa_set_sr macro body. Cc: stable@vger.kernel.org Fixes: cad6fad ("xtensa: clean up WSR*/RSR*/get_sr/set_sr") Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
1 parent 7dc0eb0 commit a3d0245

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/xtensa/include/asm/processor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ extern unsigned long __get_wchan(struct task_struct *p);
242242

243243
#define xtensa_set_sr(x, sr) \
244244
({ \
245-
unsigned int v = (unsigned int)(x); \
246-
__asm__ __volatile__ ("wsr %0, "__stringify(sr) :: "a"(v)); \
245+
__asm__ __volatile__ ("wsr %0, "__stringify(sr) :: \
246+
"a"((unsigned int)(x))); \
247247
})
248248

249249
#define xtensa_get_sr(sr) \

0 commit comments

Comments
 (0)