]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
lib/string_helpers.c: make arrays static
authorAndrew Morton <akpm@linux-foundation.org>
Wed, 25 Apr 2012 01:04:34 +0000 (11:04 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 30 Apr 2012 05:17:34 +0000 (15:17 +1000)
Moving these arrays into static storage shrinks the kernel a bit:

   text    data     bss     dec     hex filename
    723     112      64     899     383 lib/string_helpers.o
    516     272      64     852     354 lib/string_helpers.o

Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/string_helpers.c

index dd4ece372699e5b717626ff0a558d919a118d60e..1cffc223bff52b7e153dff043ae9149073050934 100644 (file)
 int string_get_size(u64 size, const enum string_size_units units,
                    char *buf, int len)
 {
-       const char *units_10[] = { "B", "kB", "MB", "GB", "TB", "PB",
+       static const char *units_10[] = { "B", "kB", "MB", "GB", "TB", "PB",
                                   "EB", "ZB", "YB", NULL};
-       const char *units_2[] = {"B", "KiB", "MiB", "GiB", "TiB", "PiB",
+       static const char *units_2[] = {"B", "KiB", "MiB", "GiB", "TiB", "PiB",
                                 "EiB", "ZiB", "YiB", NULL };
-       const char **units_str[] = {
+       static const char **units_str[] = {
                [STRING_UNITS_10] =  units_10,
                [STRING_UNITS_2] = units_2,
        };
-       const unsigned int divisor[] = {
+       static const unsigned int divisor[] = {
                [STRING_UNITS_10] = 1000,
                [STRING_UNITS_2] = 1024,
        };