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

ata: pata_via: fix sloppy typing in via_do_set_mode()

The local variables 'T' and 'UT' are needlessly declared as *unsigned*
*long* -- the corresponding parameters of ata_timing_compute() are both
declared as *int*.  While fixing up those declarations, also make the
'via_clock' and 'T' variables *const* as they are never re-assigned
after initialization -- the object code should remain the same as gcc
previously used copy propagation anyway...

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 dafbbf5c
...@@ -248,9 +248,9 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, ...@@ -248,9 +248,9 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev,
struct pci_dev *pdev = to_pci_dev(ap->host->dev); struct pci_dev *pdev = to_pci_dev(ap->host->dev);
struct ata_device *peer = ata_dev_pair(adev); struct ata_device *peer = ata_dev_pair(adev);
struct ata_timing t, p; struct ata_timing t, p;
static int via_clock = 33333; /* Bus clock in kHZ */ const int via_clock = 33333; /* Bus clock in kHz */
unsigned long T = 1000000000 / via_clock; const int T = 1000000000 / via_clock;
unsigned long UT = T; int UT = T;
int ut; int ut;
int offset = 3 - (2*ap->port_no) - adev->devno; int offset = 3 - (2*ap->port_no) - adev->devno;
......
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