All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: David Airlie <airlied@linux.ie>,
	dri-devel <dri-devel@lists.sourceforge.net>
Cc: LKML <linux-kernel@vger.kernel.org>,
	linux-kbuild <linux-kbuild@vger.kernel.org>
Subject: BUG: via_drmclient.h is referenced but does not exist
Date: Sat, 13 Dec 2008 20:35:06 +0100	[thread overview]
Message-ID: <20081213193506.GA22969@uranus.ravnborg.org> (raw)

Hi David et al.

After improving the headers_check.pl script to do a
check for files included with:

	#include "foo.h"

it reported the following error:

/home/sam/kernel/knext.git/usr/include/drm/via_drm.h:34: included file '/home/sam/kernel/knext.git/usr/include/drm/via_drmclient.h' is not exported

And indeed the file via_drmclient.h does not exist in the kernel source.
We do not see any issue in the kernel as the include is guarded by:

#ifndef __KERNEL__
#include "via_drmclient.h"
#endif

But referring to a non-existing file is not the right thing to to.

We need this check as we have several places where we do:

	#include "foo.h"

in our exported headers.

So we need to fix drm somehow.

The headers_check.pl patch is included for reference.

	Sam

diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl
index 488a3b1..b97341e 100644
--- a/scripts/headers_check.pl
+++ b/scripts/headers_check.pl
@@ -32,7 +32,7 @@ foreach my $file (@files) {
 	$lineno = 0;
 	while ($line = <FH>) {
 		$lineno++;
-		check_include();
+		check_include($filename);
 	}
 	close FH;
 }
@@ -40,7 +40,8 @@ exit $ret;
 
 sub check_include
 {
-	if ($line =~ m/^\s*#\s*include\s+<((asm|linux).*)>/) {
+	my ($filename) = @_;
+	if ($line =~ m/^\s*#\s*include\s+<((asm|linux)[_a-zA-Z0-9\/.]+)>/) {
 		my $inc = $1;
 		my $found;
 		$found = stat($dir . "/" . $inc);
@@ -52,5 +53,18 @@ sub check_include
 			printf STDERR "$filename:$lineno: included file '$inc' is not exported\n";
 			$ret = 1;
 		}
+	} elsif ($line =~ m/^\s*#\s*include\s+"([_a-zA-Z0-9.]+)"/) {
+		my $inc = $1;
+		my $filedir = $filename;
+		my $found;
+
+		# drop filename part so we have only the dir part
+		$filedir =~ s/\/[_a-zA-Z0-9.]+$//;
+
+		$found = stat($filedir . "/" . $inc);
+		if (!$found) {
+			printf STDERR "$filename:$lineno: included file '$filedir/$inc' is not exported\n";
+			$ret = 1;
+		}
 	}
 }

             reply	other threads:[~2008-12-13 19:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-13 19:35 Sam Ravnborg [this message]
2008-12-14 15:57 ` BUG: via_drmclient.h is referenced but does not exist Thomas Hellström
2008-12-15 21:02   ` Sam Ravnborg
2008-12-15 21:26     ` Thomas Hellström
2008-12-15 21:51       ` Sam Ravnborg

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=20081213193506.GA22969@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.