dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH] vgaarb: Forward declaration of 'struct pci_dev'
Date: Tue,  3 Apr 2012 17:35:31 +0100	[thread overview]
Message-ID: <1333470931-6139-1-git-send-email-chris@chris-wilson.co.uk> (raw)

Under a minimalist configuration, it is possible for i915 to include
vgaarb.h without including any pci header before hand. Silence the
compiler by providing an opaque forward declaration of 'struct pci_dev'

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]
include/linux/vgaarb.h:66:9: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
include/linux/vgaarb.h:97:27: warning: ‘struct pci_dev’ declared inside parameter list [enabled by default]
include/linux/vgaarb.h:109:6: warning: ‘struct pci_dev’ declared inside parameter list [enabled by default]
include/linux/vgaarb.h: In function ‘vga_get_interruptible’:
include/linux/vgaarb.h:111:8: warning: passing argument 1 of ‘vga_get’ from incompatible pointer type [enabled by default]
include/linux/vgaarb.h:97:12: note: expected ‘struct pci_dev *’ but argument is of type ‘struct pci_dev *’
include/linux/vgaarb.h: At top level:
include/linux/vgaarb.h:121:8: warning: ‘struct pci_dev’ declared inside parameter list [enabled by default]
include/linux/vgaarb.h: In function ‘vga_get_uninterruptible’:
include/linux/vgaarb.h:123:8: warning: passing argument 1 of ‘vga_get’ from incompatible pointer type [enabled by default]
include/linux/vgaarb.h:97:12: note: expected ‘struct pci_dev *’ but argument is of type ‘struct pci_dev *’
include/linux/vgaarb.h: At top level:
include/linux/vgaarb.h:138:30: warning: ‘struct pci_dev’ declared inside parameter list [enabled by default]
include/linux/vgaarb.h:157:28: warning: ‘struct pci_dev’ declared inside parameter list [enabled by default]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 include/linux/vgaarb.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index 9c3120d..ddfb941 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -31,6 +31,7 @@
 #ifndef LINUX_VGA_H
 #define LINUX_VGA_H
 
+struct pci_dev;
 
 /* Legacy VGA regions */
 #define VGA_RSRC_NONE	       0x00
-- 
1.7.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

                 reply	other threads:[~2012-04-03 16:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1333470931-6139-1-git-send-email-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).