[RFC PATCH 1/2] ARM: use generic strnlen_user and strncpy_from_user functions
will.deacon at arm.com
Fri Jun 8 11:43:34 EDT 2012
On Fri, Jun 08, 2012 at 04:38:54PM +0100, Will Deacon wrote:
> This patch implements the word-at-a-time interface for ARM using the
> same algorithm as x86. Although we have a clz instruction from ARMv5,
> this only saves us one mov instruction when building with Thumb-2 and
> makes no difference when targetting ARM, so we use the magic 0x0ff0001
> constant for all CPUs. For big-endian configurations, we use the
> implementation from asm-generic.
Damn, I forgot to update this comment. I decided that it was worth getting
rid of the mov since it's fairly clean using the fls macro, so we do emit
a clz instruction on ARMv5 and later.
More information about the linux-arm-kernel