diff options
| author | 2022-05-13 23:50:14 +0300 | |
|---|---|---|
| committer | 2022-06-13 11:42:58 +0900 | |
| commit | 79ad6a561958777d6d8ecfa66e51d09d35ec6450 (patch) | |
| tree | 865f89ae992297ebfef43478ac508a0fc1206b43 /kernel/debug/ssh:/git@git.zx2c4.com | |
| parent | ata: pata_hpt3x2n: pass base DPLL frequency to hpt3x2n_pci_clock() (diff) | |
| download | linux-dev-79ad6a561958777d6d8ecfa66e51d09d35ec6450.tar.xz linux-dev-79ad6a561958777d6d8ecfa66e51d09d35ec6450.zip | |
ata: libata-core: fix sloppy typing in ata_id_n_sectors()
The code multiplying the # of cylinders/heads/sectors in ata_id_n_sectors()
to get a disk capacity implicitly uses the *int* type for that calculation
and casting the result to 'u64' before returning ensues a sign extension.
Explicitly casting the 'u16' typed multipliers to 'u32' results in avoiding
a sign extension instruction and so in a more compact code...
Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Diffstat (limited to 'kernel/debug/ssh:/git@git.zx2c4.com')
0 files changed, 0 insertions, 0 deletions
