ata: libata-core: fix parameter type in ata_xfer_mode2shift()
authorSergey Shtylyov <s.shtylyov@omp.ru>
Sat, 9 Apr 2022 19:13:56 +0000 (22:13 +0300)
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>
Tue, 12 Apr 2022 00:35:04 +0000 (09:35 +0900)
commita28c1ab312712c26a8d004af1f68628d625dafac
tree11a5c5c0f62901c509c4843b627edb5291463a42
parent4f1a22ee7b576a38dc5705837c9b0de0c7b5b064
ata: libata-core: fix parameter type in ata_xfer_mode2shift()

The data transfer mode that corresponds to the 'xfer_mode' parameter for
ata_xfer_mode2shift() is a 8-bit *unsigned* value.  Using *unsigned long*
to declare the parameter leads to a problematic implicit *int* to *unsigned
long* cast and was most probably a result of a copy/paste mistake -- use
the 'u8' type instead, as in ata_xfer_mode2mask()...

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>
drivers/ata/libata-core.c
include/linux/libata.h