Re: [PATCH 02/21] memblock, numa: Introduce flag into memblock.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/24/2013 03:09 AM, Tejun Heo wrote:
Hello,

On Fri, Jul 19, 2013 at 03:59:15PM +0800, Tang Chen wrote:
+#define MEMBLK_FLAGS_DEFAULT	0x0	/* default flag */

Please don't do this.  Just clearing the struct as zero is enough.

@@ -439,12 +449,14 @@ repeat:
  int __init_memblock memblock_add_node(phys_addr_t base, phys_addr_t size,
  				       int nid)
  {
-	return memblock_add_region(&memblock.memory, base, size, nid);
+	return memblock_add_region(&memblock.memory, base, size,
+				   nid, MEMBLK_FLAGS_DEFAULT);

And just use zero for no flag.  Doing something like the above gets
weird with actual flags.  e.g. if you add a flag, say, MEMBLK_HOTPLUG,
should it be MEMBLK_FLAGS_DEFAULT | MEMBLK_HOTPLUG or just
MEMBLK_HOTPLUG?  If latter, the knowledge that DEFAULT is zero is
implicit, and, if so, why do it at all?

OK, will remove MEMBLK_FLAGS_DEFAULT, and use 0 by default.


+static int __init_memblock memblock_reserve_region(phys_addr_t base,
+						   phys_addr_t size,
+						   int nid,
+						   unsigned long flags)
  {
  	struct memblock_type *_rgn =&memblock.reserved;

-	memblock_dbg("memblock_reserve: [%#016llx-%#016llx] %pF\n",
+	memblock_dbg("memblock_reserve: [%#016llx-%#016llx] with flags %#016lx %pF\n",

Let's please drop "with" and do we really need to print full 16
digits?

Sure, will remove "with". But I think printing out the full flags is batter.
The output seems more tidy.


Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux