- mtd-improve-parameter-parsing-for-block2mtd.patch removed from -mm tree

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

 



The patch titled

     mtd: improve parameter parsing for block2mtd

has been removed from the -mm tree.  Its filename is

     mtd-improve-parameter-parsing-for-block2mtd.patch

This patch was probably dropped from -mm because
it has now been merged into a subsystem tree or
into Linus's tree, or because it was folded into
its parent patch in the -mm tree.


From: Joern Engel <joern@xxxxxxxxxxxxxxxxxxxx>

Expand the parameter parsing for block2mtd.  It now accepts:
Ki, Mi, Gi	- the official prefixes for binary multiples,
		  see http://physics.nist.gov/cuu/Units/binary.html,
ki		- mistake on my side and analog to "k" for decimal multiples,
KiB, MiB, GiB	- for people that prefer to add a "B" for byte,
kiB		- combination of the above.

There were complaints about not accepting "k" for 1024.  This has long
been common practice, but is known to lead to confusion.  Hence the new
SI units and hence block2mtd only accepts units that cannot be confused
with decimal units.  Diverging from common practice doesn't always please
people, even if the change is for the better.

Signed-off-by: Joern Engel <joern@xxxxxxxxxxxxxxxxxxxx>
Cc: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/mtd/devices/block2mtd.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff -puN drivers/mtd/devices/block2mtd.c~mtd-improve-parameter-parsing-for-block2mtd drivers/mtd/devices/block2mtd.c
--- devel/drivers/mtd/devices/block2mtd.c~mtd-improve-parameter-parsing-for-block2mtd	2006-04-18 21:02:36.000000000 -0700
+++ devel-akpm/drivers/mtd/devices/block2mtd.c	2006-04-18 21:02:44.000000000 -0700
@@ -4,7 +4,7 @@
  * block2mtd.c - create an mtd from a block device
  *
  * Copyright (C) 2001,2002	Simon Evans <spse@xxxxxxxxxxxxx>
- * Copyright (C) 2004,2005	Jörn Engel <joern@xxxxxxxxxxxxxx>
+ * Copyright (C) 2004-2006	Jörn Engel <joern@xxxxxxxxxxxxxx>
  *
  * Licence: GPL
  */
@@ -351,6 +351,12 @@ devinit_err:
 }
 
 
+/* This function works similar to reguler strtoul.  In addition, it
+ * allows some suffixes for a more human-readable number format:
+ * ki, Ki, kiB, KiB	- multiply result with 1024
+ * Mi, MiB		- multiply result with 1024^2
+ * Gi, GiB		- multiply result with 1024^3
+ */
 static int ustrtoul(const char *cp, char **endp, unsigned int base)
 {
 	unsigned long result = simple_strtoul(cp, endp, base);
@@ -359,11 +365,16 @@ static int ustrtoul(const char *cp, char
 		result *= 1024;
 	case 'M':
 		result *= 1024;
+	case 'K':
 	case 'k':
 		result *= 1024;
 	/* By dwmw2 editorial decree, "ki", "Mi" or "Gi" are to be used. */
-		if ((*endp)[1] == 'i')
-			(*endp) += 2;
+		if ((*endp)[1] == 'i') {
+			if ((*endp)[2] == 'B')
+				(*endp) += 3;
+			else
+				(*endp) += 2;
+		}
 	}
 	return result;
 }
_

Patches currently in -mm which might be from joern@xxxxxxxxxxxxxxxxxxxx are

git-mtd.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" 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 FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux