linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build warnings after merge of the writeback tree
@ 2011-10-11  8:57 Stephen Rothwell
  2011-10-11  9:17 ` Wu Fengguang
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2011-10-11  8:57 UTC (permalink / raw)
  To: Wu Fengguang; +Cc: linux-next, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 648 bytes --]

Hi Wu,

After merging the writeback tree, today's linux-next build (powerpc
allnoconfig) produced these 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]

Introduced by commits 6c14ae1e92c7 ("writeback: dirty position control")
and 8927f66c4ede ("writeback: dirty position control - bdi reserve area").
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: build warnings after merge of the writeback tree
  2011-10-11  8:57 linux-next: build warnings after merge of the writeback tree Stephen Rothwell
@ 2011-10-11  9:17 ` Wu Fengguang
  2011-10-11  9:27   ` Stephen Rothwell
  0 siblings, 1 reply; 4+ messages in thread
From: Wu Fengguang @ 2011-10-11  9:17 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel

Hi Stephen,

On Tue, Oct 11, 2011 at 04:57:04PM +0800, Stephen Rothwell wrote:
> Hi Wu,
> 
> After merging the writeback tree, today's linux-next build (powerpc
> allnoconfig) produced these 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]
> 
> Introduced by commits 6c14ae1e92c7 ("writeback: dirty position control")
> and 8927f66c4ede ("writeback: dirty position control - bdi reserve area").

Ah sorry!  The below patch should fix it. Shall I update the original
commits in place, or append this patch as a new commit?

Thanks,
Fengguang
---

Subject: writeback: fix ppc compile warnings on do_div(long long, unsigned long)
Date: Tue Oct 11 17:06:33 CST 2011

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]

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
 mm/page-writeback.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

--- linux-next.orig/mm/page-writeback.c	2011-10-11 17:04:00.000000000 +0800
+++ linux-next/mm/page-writeback.c	2011-10-11 17:06:31.000000000 +0800
@@ -618,8 +618,8 @@ static unsigned long bdi_position_ratio(
 	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(
 	 */
 	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;
 	}
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: build warnings after merge of the writeback tree
  2011-10-11  9:17 ` Wu Fengguang
@ 2011-10-11  9:27   ` Stephen Rothwell
  2011-10-11  9:33     ` Wu Fengguang
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2011-10-11  9:27 UTC (permalink / raw)
  To: Wu Fengguang; +Cc: linux-next, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1666 bytes --]

Hi,

On Tue, 11 Oct 2011 17:17:25 +0800 Wu Fengguang <fengguang.wu@intel.com> wrote:
>
> On Tue, Oct 11, 2011 at 04:57:04PM +0800, Stephen Rothwell wrote:
> > 
> > After merging the writeback tree, today's linux-next build (powerpc
> > allnoconfig) produced these 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]
> > 
> > Introduced by commits 6c14ae1e92c7 ("writeback: dirty position control")
> > and 8927f66c4ede ("writeback: dirty position control - bdi reserve area").
> 
> Ah sorry!  The below patch should fix it. Shall I update the original
> commits in place, or append this patch as a new commit?

That choice is up to you as the maintainer of that tree.  Either works
for me (appending is easier for you and me, and the warning is not a
problem as far as bisection is concerned).

> 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]
> 
> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>

If you do keep it separate, you could add a

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>

above your SOB line.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: build warnings after merge of the writeback tree
  2011-10-11  9:27   ` Stephen Rothwell
@ 2011-10-11  9:33     ` Wu Fengguang
  0 siblings, 0 replies; 4+ messages in thread
From: Wu Fengguang @ 2011-10-11  9:33 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel

On Tue, Oct 11, 2011 at 05:27:36PM +0800, Stephen Rothwell wrote:
> Hi,
> 
> On Tue, 11 Oct 2011 17:17:25 +0800 Wu Fengguang <fengguang.wu@intel.com> wrote:
> >
> > On Tue, Oct 11, 2011 at 04:57:04PM +0800, Stephen Rothwell wrote:
> > > 
> > > After merging the writeback tree, today's linux-next build (powerpc
> > > allnoconfig) produced these 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]
> > > 
> > > Introduced by commits 6c14ae1e92c7 ("writeback: dirty position control")
> > > and 8927f66c4ede ("writeback: dirty position control - bdi reserve area").
> > 
> > Ah sorry!  The below patch should fix it. Shall I update the original
> > commits in place, or append this patch as a new commit?
> 
> That choice is up to you as the maintainer of that tree.  Either works
> for me (appending is easier for you and me, and the warning is not a
> problem as far as bisection is concerned).

Got it!

> > 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]
> > 
> > Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
> 
> If you do keep it separate, you could add a
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> 
> above your SOB line.

OK!

Thanks,
Fengguang

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-11  9:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-11  8:57 linux-next: build warnings after merge of the writeback tree Stephen Rothwell
2011-10-11  9:17 ` Wu Fengguang
2011-10-11  9:27   ` Stephen Rothwell
2011-10-11  9:33     ` Wu Fengguang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).