lib: Sparc's strncpy_from_user is generic enough, move under
 lib/

To use this, an architecture simply needs to:

1) Provide a user_addr_max() implementation via asm/uaccess.h

2) Add "select GENERIC_STRNCPY_FROM_USER" to their arch Kcnfig

3) Remove the existing strncpy_from_user() implementation and symbol
   exports their architecture had.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: David Howells <dhowells@redhat.com>

Change-Id: I113bbf7db40a27b610925367cbfddf48412b8c71
lib: add generic strnlen_user() function

This adds a new generic optimized strnlen_user() function that uses the
<asm/word-at-a-time.h> infrastructure to portably do efficient string
handling.

In many ways, strnlen is much simpler than strncpy, and in particular we
can always pre-align the words we load from memory.  That means that all
the worries about alignment etc are a non-issue, so this one can easily
be used on any architecture.  You obviously do have to do the
appropriate word-at-a-time.h macros.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Change-Id: I0eac12491667cf48e561be7d52d66c22c3e9c1bd
kernel: Move REPEAT_BYTE definition into linux/kernel.h

And make sure that everything using it explicitly includes
that header file.

Signed-off-by: David S. Miller <davem@davemloft.net>

Change-Id: I090f97b1ca96cbe58f64de8a89982e042a31247f
Merge "lib: Sparc's strncpy_from_user is generic enough, move under  lib/" into cm-10.2
Merge "lib: add generic strnlen_user() function" into cm-10.2
Merge "kernel: Move REPEAT_BYTE definition into linux/kernel.h" into cm-10.2