[merged] lib-bitmap-simplify-bitmap_parselist.patch removed from -mm tree

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

 



The patch titled
     Subject: lib: bitmap: simplify bitmap_parselist
has been removed from the -mm tree.  Its filename was
     lib-bitmap-simplify-bitmap_parselist.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
Subject: lib: bitmap: simplify bitmap_parselist

We want len to be the index of the first '\n', or the length of the string
if there is no newline.  This is a good example of the usefulness of
strchrnul().  Use that instead, thus eliminating a branch and a call to
strlen().

Signed-off-by: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 lib/bitmap.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff -puN lib/bitmap.c~lib-bitmap-simplify-bitmap_parselist lib/bitmap.c
--- a/lib/bitmap.c~lib-bitmap-simplify-bitmap_parselist
+++ a/lib/bitmap.c
@@ -665,13 +665,8 @@ static int __bitmap_parselist(const char
 
 int bitmap_parselist(const char *bp, unsigned long *maskp, int nmaskbits)
 {
-	char *nl  = strchr(bp, '\n');
-	int len;
-
-	if (nl)
-		len = nl - bp;
-	else
-		len = strlen(bp);
+	char *nl  = strchrnul(bp, '\n');
+	int len = nl - bp;
 
 	return __bitmap_parselist(bp, len, 0, maskp, nmaskbits);
 }
_

Patches currently in -mm which might be from linux@xxxxxxxxxxxxxxxxxx are

origin.patch
linux-next.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