Skip to contentSkip to conversation

+ scripts-bloat-o-meter-use-startswith-rather-than-fragile-slicing.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Oct 31, 2013

lore
Share & tools
lore
#0 lore raw

Subject: + scripts-bloat-o-meter-use-startswith-rather-than-fragile-slicing.patch added to -mm tree
To: [email protected]
From: [email protected]
Date: Thu, 31 Oct 2013 14:20:34 -0700

The patch titled
Subject: scripts/bloat-o-meter: use .startswith rather than fragile slicing
has been added to the -mm tree. Its filename is
scripts-bloat-o-meter-use-startswith-rather-than-fragile-slicing.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/scripts-bloat-o-meter-use-startswith-rather-than-fragile-slicing.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/scripts-bloat-o-meter-use-startswith-rather-than-fragile-slicing.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Josh Triplett <[email protected]>
Subject: scripts/bloat-o-meter: use .startswith rather than fragile slicing

str.startswith has existed since at least Python 2.0, in 2000; use it rather than a fragile comparison against an initial slice of a string, which requires hard-coding the length of the string to compare against.

---

 scripts/bloat-o-meter |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/bloat-o-meter renamed from scripts/bloat-o-meter~scripts-bloat-o-meter-use-startswith-rather-than-fragile-slicing +1 -1
diff -puN scripts/bloat-o-meter~scripts-bloat-o-meter-use-startswith-rather-than-fragile-slicing scripts/bloat-o-meter
@@ -19,7 +19,7 @@ def getsizes(file):
         size, type, name = l[:-1].split()
         if type in "tTdDbBrR":
             # strip generated symbols
-            if name[:6] == "__mod_": continue
+            if name.startswith("__mod_"): continue
             if name == "linux_banner": continue
             # function names begin with '.' on 64-bit powerpc
             if "." in name[1:]: name = "static." + name.split(".")[0]

_

Patches currently in -mm which might be from [email protected] are

checkpatch-report-missing-spaces-around-trigraphs-with-strict.patch checkpatchpl-check-for-the-fsf-mailing-address.patch scripts-bloat-o-meter-ignore-changes-in-the-size-of-linux_banner.patch scripts-bloat-o-meter-use-startswith-rather-than-fragile-slicing.patch linux-next.patch