From 4ab92bcf773e7b9e1367897047d5fa4d151d9e90 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sat, 26 Apr 2008 18:38:04 +1000 Subject: [PATCH 1/2] agp: fix shadowed variable warning in amd-k7-agp.c Introduced between 2.6.25-rc2 and -rc3 drivers/char/agp/amd-k7-agp.c:439:6: warning: symbol 'cap_ptr' shadows an earlier one drivers/char/agp/amd-k7-agp.c:414:5: originally declared here cap_ptr is never used again in this function, don't bother redeclaring. Signed-off-by: Harvey Harrison Signed-off-by: Andrew Morton Signed-off-by: Dave Airlie --- drivers/char/agp/amd-k7-agp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index d28669992147..96bdb9296b07 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c @@ -436,8 +436,9 @@ static int __devinit agp_amdk7_probe(struct pci_dev *pdev, system controller may experience noise due to strong drive strengths */ if (agp_bridge->dev->device == PCI_DEVICE_ID_AMD_FE_GATE_7006) { - u8 cap_ptr=0; struct pci_dev *gfxcard=NULL; + + cap_ptr = 0; while (!cap_ptr) { gfxcard = pci_get_class(PCI_CLASS_DISPLAY_VGA<<8, gfxcard); if (!gfxcard) { From 09aa356b5584090aab6810ec8002936d710cd4ac Mon Sep 17 00:00:00 2001 From: Mathieu Segaud Date: Fri, 18 Apr 2008 13:29:38 -0700 Subject: [PATCH 2/2] agp: convert drivers/char/agp/frontend.c to use unlocked_ioctl As of now, agp_compat_ioctl already runs without the BKL. Mutual exclusion is enforced by agp_fe.agp_mutex in agp_ioctl() and agp_compat_ioctl(). Apply the same locking rationale to the two functions allowing BKL cleanup. Signed-off-by: Mathieu Segaud Signed-off-by: Andrew Morton Signed-off-by: Dave Airlie --- drivers/char/agp/frontend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c index 55d7a82bd071..857b26227d87 100644 --- a/drivers/char/agp/frontend.c +++ b/drivers/char/agp/frontend.c @@ -967,7 +967,7 @@ int agpioc_chipset_flush_wrap(struct agp_file_private *priv) return 0; } -static int agp_ioctl(struct inode *inode, struct file *file, +static long agp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct agp_file_private *curr_priv = file->private_data; @@ -1058,7 +1058,7 @@ static const struct file_operations agp_fops = .llseek = no_llseek, .read = agp_read, .write = agp_write, - .ioctl = agp_ioctl, + .unlocked_ioctl = agp_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = compat_agp_ioctl, #endif