aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-postgresql.py
diff options
context:
space:
mode:
authorC Cheng <[email protected]>2023-12-19 11:14:42 +0800
committerRafael J. Wysocki <[email protected]>2024-02-12 17:07:49 +0100
commit88390dd788db485912ee7f9a8d3d56fc5265d52f (patch)
treeadab5bec8ae0c99181de60183edcd1ed47046432 /tools/perf/scripts/python/export-to-postgresql.py
parent496d0a648509bce665a85e19a871375dfe4c8f2e (diff)
cpuidle: Avoid potential overflow in integer multiplication
In detail: In C language, when you perform a multiplication operation, if both operands are of int type, the multiplication operation is performed on the int type, and then the result is converted to the target type. This means that if the product of int type multiplication exceeds the range that int type can represent, an overflow will occur even if you store the result in a variable of int64_t type. For a multiplication of two int values, it is better to use mul_u32_u32() rather than s->exit_latency_ns = s->exit_latency * NSEC_PER_USEC to avoid potential overflow happenning. Signed-off-by: C Cheng <[email protected]> Signed-off-by: Bo Ye <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> [ rjw: New subject ] Signed-off-by: Rafael J. Wysocki <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions