diff options
| author | Nathan Chancellor <nathan@kernel.org> | 2026-11-14 21:38:26 -0700 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-11-17 18:45:04 -0800 |
| commit | 5ec918f8d66a0311c52cc767ade67e7019beb176 (patch) | |
| tree | 29ceb33802e99becffdd3a9c085d552f2aadcf36 /tools/perf/scripts/python/bin | |
| parent | ff1ee9cc8993b1e5cf6459108dba1576fee221d0 (diff) | |
net: microchip: encx24j600: Avoid unsequenced accesses to jiffies in encx24j600_tx()
After a recent improvement in clang to warn on unsequenced accesses to
volatile variables [1], an instance appears in encx24j600_tx(), which
can break the build with CONFIG_WERROR=y / W=e:
drivers/net/ethernet/microchip/encx24j600.c:898:14: error: unsequenced accesses to volatile qualified 'jiffies' [-Werror,-Wunsequenced]
898 | jiffies, jiffies - dev_trans_start(dev));
| ~~~~~~~ ^
Per C11 5.1.2.3.2, accessing a volatile object is a side effect. Per C11
6.5.2, unsequenced side effects on the same scalar object are undefined
behavior. Per C11 6.5.2.2.10/12, the evaluation of arguments in a
function call is indeterminately sequenced, meaning any side effects in
the arguments are unsequenced.
Add a local variable to hold the value of jiffies before the function
call so that there are no unsequenced side effects, clearing up the
warning.
Cc: stable@vger.kernel.org
Fixes: 04fbfce7a222 ("net: Microchip encx24j600 driver")
Closes: https://github.com/ClangBuiltLinux/linux/issues/2196
Link: https://github.com/llvm/llvm-project/commit/955715460eaf9188c241c74750637fc82dfcc423 [1]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20261114-encx24j600-wunsequenced-v1-1-c978fc36cacd@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
