diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2011-10-11 19:06:33 -0400 |
---|---|---|
committer | Wu Fengguang <fengguang.wu@intel.com> | 2011-10-11 05:45:24 -0400 |
commit | 50657fc4dfa7e345a1008f7c1de0bf930bbecca9 (patch) | |
tree | b1b1da53bc881b021635d9a43bad0047390485d2 /mm/page-writeback.c | |
parent | b00949aa2df9970a912bf060bc95e99da356881c (diff) |
writeback: fix ppc compile warnings on do_div(long long, unsigned long)
Fix powerpc compile warnings
mm/page-writeback.c: In function 'bdi_position_ratio':
mm/page-writeback.c:622:3: warning: comparison of distinct pointer types lacks a cast [enabled by default]
page-writeback.c:635:4: warning: comparison of distinct pointer types lacks a cast [enabled by default]
Also fix gcc "uninitialized var" warnings.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r-- | mm/page-writeback.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 325f753c80ed..0802d5177997 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
@@ -618,8 +618,8 @@ static unsigned long bdi_position_ratio(struct backing_dev_info *bdi, | |||
618 | x_intercept = bdi_setpoint + span; | 618 | x_intercept = bdi_setpoint + span; |
619 | 619 | ||
620 | if (bdi_dirty < x_intercept - span / 4) { | 620 | if (bdi_dirty < x_intercept - span / 4) { |
621 | pos_ratio *= x_intercept - bdi_dirty; | 621 | pos_ratio = div_u64(pos_ratio * (x_intercept - bdi_dirty), |
622 | do_div(pos_ratio, x_intercept - bdi_setpoint + 1); | 622 | x_intercept - bdi_setpoint + 1); |
623 | } else | 623 | } else |
624 | pos_ratio /= 4; | 624 | pos_ratio /= 4; |
625 | 625 | ||
@@ -630,10 +630,9 @@ static unsigned long bdi_position_ratio(struct backing_dev_info *bdi, | |||
630 | */ | 630 | */ |
631 | x_intercept = bdi_thresh / 2; | 631 | x_intercept = bdi_thresh / 2; |
632 | if (bdi_dirty < x_intercept) { | 632 | if (bdi_dirty < x_intercept) { |
633 | if (bdi_dirty > x_intercept / 8) { | 633 | if (bdi_dirty > x_intercept / 8) |
634 | pos_ratio *= x_intercept; | 634 | pos_ratio = div_u64(pos_ratio * x_intercept, bdi_dirty); |
635 | do_div(pos_ratio, bdi_dirty); | 635 | else |
636 | } else | ||
637 | pos_ratio *= 8; | 636 | pos_ratio *= 8; |
638 | } | 637 | } |
639 | 638 | ||
@@ -1010,10 +1009,10 @@ static void balance_dirty_pages(struct address_space *mapping, | |||
1010 | unsigned long dirty_thresh; | 1009 | unsigned long dirty_thresh; |
1011 | unsigned long bdi_thresh; | 1010 | unsigned long bdi_thresh; |
1012 | long pause = 0; | 1011 | long pause = 0; |
1013 | long max_pause; | 1012 | long uninitialized_var(max_pause); |
1014 | bool dirty_exceeded = false; | 1013 | bool dirty_exceeded = false; |
1015 | unsigned long task_ratelimit; | 1014 | unsigned long task_ratelimit; |
1016 | unsigned long dirty_ratelimit; | 1015 | unsigned long uninitialized_var(dirty_ratelimit); |
1017 | unsigned long pos_ratio; | 1016 | unsigned long pos_ratio; |
1018 | struct backing_dev_info *bdi = mapping->backing_dev_info; | 1017 | struct backing_dev_info *bdi = mapping->backing_dev_info; |
1019 | unsigned long start_time = jiffies; | 1018 | unsigned long start_time = jiffies; |