diff options
| author | Sean Christopherson <[email protected]> | 2022-04-29 01:04:07 +0000 |
|---|---|---|
| committer | Paolo Bonzini <[email protected]> | 2022-06-20 06:21:36 -0400 |
| commit | 943dfea8f166d62657057170dbe8667ec96247ca (patch) | |
| tree | 02aa86bdc95e36b5e2a4a854169a7b91fd2b1e7c /tools/perf/scripts/python | |
| parent | 5d49f08c2e08c1f0de1bb0f2e1307ec969451729 (diff) | |
KVM: Do not zero initialize 'pfn' in hva_to_pfn()
Drop the unnecessary initialization of the local 'pfn' variable in
hva_to_pfn(). First and foremost, '0' is not an invalid pfn, it's a
perfectly valid pfn on most architectures. I.e. if hva_to_pfn() were to
return an "uninitializd" pfn, it would actually be interpeted as a legal
pfn by most callers.
Second, hva_to_pfn() can't return an uninitialized pfn as hva_to_pfn()
explicitly sets pfn to an error value (or returns an error value directly)
if a helper returns failure, and all helpers set the pfn on success.
The zeroing of 'pfn' was introduced by commit 2fc843117d64 ("KVM:
reorganize hva_to_pfn"), probably to avoid "uninitialized variable"
warnings on statements that return pfn. However, no compiler seems
to produce them, making the initialization unnecessary.
Signed-off-by: Sean Christopherson <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions