Commit 61176eed authored by Sergey Shtylyov's avatar Sergey Shtylyov Committed by Damien Le Moal

ata: libata-core: fix sloppy parameter type in ata_exec_internal[_sg]()

Make the 'timeout' parameter to ata_exec_internal_sg() *unsigned int* as
msecs_to_jiffies() that it calls takes just *unsigned int* for the time in
milliseconds. Then follow the suit with ata_exec_internal(), its only
caller; also fix up ata_dev_set_feature(), the only ata_exec_internal()'s
caller  that explicitly passes *unsigned long* variable for timeout...

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.
Signed-off-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
parent 2e0aee8f
...@@ -1470,7 +1470,7 @@ static void ata_qc_complete_internal(struct ata_queued_cmd *qc) ...@@ -1470,7 +1470,7 @@ static void ata_qc_complete_internal(struct ata_queued_cmd *qc)
static unsigned ata_exec_internal_sg(struct ata_device *dev, static unsigned ata_exec_internal_sg(struct ata_device *dev,
struct ata_taskfile *tf, const u8 *cdb, struct ata_taskfile *tf, const u8 *cdb,
int dma_dir, struct scatterlist *sgl, int dma_dir, struct scatterlist *sgl,
unsigned int n_elem, unsigned long timeout) unsigned int n_elem, unsigned int timeout)
{ {
struct ata_link *link = dev->link; struct ata_link *link = dev->link;
struct ata_port *ap = link->ap; struct ata_port *ap = link->ap;
...@@ -1645,7 +1645,7 @@ static unsigned ata_exec_internal_sg(struct ata_device *dev, ...@@ -1645,7 +1645,7 @@ static unsigned ata_exec_internal_sg(struct ata_device *dev,
unsigned ata_exec_internal(struct ata_device *dev, unsigned ata_exec_internal(struct ata_device *dev,
struct ata_taskfile *tf, const u8 *cdb, struct ata_taskfile *tf, const u8 *cdb,
int dma_dir, void *buf, unsigned int buflen, int dma_dir, void *buf, unsigned int buflen,
unsigned long timeout) unsigned int timeout)
{ {
struct scatterlist *psg = NULL, sg; struct scatterlist *psg = NULL, sg;
unsigned int n_elem = 0; unsigned int n_elem = 0;
...@@ -4342,7 +4342,7 @@ unsigned int ata_dev_set_feature(struct ata_device *dev, u8 enable, u8 feature) ...@@ -4342,7 +4342,7 @@ unsigned int ata_dev_set_feature(struct ata_device *dev, u8 enable, u8 feature)
{ {
struct ata_taskfile tf; struct ata_taskfile tf;
unsigned int err_mask; unsigned int err_mask;
unsigned long timeout = 0; unsigned int timeout = 0;
/* set up set-features taskfile */ /* set up set-features taskfile */
ata_dev_dbg(dev, "set features - SATA features\n"); ata_dev_dbg(dev, "set features - SATA features\n");
......
...@@ -52,7 +52,7 @@ extern u64 ata_tf_read_block(const struct ata_taskfile *tf, ...@@ -52,7 +52,7 @@ extern u64 ata_tf_read_block(const struct ata_taskfile *tf,
extern unsigned ata_exec_internal(struct ata_device *dev, extern unsigned ata_exec_internal(struct ata_device *dev,
struct ata_taskfile *tf, const u8 *cdb, struct ata_taskfile *tf, const u8 *cdb,
int dma_dir, void *buf, unsigned int buflen, int dma_dir, void *buf, unsigned int buflen,
unsigned long timeout); unsigned int timeout);
extern int ata_wait_ready(struct ata_link *link, unsigned long deadline, extern int ata_wait_ready(struct ata_link *link, unsigned long deadline,
int (*check_ready)(struct ata_link *link)); int (*check_ready)(struct ata_link *link));
extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment