lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m2vckw2km7.fsf@igel.home>
Date:	Thu, 19 Apr 2012 10:26:08 +0200
From:	Andreas Schwab <schwab@...ux-m68k.org>
To:	Andrew Morton 
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@...lic.gmane.org>
Cc:	"Aneesh Kumar K.V" 
	<aneesh.kumar-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@...lic.gmane.org>,
	linux-mm@...r.kernel.org, mgorman-l3A5Bk7waGM@...lic.gmane.org,
	kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@...lic.gmane.org,
	dhillf-Re5JQEeQqe8AvxtiuMwx3w@...lic.gmane.org,
	aarcange-H+wXaHxf7aLQT0dZR+AlfA@...lic.gmane.org,
	mhocko-AlSwsSmVLrQ@...lic.gmane.org,
	hannes-druUgvl0LCNAfugRpC6u6w@...lic.gmane.org,
	linux-kernel@...r.kernel.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@...lic.gmane.org,
	James Bottomley 
	<James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@...lic.gmane.org>
Subject: Re: [PATCH] memcg: Use scnprintf instead of sprintf

Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@...lic.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@...ux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ