diff options
author | Zheng Yejian <[email protected]> | 2021-05-15 22:06:30 +0800 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2022-11-30 16:13:18 -0800 |
commit | 457139f16ae15d86df1e491fc45a9ea56def57b5 (patch) | |
tree | ee2b4f536355921a5a6dfbcdab9029e6ea6bfa69 /scripts/generate_rust_analyzer.py | |
parent | de985c109096b236d43e98da0c65376bf3bc24fb (diff) |
acct: fix accuracy loss for input value of encode_comp_t()
Patch series "Fix encode_comp_t()".
Type conversion in encode_comp_t() may look a bit problematic.
This patch (of 2):
See calculation of ac_{u,s}time in fill_ac():
> ac->ac_utime = encode_comp_t(nsec_to_AHZ(pacct->ac_utime));
> ac->ac_stime = encode_comp_t(nsec_to_AHZ(pacct->ac_stime));
Return value of nsec_to_AHZ() is always type of 'u64', but it is handled
as type of 'unsigned long' in encode_comp_t, and accuracy loss would
happen on 32-bit platform when 'unsigned long' value is 32-bit-width.
So 'u64' value of encode_comp_t() may look better.
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Zheng Yejian <[email protected]>
Cc: Hanjun Guo <[email protected]>
Cc: Randy Dunlap <[email protected]> # build-tested
Cc: Vlastimil Babka <[email protected]>
Cc: Zhang Jinhao <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions