Alexey Dobriyan d5a572a4cb proc: calculate end pointer for /proc/*/* lookup at compile time
Compilers like to transform loops like

	for (i = 0; i < n; i++) {
		[use p[i]]
	}

into
	for (p = p0; p < end; p++) {
		...
	}

Do it by hand, so that it results in overall simpler loop
and smaller code.

Space savings:

	$ ./scripts/bloat-o-meter ../vmlinux-001 ../obj/vmlinux
	add/remove: 0/0 grow/shrink: 2/1 up/down: 4/-9 (-5)
	Function                                     old     new   delta
	proc_tid_base_lookup                          17      19      +2
	proc_tgid_base_lookup                         17      19      +2
	proc_pident_lookup                           179     170      -9

The same could be done to proc_pident_readdir(), but the code becomes
bigger for some reason.

[sfr@canb.auug.org.au: merge fix for proc_pident_lookup() API change]
  Link: http://lkml.kernel.org/r/20190131160135.4a8ae70b@canb.auug.org.au
Link: http://lkml.kernel.org/r/20190114200422.GB9680@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: James Morris <jmorris@namei.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Casey Schaufler <casey@schaufler-ca.com>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-03-12 10:04:01 -07:00
..
2019-03-12 10:04:01 -07:00
2019-03-09 10:54:24 -08:00
2018-08-21 23:54:17 -04:00
\n
2019-03-07 09:01:33 -08:00
2019-03-09 10:54:24 -08:00
2019-03-09 10:54:24 -08:00
2018-11-30 14:56:14 -08:00
2018-08-17 16:20:28 -07:00
2018-09-29 22:47:48 -04:00
2019-03-06 14:52:48 -08:00
2019-01-02 16:35:23 -08:00
2018-05-22 14:27:52 -04:00
2018-11-05 14:57:05 -05:00
2018-05-22 14:27:52 -04:00
2019-03-08 14:12:17 -08:00
2018-07-03 16:44:45 -04:00
2019-02-24 08:20:17 -07:00
2018-10-29 14:29:58 -07:00
2018-06-05 19:23:26 +02:00
2018-12-31 09:46:39 -08:00
2019-03-07 18:32:01 -08:00
2019-03-08 14:48:40 -08:00
2018-08-21 18:19:09 -07:00
2019-02-24 08:20:17 -07:00
2019-02-05 21:28:13 -05:00
2019-03-09 16:53:47 -08:00
2019-03-07 12:20:11 -08:00
2018-08-21 18:19:09 -07:00
2019-02-07 16:38:35 +01:00
2018-04-04 12:44:02 -07:00