linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Kevin Lawton <kevin@mandrakesoft.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: PATCH 2.4.0.10.6: wrapper.h cleanup
Date: Sun, 29 Oct 2000 22:09:49 -0500	[thread overview]
Message-ID: <39FCE67D.5847DF8@mandrakesoft.com> (raw)
In-Reply-To: <39FCE576.9425F7F5@mandrakesoft.com>

[-- Attachment #1: Type: text/plain, Size: 1988 bytes --]

Linus,

Attached is a patch against 2.4.0-test10-pre6.  I went the ultra-safe
route and put parentheses around every macro arg.  Compiles ok for me
here...

If you were wondering if we can remove wrapper.h altogether, IMHO no,
there are too many users (43) right now..

Changes:
	* add lots of parens
	* line up vm_xxx and mem_map_xxx nicely with tabs
	* remove unused:
		wait_handle
		file_handle
		inode_handle
		select_table_handle
		vm_area_handle
		connect_wrapper
		current_got_fatal_signal
		current_set_timeout
		module_interruptible_sleep_on
		module_select_wait
		module_wake_up
		module_register_chrdev
		module_unregister_chrdev
		module_register_blkdev
		module_unregister_blkdev
		inode_get_rdev
		file_get_flags
		mem_map_inc_count
		mem_map_dec_count

-- 
Jeff Garzik             | "Mind if I drive?"  -Sam
Building 1024           | "Not if you don't mind me clawing at the
MandrakeSoft            |  dash and shrieking like a cheerleader."
                        |                     -Max

Kevin Lawton wrote:
> 
> Listed in 2.4 headers as:
> 
>         #define mem_map_reserve(p) set_bit(PG_reserved, &p->flags)
>         #define mem_map_unreserve(p) clear_bit(PG_reserved, &p->flags)
> 
> ...but should be:
> 
>         #define mem_map_reserve(p) set_bit(PG_reserved, &((p)->flags))
>         #define mem_map_unreserve(p) clear_bit(PG_reserved, &((p)->flags))
> 
> Because of the 'void *' nature of the 2nd parameter to set_bit/clear_bit,
> the compiler is not picking up this error.  Either expression generates
> a pointer, but not the same values.
> 
> Might as well also wrap the parameter 'p' with parentheses in the
> subsequent macros, mem_map_inc_count() and mem_map_dec_count(),
> for clarity.
> 
> CC me if needed.  I'm not on this list.
> 
> -Kevin Lawton
> Plex86 project
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> Please read the FAQ at http://www.tux.org/lkml/

[-- Attachment #2: wrapper-2.4.0.10.6.patch --]
[-- Type: text/plain, Size: 2048 bytes --]

Index: include/linux/wrapper.h
===================================================================
RCS file: /cvsroot/gkernel/linux_2_4/include/linux/wrapper.h,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 wrapper.h
--- include/linux/wrapper.h	2000/10/22 21:00:45	1.1.1.3
+++ include/linux/wrapper.h	2000/10/30 03:07:00
@@ -1,36 +1,14 @@
 #ifndef _WRAPPER_H_
 #define _WRAPPER_H_
-#define wait_handle struct wait_queue
-#define file_handle struct file
-#define inode_handle struct inode
-#define select_table_handle select_table
-#define vm_area_handle struct vm_area_struct
 
-#define connect_wrapper(x) 0
-#define current_got_fatal_signal() (signal_pending(current))
-#define current_set_timeout(val) current->timeout = val
+#define vma_set_inode(v,i)	((v)->vm_inode = (i))
+#define vma_get_flags(v)	((v)->vm_flags)
+#define vma_get_pgoff(v)	((v)->vm_pgoff)
+#define vma_get_start(v)	((v)->vm_start)
+#define vma_get_end(v)		((v)->vm_end)
+#define vma_get_page_prot(v)	((v)->vm_page_prot)
 
-#define module_interruptible_sleep_on interruptible_sleep_on
-#define module_wake_up wake_up
-#define module_select_wait select_wait
-#define module_register_chrdev register_chrdev
-#define module_unregister_chrdev unregister_chrdev
-#define module_register_blkdev register_blkdev
-#define module_unregister_blkdev unregister_blkdev
+#define mem_map_reserve(p)	set_bit(PG_reserved, &((p)->flags))
+#define mem_map_unreserve(p)	clear_bit(PG_reserved, &((p)->flags))
 
-#define inode_get_rdev(i) i->i_rdev
-
-#define file_get_flags(f) f->f_flags
-
-#define vma_set_inode(v,i) v->vm_inode = i
-#define vma_get_flags(v) v->vm_flags
-#define vma_get_pgoff(v) v->vm_pgoff
-#define vma_get_start(v) v->vm_start
-#define vma_get_end(v) v->vm_end
-#define vma_get_page_prot(v) v->vm_page_prot
-
-#define mem_map_reserve(p) set_bit(PG_reserved, &p->flags)
-#define mem_map_unreserve(p) clear_bit(PG_reserved, &p->flags)
-#define mem_map_inc_count(p) atomic_inc(&(p->count))
-#define mem_map_dec_count(p) atomic_dec(&(p->count))
-#endif
+#endif /* _WRAPPER_H_ */

      reply	other threads:[~2000-10-30  3:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-30  3:05 bug fix for 'include/linux/wrapper.h', bad parentheses for macros Kevin Lawton
2000-10-30  3:09 ` Jeff Garzik [this message]

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=39FCE67D.5847DF8@mandrakesoft.com \
    --to=jgarzik@mandrakesoft.com \
    --cc=kevin@mandrakesoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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).