Re: [PATCH] fix warnings from vgaarb.h

From: Randy Dunlap
Date: Wed Apr 04 2012 - 10:46:26 EST


On 04/04/2012 12:00 AM, Meelis Roos wrote:
Meelis Roos wrote:
in 3.4-rc1-144, I get the following warnings. Fix them by including
<linux/pci.h> to get struct pci_dev.

CC [M] drivers/gpu/drm/i915/intel_display.o
In file included from drivers/gpu/drm/i915/intel_display.c:33:0:
include/linux/vgaarb.h:66:9: warning: ‘struct pci_dev’ declared inside parameter list [enabled by default]

Or you could simply declare it:

struct pci_dev;

Right, but any actual user of vgaarb would still need real pci_dev
anyway. But yes, nothing in vgaarb.h uses pci_dev contents, so the
following also compiles without warnings:

-

in 3.4-rc1-144, I get several warnings like this

CC [M] drivers/gpu/drm/i915/intel_display.o
In file included from drivers/gpu/drm/i915/intel_display.c:33:0:
include/linux/vgaarb.h:66:9: warning: ‘struct pci_dev’ declared inside parameter list [enabled by default]

Fix them by forward declaring struct pci_dev:

Signed-off-by: Meelis Roos<mroos@xxxxxxxx>

diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index 9c3120d..b572f80 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -47,6 +47,8 @@
*/
#define VGA_DEFAULT_DEVICE (NULL)

+struct pci_dev;
+
/* For use by clients */

/**
'


Yes, I have sent this same patch at least 2 times, beginning on Jan-30-2012. And I cc-ed dri-devel mailing list and Dave Airlie
on it also.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/