diff options
author | Tom Rini <trini@konsulko.com> | 2025-06-13 16:57:34 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-06-13 16:57:34 -0600 |
commit | 2556caa89caba6c3d4df7910828119bc65beb1f0 (patch) | |
tree | 1381f1957105fca50895e85b74101adcd75f6f6f /lib/trace.c | |
parent | f73450918d66565c5efacf2bb57227ba94bdaa40 (diff) | |
parent | ae86cd8c59fe08c9a37d14dbd6e42190dda2a0d4 (diff) |
Merge patch series "drop volatile from global data"
Rasmus Villemoes <ravi@prevas.dk> says:
There's really no reason for the gd pointer to have the volatile
qualifier.
In fact, I claim that it's completely unnecessary and just pessimizes
code generation and forces ugly casts in lots of places. For example,
see the casts in drivers/core/tag.c where elements are added to
gd->dm_taglist, or a helper such as cyclic_get_list() that should not
be needed.
Also, it is what ends up standing in the way of an otherwise
innocent code cleanup of list.h:
https://lore.kernel.org/u-boot/20250522165656.GB2179216@bill-the-cat/
Note that riscv, x86 as well as arm64 with LTO enabled has not had
this volatile qualifier, so it's unlikely there's any generic code
that depends on it.
Link: https://lore.kernel.org/r/20250604195612.2312979-1-ravi@prevas.dk
Diffstat (limited to 'lib/trace.c')
-rw-r--r-- | lib/trace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/trace.c b/lib/trace.c index 1d5f7dec979..3d54dfaddc0 100644 --- a/lib/trace.c +++ b/lib/trace.c @@ -66,7 +66,7 @@ static inline uintptr_t __attribute__((no_instrument_function)) /** * trace_gd - the value of the gd register */ -static volatile gd_t *trace_gd; +static gd_t *trace_gd; /** * trace_save_gd() - save the value of the gd register @@ -86,7 +86,7 @@ static void notrace trace_save_gd(void) */ static void notrace trace_swap_gd(void) { - volatile gd_t *temp_gd = trace_gd; + gd_t *temp_gd = trace_gd; trace_gd = gd; set_gd(temp_gd); |