diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-03-28 17:33:56 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-17 15:44:18 -0400 |
commit | d9c74fbead08de13e3965e1c6ffe289f24f45479 (patch) | |
tree | 95c3e8e4f33b6a00858afeb10b6a8344fb5d838d /drivers/ata/pata_amd.c | |
parent | 6fd36390117f7844ad147377878ddb52088f583a (diff) |
pata_amd: fix sparse warning
Current code is essentially choosing between dividing by 1 or
dividing by two, make the conditions a little more obvious.
As a bonus, removes a sparse error:
drivers/ata/pata_amd.c:59:11: warning: symbol '__x' shadows an earlier one
drivers/ata/pata_amd.c:59:11: originally declared here
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_amd.c')
-rw-r--r-- | drivers/ata/pata_amd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c index 09c8286b689..33074c34105 100644 --- a/drivers/ata/pata_amd.c +++ b/drivers/ata/pata_amd.c | |||
@@ -56,7 +56,9 @@ static void timing_setup(struct ata_port *ap, struct ata_device *adev, int offse | |||
56 | u8 t; | 56 | u8 t; |
57 | 57 | ||
58 | T = 1000000000 / amd_clock; | 58 | T = 1000000000 / amd_clock; |
59 | UT = T / min_t(int, max_t(int, clock, 1), 2); | 59 | UT = T; |
60 | if (clock >= 2) | ||
61 | UT = T / 2; | ||
60 | 62 | ||
61 | if (ata_timing_compute(adev, speed, &at, T, UT) < 0) { | 63 | if (ata_timing_compute(adev, speed, &at, T, UT) < 0) { |
62 | dev_printk(KERN_ERR, &pdev->dev, "unknown mode %d.\n", speed); | 64 | dev_printk(KERN_ERR, &pdev->dev, "unknown mode %d.\n", speed); |