summaryrefslogtreecommitdiffstats
path: root/mm/page-writeback.c
diff options
context:
space:
mode:
authorWu Fengguang <fengguang.wu@intel.com>2011-10-11 17:06:33 -0600
committerWu Fengguang <fengguang.wu@intel.com>2011-10-11 17:45:24 +0800
commit50657fc4dfa7e345a1008f7c1de0bf930bbecca9 (patch)
treeb1b1da53bc881b021635d9a43bad0047390485d2 /mm/page-writeback.c
parentb00949aa2df9970a912bf060bc95e99da356881c (diff)
downloadop-kernel-dev-50657fc4dfa7e345a1008f7c1de0bf930bbecca9.zip
op-kernel-dev-50657fc4dfa7e345a1008f7c1de0bf930bbecca9.tar.gz
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.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 325f753..0802d51 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,
x_intercept = bdi_setpoint + span;
if (bdi_dirty < x_intercept - span / 4) {
- pos_ratio *= x_intercept - bdi_dirty;
- do_div(pos_ratio, x_intercept - bdi_setpoint + 1);
+ pos_ratio = div_u64(pos_ratio * (x_intercept - bdi_dirty),
+ x_intercept - bdi_setpoint + 1);
} else
pos_ratio /= 4;
@@ -630,10 +630,9 @@ static unsigned long bdi_position_ratio(struct backing_dev_info *bdi,
*/
x_intercept = bdi_thresh / 2;
if (bdi_dirty < x_intercept) {
- if (bdi_dirty > x_intercept / 8) {
- pos_ratio *= x_intercept;
- do_div(pos_ratio, bdi_dirty);
- } else
+ if (bdi_dirty > x_intercept / 8)
+ pos_ratio = div_u64(pos_ratio * x_intercept, bdi_dirty);
+ else
pos_ratio *= 8;
}
@@ -1010,10 +1009,10 @@ static void balance_dirty_pages(struct address_space *mapping,
unsigned long dirty_thresh;
unsigned long bdi_thresh;
long pause = 0;
- long max_pause;
+ long uninitialized_var(max_pause);
bool dirty_exceeded = false;
unsigned long task_ratelimit;
- unsigned long dirty_ratelimit;
+ unsigned long uninitialized_var(dirty_ratelimit);
unsigned long pos_ratio;
struct backing_dev_info *bdi = mapping->backing_dev_info;
unsigned long start_time = jiffies;
OpenPOWER on IntegriCloud