login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
February
»
8
Re: [PATCH] fix sparse warning from include/linux/mmzone.h
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From:
Harvey Harrison <harvey.harrison@...>
To: Linus Torvalds <torvalds@...>
Cc: Andrew Morton <akpm@...>, <viro@...>, <linux-kernel@...>, <mingo@...>
Subject:
Re: [PATCH] fix sparse warning from include/linux/mmzone.h
Date: Friday, February 8, 2008 - 6:17 pm
On Fri, 2008-02-08 at 14:04 -0800, Linus Torvalds wrote:
quoted text
> > On Fri, 8 Feb 2008, Andrew Morton wrote: > > > #ifdef CONFIG_HIGHMEM > > > - int zone_idx = zone - zone->zone_pgdat->node_zones; > > > - return zone_idx == ZONE_HIGHMEM || > > > - (zone_idx == ZONE_MOVABLE && zone_movable_is_highmem()); > > > + const int highmem_off = ZONE_HIGHMEM * sizeof(*zone); > > > + const int movable_off = ZONE_MOVABLE * sizeof(*zone); > > > + > > > + int zone_off = (unsigned long)zone - (unsigned long)zone->zone_pgdat->node_zones; > > > + return zone_off == highmem_off || > > > + (zone_off == movable_off && zone_movable_is_highmem()); > > > > hrm. For my i386 build (and that's where CONFIG_HIGHMEM really matters) > > this patch makes mm/page_alloc.o six bytes larger, and I don't think the > > change did much for readability. > > Heh, yeah. That's a very odd way to write it.
As long as you read 'odd' as 'rather dumb'
quoted text
> > It would probably make more sense to just write it as something like > > struct zone *base = zone->zone_pgdat->node_zones; > > if (zone == base + ZONE_HIGHMEM || > (zone == base + ZONE_MOVABLE && zone_movable_is_highmem());
s/if/return/ I think. And missing a closing brace. Unless I'm (again) missing something. Harvey --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[PATCH] fix sparse warning from include/linux/mmzone.h
, Harvey Harrison
, (Thu Feb 7, 4:52 pm)
Re: [PATCH] fix sparse warning from include/linux/mmzone.h
, Andrew Morton
, (Fri Feb 8, 5:51 pm)
Re: [PATCH] fix sparse warning from include/linux/mmzone.h
, Linus Torvalds
, (Fri Feb 8, 6:04 pm)
Re: [PATCH] fix sparse warning from include/linux/mmzone.h
, Harvey Harrison
, (Fri Feb 8, 6:38 pm)
Re: [PATCH] fix sparse warning from include/linux/mmzone.h
, Linus Torvalds
, (Fri Feb 8, 6:35 pm)
Re: [PATCH] fix sparse warning from include/linux/mmzone.h
, Harvey Harrison
, (Wed Feb 13, 3:56 pm)
[PATCH] remove sparse warning for mmzone.h
, Harvey Harrison
, (Wed Feb 13, 4:36 pm)
Re: [PATCH] fix sparse warning from include/linux/mmzone.h
, Ingo Molnar
, (Fri Feb 8, 6:26 pm)
Re: [PATCH] fix sparse warning from include/linux/mmzone.h
, Harvey Harrison
, (Fri Feb 8, 6:17 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Benjamin Herrenschmidt
Re: [PATCH] Remove process freezer from suspend to RAM pathway
Daniel Walker
Re: [Announce] [patch] Modular Scheduler Core and Completely Fair Scheduler [CFS]
Greg KH
[GIT PATCH] driver core patches against 2.6.24
Andrew Morton
-mm merge plans for 2.6.23
git
:
linux-netdev
:
David Miller
[GIT]: Networking
Hannes Eder
[PATCH 01/43] drivers/net/at1700.c: fix sparse warning: symbol shadows an earlier ...
Gerrit Renker
[PATCH 16/37] dccp: API to query the current TX/RX CCID
Herbert Xu
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
3 users
and
939 guests
online.
Online users
maheshdm
strcmp
howsellgold
Syndicate