summaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorSergey Shtylyov <s.shtylyov@omp.ru>2022-04-09 21:13:56 +0200
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>2022-04-12 02:35:04 +0200
commita28c1ab312712c26a8d004af1f68628d625dafac (patch)
tree11a5c5c0f62901c509c4843b627edb5291463a42 /drivers/ata
parentlibata: Improve ATA queued command allocation (diff)
downloadlinux-a28c1ab312712c26a8d004af1f68628d625dafac.tar.xz
linux-a28c1ab312712c26a8d004af1f68628d625dafac.zip
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>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 23d1dc5faf73..eb8ff7b22616 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -898,7 +898,7 @@ EXPORT_SYMBOL_GPL(ata_xfer_mode2mask);
* RETURNS:
* Matching xfer_shift, -1 if no match found.
*/
-int ata_xfer_mode2shift(unsigned long xfer_mode)
+int ata_xfer_mode2shift(u8 xfer_mode)
{
const struct ata_xfer_ent *ent;