On Tue, 2007-10-16 at 18:28 +0200, Bernhard Walle wrote:Could you give all of these 0's a name? I really hate seeing random magic numbers in these things. 0 completely kills the ability of someone to read the code and figure out what it is trying to do without going and looking at reserve_bootmem(). Or, alternatively, do something like this: -extern void reserve_bootmem(unsigned long addr, unsigned long size); +/* + * If flags is 0, then the return value is always 0 (success). If + * flags contains BOOTMEM_EXCLUSIVE, then -EBUSY is returned if the + * memory already was reserved. + */ +extern int reserve_bootmem(unsigned long addr, unsigned long size, int flag); +int reserve_bootmem(unsigned long addr, unsigned long size) +{ + /* the 0 is because we don't + return reserve_bootmem_exclusive(addr, size, 0); +} Where all of the existing callers stay the same. But, the ones wanting exclusive access actually call the _exclusive() variant. -- Dave -
| Peter Zijlstra | [RFC][PATCH 7/7] lockdep: spin_lock_nest_lock() |
| Gabriel C | Re: 2.6.24-rc2-mm1 |
| Andrew Morton | Re: [PATCH 2.6.21] cramfs: add cramfs Linear XIP |
| Jiri Kosina | Re: 2.6.21-rc5-mm4 |
git: | |
| Gregory Haskins | [RFC PATCH 00/17] virtual-bus |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
