mm/page-writeback.c: use min3/max3 macros to avoid shadow warnings
authorMark Rustad <mark.d.rustad@intel.com>
Thu, 9 Oct 2014 22:28:15 +0000 (15:28 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 10 Oct 2014 02:25:57 +0000 (22:25 -0400)
Nested calls to min/max functions result in shadow warnings in W=2 builds.
 Avoid the warning by using the min3 and max3 macros to get the min/max of
3 values instead of nested calls.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/page-writeback.c

index 91d73ef1744d6fbc5c4bbdf9782beb3b3e22da6b..35ca7102d421ee3bc49aab644f18b00ed1935153 100644 (file)
@@ -1075,13 +1075,13 @@ static void bdi_update_dirty_ratelimit(struct backing_dev_info *bdi,
        }
 
        if (dirty < setpoint) {
-               x = min(bdi->balanced_dirty_ratelimit,
-                        min(balanced_dirty_ratelimit, task_ratelimit));
+               x = min3(bdi->balanced_dirty_ratelimit,
+                        balanced_dirty_ratelimit, task_ratelimit);
                if (dirty_ratelimit < x)
                        step = x - dirty_ratelimit;
        } else {
-               x = max(bdi->balanced_dirty_ratelimit,
-                        max(balanced_dirty_ratelimit, task_ratelimit));
+               x = max3(bdi->balanced_dirty_ratelimit,
+                        balanced_dirty_ratelimit, task_ratelimit);
                if (dirty_ratelimit > x)
                        step = dirty_ratelimit - x;
        }