From: David S. Miller Date: Thu, 24 May 2012 02:20:20 +0000 (-0700) Subject: sparc: Optimize strncpy_from_user() zero byte search. X-Git-Tag: v3.5-rc1~90^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4efcac3a244de86593a82ca4ed945e839eb4c5af;p=pandora-kernel.git sparc: Optimize strncpy_from_user() zero byte search. Compute a mask that will only have 0x80 in the bytes which had a zero in them. The formula is: ~(((x & 0x7f7f7f7f) + 0x7f7f7f7f) | x | 0x7f7f7f7f) In the inner word iteration, we have to compute the "x | 0x7f7f7f7f" part, so we can reuse that in the above calculation. Once we have this mask, we perform divide and conquer to find the highest 0x80 location. Signed-off-by: David S. Miller --- Reading git-diff-tree failed