All of lore.kernel.org
 help / color / mirror / Atom feed
From: GOTO Masanori <gotom@debian.or.jp>
To: linux-fbdev-devel@lists.sourceforge.net
Cc: gotom@debian.or.jp
Subject: [PATCH] don't export fb.h internal structure to userland
Date: Tue, 04 Nov 2003 14:03:46 +0900	[thread overview]
Message-ID: <80n0bc913h.wl@oris.opensource.jp> (raw)

Hi,

This patch fixes not to compile with linux/fb.h:

	> cat fb.c
	#include <linux/fb.h>
	int main() {}
	> gcc fb.c
	In file included from /usr/include/linux/timer.h:5,
	                 from /usr/include/linux/workqueue.h:8,
	                 from /usr/include/linux/fb.h:5,
	                 from fb.c:1:
	/usr/include/linux/list.h:576:2: warning: #warning "don't include kernel headers in userspace"
	In file included from /usr/include/linux/timer.h:6,
	                 from /usr/include/linux/workqueue.h:8,
	                 from /usr/include/linux/fb.h:5,
	                 from fb.c:1:
	...

This sample program worked in kernel 2.4.  Actually this problem is
occured by (1) including workqueue.h, and (2) struct fb_pixmap has
spinlock_t.  This patch fixes with (1) move workqueue.h to internal of
__KERNEL__, (2) also move struct fb_pixmap to internal of __KERNEL__.
Now fb.h don't export kernel internal structure to userland.

Please apply it.

Regards,
-- gotom

--- include/linux/fb.h	2003-06-23 03:32:39.000000000 +0900
+++ include/linux/fb.h.new	2003-11-04 13:50:12.000000000 +0900
@@ -2,7 +2,6 @@
 #define _LINUX_FB_H
 
 #include <linux/tty.h>
-#include <linux/workqueue.h>
 #include <asm/types.h>
 #include <asm/io.h>
 
@@ -331,23 +330,11 @@
 #define FB_PIXMAP_IO      4     /* memory is iomapped       */
 #define FB_PIXMAP_SYNC    256   /* set if GPU can DMA       */
 
-struct fb_pixmap {
-        __u8  *addr;                      /* pointer to memory             */  
-	__u32 size;                       /* size of buffer in bytes       */
-	__u32 offset;                     /* current offset to buffer      */
-	__u32 buf_align;                  /* byte alignment of each bitmap */
-	__u32 scan_align;                 /* alignment per scanline        */
-	__u32 flags;                      /* see FB_PIXMAP_*               */
-					  /* access methods                */
-	void (*outbuf)(u8 *dst, u8 *addr, unsigned int size); 
-	u8   (*inbuf) (u8 *addr);
-	spinlock_t lock;                  /* spinlock                      */
-	atomic_t count;
-};
 #ifdef __KERNEL__
 
 #include <linux/fs.h>
 #include <linux/init.h>
+#include <linux/workqueue.h>
 
 struct fb_info;
 struct vm_area_struct;
@@ -395,6 +382,20 @@
     int (*fb_mmap)(struct fb_info *info, struct file *file, struct vm_area_struct *vma);
 };
 
+struct fb_pixmap {
+        __u8  *addr;                      /* pointer to memory             */  
+	__u32 size;                       /* size of buffer in bytes       */
+	__u32 offset;                     /* current offset to buffer      */
+	__u32 buf_align;                  /* byte alignment of each bitmap */
+	__u32 scan_align;                 /* alignment per scanline        */
+	__u32 flags;                      /* see FB_PIXMAP_*               */
+					  /* access methods                */
+	void (*outbuf)(u8 *dst, u8 *addr, unsigned int size); 
+	u8 (*inbuf) (u8 *addr);
+	spinlock_t lock;                  /* spinlock                      */
+	atomic_t count;
+};
+
 struct fb_info {
    int node;
    int flags;


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/

             reply	other threads:[~2003-11-04  5:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-04  5:03 GOTO Masanori [this message]
2003-11-05 15:55 ` [PATCH] don't export fb.h internal structure to userland GOTO Masanori

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=80n0bc913h.wl@oris.opensource.jp \
    --to=gotom@debian.or.jp \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /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.