]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/linux/swap.h
include/linux/swap.h: use offsetof() instead of custom __swapoffset macro
[linux.git] / include / linux / swap.h
index fc50e21b3b88e64a450477f6d595eabb18732522..4bfb5c4ac108d40d95fd0a471b7dd0f1954d4cf4 100644 (file)
@@ -157,9 +157,9 @@ struct swap_extent {
 /*
  * Max bad pages in the new format..
  */
-#define __swapoffset(x) ((unsigned long)&((union swap_header *)0)->x)
 #define MAX_SWAP_BADPAGES \
-       ((__swapoffset(magic.magic) - __swapoffset(info.badpages)) / sizeof(int))
+       ((offsetof(union swap_header, magic.magic) - \
+         offsetof(union swap_header, info.badpages)) / sizeof(int))
 
 enum {
        SWP_USED        = (1 << 0),     /* is slot in swap_info[] used? */