Skip to content

Commit

Permalink
[PATCH] set_page_count() macro safety
Browse files Browse the repository at this point in the history
Fix set_page_count() macro to handle complex arguments.

Signed-off-by: Avishay Traeger <atraeger@cs.sunysb.edu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Avishay Traeger authored and Linus Torvalds committed Jan 9, 2006
1 parent aea47ff commit 152194a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ struct page {
*/
#define get_page_testone(p) atomic_inc_and_test(&(p)->_count)

#define set_page_count(p,v) atomic_set(&(p)->_count, v - 1)
#define set_page_count(p,v) atomic_set(&(p)->_count, (v) - 1)
#define __put_page(p) atomic_dec(&(p)->_count)

extern void FASTCALL(__page_cache_release(struct page *));
Expand Down

0 comments on commit 152194a

Please sign in to comment.