summaryrefslogtreecommitdiff
path: root/init/calibrate.c
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2021-04-14 13:28:17 +0200
committerPaul E. McKenney <paulmck@kernel.org>2021-05-18 10:58:14 -0700
commit6f2d98192c3f204592434177ba240564346eed9f (patch)
tree1b4187027078ed1a02fca8abf7a2202c72ad3459 /init/calibrate.c
parentea0484644e5b8486c8335f677fc1e2a4a5d76d3f (diff)
kcsan: Simplify value change detection
In kcsan_setup_watchpoint() we store snapshots of a watched value into a union of u8/u16/u32/u64 sized fields, modify this in place using a consistent field, then later check for any changes via the u64 field. We can achieve the safe effect more simply by always treating the field as a u64, as smaller values will be zero-extended. As the values are zero-extended, we don't need to truncate the access_mask when we apply it, and can always apply the full 64-bit access_mask to the 64-bit value. Finally, we can store the two snapshots and calculated difference separately, which makes the code a little easier to read, and will permit reporting the old/new values in subsequent patches. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Marco Elver <elver@google.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'init/calibrate.c')
0 files changed, 0 insertions, 0 deletions