[PATCH] get_mm_hiwater_xxx: trivial, s/define/inline/
From: Oleg Nesterov
Date: Sat Jan 17 2009 - 22:42:23 EST
(sorry! forgot to save this patch)
Andrew pointed out get_mm_hiwater_xxx() evaluate "mm" argument thrice/twice,
make them inline.
Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
--- K-28/include/linux/sched.h~CLEANUP 2008-12-03 18:17:18.000000000 +0100
+++ K-28/include/linux/sched.h 2008-12-20 16:01:31.000000000 +0100
@@ -388,8 +388,15 @@ extern void arch_unmap_area_topdown(stru
(mm)->hiwater_vm = (mm)->total_vm; \
} while (0)
-#define get_mm_hiwater_rss(mm) max((mm)->hiwater_rss, get_mm_rss(mm))
-#define get_mm_hiwater_vm(mm) max((mm)->hiwater_vm, (mm)->total_vm)
+static inline unsigned long get_mm_hiwater_rss(struct mm_struct *mm)
+{
+ return max(mm->hiwater_rss, get_mm_rss(mm));
+}
+
+static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm)
+{
+ return max(mm->hiwater_vm, mm->total_vm);
+}
extern void set_dumpable(struct mm_struct *mm, int value);
extern int get_dumpable(struct mm_struct *mm);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/