[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1273803964.21352.380.camel@pasglop>
Date: Fri, 14 May 2010 12:26:04 +1000
From: Benjamin Herrenschmidt <benh@...nel.crashing.org>
To: Yinghai Lu <yinghai@...nel.org>
Cc: Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>,
David Miller <davem@...emloft.net>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>,
linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org
Subject: Re: [PATCH 08/35] x86,lmb: Add lmb_reserve_area/lmb_free_area
On Thu, 2010-05-13 at 17:19 -0700, Yinghai Lu wrote:
> #endif
> diff --git a/arch/x86/mm/lmb.c b/arch/x86/mm/lmb.c
> index 37a05e2..0dbe05b 100644
> --- a/arch/x86/mm/lmb.c
> +++ b/arch/x86/mm/lmb.c
> @@ -117,3 +117,30 @@ void __init lmb_to_bootmem(u64 start, u64 end)
> lmb.reserved.cnt = 0;
> }
> #endif
> +
> +void __init lmb_add_memory(u64 start, u64 end)
> +{
> + lmb_add_region(&lmb.memory, start, end - start);
> +}
I completely fail the point of doing such a minor argument conversion
as an exported function, with a naming that would cause certain
confusion with the existing lmb_add().
In any case, the above should be done at the call sites. Just call
lmb_add(start, end-start). You also aren't consistent since you do the
similar conversion using the _area suffix below, but not above.
> +void __init lmb_reserve_area(u64 start, u64 end, char *name)
> +{
> + if (start == end)
> + return;
> +
> + if (WARN_ONCE(start > end, "lmb_reserve_area: wrong range [%#llx, %#llx]\n", start, end))
> + return;
> +
> + lmb_add_region(&lmb.reserved, start, end - start);
> +}
You seem to be fond of gratuituous bloat...
> +void __init lmb_free_area(u64 start, u64 end)
> +{
> + if (start == end)
> + return;
> +
> + if (WARN_ONCE(start > end, "lmb_free_area: wrong range [%#llx, %#llx]\n", start, end))
> + return;
> +
> + lmb_free(start, end - start);
> +}
And here again.
If you -really- think there's value in the prototype conversions, then
make those _area() variants static inlines, group the well together in
the .h with a clear explanation saying something like "it's more
practical for some arch to use start/end rather than start/size".
I personally don't see why you are doing that tho.
Cheers,
Ben.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists