summaryrefslogtreecommitdiff
path: root/drivers/ata/pata_legacy.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-03-11 15:41:51 +0400
committerJeff Garzik <jgarzik@redhat.com>2013-04-04 03:53:10 +0400
commite0044c9822ab7b60b493bc135ec258227a082b5a (patch)
treee47da92671758736001b15df13add9afaf25c5df /drivers/ata/pata_legacy.c
parentbdfa2e7e5a46d7dcd9ff127fdf198faf90f0e215 (diff)
downloadlinux-e0044c9822ab7b60b493bc135ec258227a082b5a.tar.xz
pata_legacy: bogus clock in opti82c46x_set_piomode()
"sysclk" is used as an index into a 4 element array. My static checker complains because it can be out of bounds. From the context, it looks like there is a right bit shift missing. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_legacy.c')
-rw-r--r--drivers/ata/pata_legacy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index 4fe9d2138d48..be816428b430 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -542,7 +542,7 @@ static void opti82c46x_set_piomode(struct ata_port *ap, struct ata_device *adev)
u8 sysclk;
/* Get the clock */
- sysclk = opti_syscfg(0xAC) & 0xC0; /* BIOS set */
+ sysclk = (opti_syscfg(0xAC) & 0xC0) >> 6; /* BIOS set */
/* Enter configuration mode */
ioread16(ap->ioaddr.error_addr);