]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitdf1661368df8bc6decb36214fcd96b1067dfdae0
tree11a5c5c0f62901c509c4843b627edb5291463a42
parentbf9f2c3e50c94e02707f6ea419001f41765477f1
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