diff options
author | Maximilian Luz <[email protected]> | 2021-01-26 18:22:02 +0100 |
---|---|---|
committer | Hans de Goede <[email protected]> | 2021-02-03 12:00:17 +0100 |
commit | 2691d0ae668ab9d9f3f275ac6ed6029862780084 (patch) | |
tree | 3948e18e262686c7a84b9d89ebc1a570c637fd8a /tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | |
parent | a40f530e77df61d8c91b24efbd357bda43bd3f14 (diff) |
platform/surface: aggregator: Fix braces in if condition with unlikely() macro
The braces of the unlikely() macro inside the if condition only cover
the subtraction part, not the whole statement. This causes the result of
the subtraction to be converted to zero or one. While that still works
in this context, it causes static analysis tools to complain (and is
just plain wrong).
Fix the bracket placement and, while at it, simplify the if-condition.
Also add a comment to the if-condition explaining what we expect the
result to be and what happens on the failure path, as it seems to have
caused a bit of confusion.
This commit should not cause any difference in behavior or generated
code.
Reported-by: Dan Carpenter <[email protected]>
Fixes: c167b9c7e3d6 ("platform/surface: Add Surface Aggregator subsystem")
Signed-off-by: Maximilian Luz <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hans de Goede <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py')
0 files changed, 0 insertions, 0 deletions