mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 19:07:52 +00:00
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>
This commit is contained in:
parent
6fd3639011
commit
d9c74fbead
1 changed files with 3 additions and 1 deletions
|
@ -56,7 +56,9 @@ static void timing_setup(struct ata_port *ap, struct ata_device *adev, int offse
|
||||||
u8 t;
|
u8 t;
|
||||||
|
|
||||||
T = 1000000000 / amd_clock;
|
T = 1000000000 / amd_clock;
|
||||||
UT = T / min_t(int, max_t(int, clock, 1), 2);
|
UT = T;
|
||||||
|
if (clock >= 2)
|
||||||
|
UT = T / 2;
|
||||||
|
|
||||||
if (ata_timing_compute(adev, speed, &at, T, UT) < 0) {
|
if (ata_timing_compute(adev, speed, &at, T, UT) < 0) {
|
||||||
dev_printk(KERN_ERR, &pdev->dev, "unknown mode %d.\n", speed);
|
dev_printk(KERN_ERR, &pdev->dev, "unknown mode %d.\n", speed);
|
||||||
|
|
Loading…
Reference in a new issue