Messages in this thread | | | From | Andreas Schwab <> | Subject | Re: [PATCH] memcg: Use scnprintf instead of sprintf | Date | Thu, 19 Apr 2012 10:26:08 +0200 |
| |
Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org> writes:
> diff -puN lib/string_helpers.c~lib-string_helpersc-make-arrays-static lib/string_helpers.c > --- a/lib/string_helpers.c~lib-string_helpersc-make-arrays-static > +++ a/lib/string_helpers.c > @@ -23,15 +23,15 @@ > 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, > };
You could even make them const, I think.
Andreas.
-- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
| |