[PATCH 3/3] lib: lzo: Improves decompression performance

2020-11-09 Thread zengzhaoxiu
From: Zhaoxiu Zeng This patch does: 1. Cleanup code 2. Use the copy_from_back to copy the matched bytes from the back output buffer I testd on 5.8.18-300.fc33.x86_64. The performance of the lzo1x_decompress_safe function is improved by about 5%. If no CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS featu

[PATCH 2/3] lib: zlib_inflate: improves decompression performance

2020-11-09 Thread zengzhaoxiu
From: Zhaoxiu Zeng This patch does: 1. Cleanup code and reduce branches 2. Use copy_from_back to copy the matched bytes from the back output buffer I tested on 5.8.18-300.fc33.x86_64. The performance of function zlib_inflate is improved by about 7%. If the CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS

[PATCH 1/3] lib: Introduce copy_from_back()

2020-11-09 Thread zengzhaoxiu
From: Zhaoxiu Zeng Copying the matched bytes from the back output buffer is the key code of the LZ decompression algorithm which used by zlib, lzo, etc. This patch introduce the optimized copy_from_back function. The function will be used by later patches in this series. Optimization for a spec

[patch V4 27/31] serial: use parity8 in max3100

2016-06-29 Thread zengzhaoxiu
From: Zhaoxiu Zeng Use parity8(c) instead "hweight8(c) & 1" to improve readability, and improve performance on some CPUs that without popcount support. Signed-off-by: Zhaoxiu Zeng --- drivers/tty/serial/max3100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/s

[patch V4 30/31] crypto: use parity_long in sahara.c

2016-06-29 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/crypto/sahara.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c index c3f3d89..5c44a15 100644 --- a/drivers/crypto/sahara.c +++ b/drivers/crypto/sahara.c @@ -783,7 +7

[PATCH 2/2] lib: kstrtox: _parse_integer: use hex_to_bin instead local conversion, and reduce branches

2016-06-29 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- lib/kstrtox.c | 22 +- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/lib/kstrtox.c b/lib/kstrtox.c index d8a5cf6..70d3374 100644 --- a/lib/kstrtox.c +++ b/lib/kstrtox.c @@ -48,38 +48,26 @@ unsigned int _pars

[PATCH 1/2] lib: hexdump: use a look-up table to do hex_to_bin

2016-06-29 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- include/linux/kernel.h | 15 ++- lib/hexdump.c | 36 +++- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 94aa10f..72a04

[patch V4 09/31] bitops: Add x86-specific parity functions

2016-06-29 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- arch/x86/include/asm/arch_parity.h | 60 ++ arch/x86/include/asm/bitops.h | 4 ++- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 arch/x86/include/asm/arch_parity.h diff --git a/a

[patch V4 27/31] serial: use parity8 in max3100

2016-06-29 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng Acked-by: Greg Kroah-Hartman --- drivers/tty/serial/max3100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index 5c4c280..a0cc84a 100644 --- a/drivers/tty/serial/ma

[patch V4 05/31] bitops: Add ia64-specific parity functions

2016-06-29 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- arch/ia64/include/asm/bitops.h | 31 +++ 1 file changed, 31 insertions(+) diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h index 71e8145..041d1d6 100644 --- a/arch/ia64/include/asm/bitops

[patch V4 13/31] media: use parity8 in vivid-vbi-gen.c

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/media/platform/vivid/vivid-vbi-gen.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/vivid/vivid-vbi-gen.c b/drivers/media/platform/vivid/vivid-vbi-gen.c index a2159de..d5ba0fc 100644

[patch V4 19/31] mtd: use parity16 in ssfdc

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Use parity16 to do the odd parity checking, and rearrange the code. Signed-off-by: Zhaoxiu Zeng --- drivers/mtd/ssfdc.c | 31 --- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/drivers/mtd/ssfdc.c b/drivers/mtd/ssfdc.c index daf82b

[patch V4 29/31] ethernet: use parity8 in broadcom/tg3.c

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng Acked-by: Siva Reddy Kallam --- drivers/net/ethernet/broadcom/tg3.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 3010080..802a429 100644 -

[patch V4 31/31] edac: use parity8 in amd64_edac.c

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/edac/amd64_edac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index d87a475..8727ae5 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@

[patch V4 30/31] crypto: use parity_long is sahara.c

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/crypto/sahara.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c index c3f3d89..5c44a15 100644 --- a/drivers/crypto/sahara.c +++ b/drivers/crypto/sahara.c @@ -783,7 +7

[patch V4 26/31] iio: use parity32 in adxrs450

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng Acked-by: Jonathan Cameron --- drivers/iio/gyro/adxrs450.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/gyro/adxrs450.c b/drivers/iio/gyro/adxrs450.c index a330d42..307f55b 100644 --- a/drivers/iio/gyro/adxrs

[patch V4 23/31] ethernet: use parity8 in sun/niu.c

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng Acked-by: Michal Nazarewicz --- drivers/net/ethernet/sun/niu.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index 9cc4564..8c344ef 100644 --- a/drive

[patch V4 24/31] input: use parity8 in pcips2

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng Acked-by: Dmitry Torokhov --- drivers/input/serio/pcips2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/serio/pcips2.c b/drivers/input/serio/pcips2.c index e862c6e..a51e7f0 100644 --- a/drivers/input/serio/pcip

[patch V4 28/31] input: use parity8 in elantech

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Remove the parity lookup table, use parity8 instead. Signed-off-by: Zhaoxiu Zeng Acked-by: Dmitry Torokhov --- drivers/input/mouse/elantech.c | 10 +++--- drivers/input/mouse/elantech.h | 1 - 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/input

[patch V4 25/31] input: use parity8 in sa1111ps2

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng Acked-by: Dmitry Torokhov --- drivers/input/serio/saps2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/serio/saps2.c b/drivers/input/serio/saps2.c index b3e6889..324b193 100644 --- a/drivers/input/s

[patch V4 22/31] mtd: use parity16 in sm_ftl

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/mtd/sm_ftl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c index b096f8b..345ff1a 100644 --- a/drivers/mtd/sm_ftl.c +++ b/drivers/mtd/sm_ftl.c @@ -136,7 +136,7 @@ st

[patch V4 21/31] crypto: use parity functions in qat_hal

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/crypto/qat/qat_common/qat_hal.c | 32 ++-- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/drivers/crypto/qat/qat_common/qat_hal.c b/drivers/crypto/qat/qat_common/qat_hal.c index 1e480f1..318

[patch V4 27/31] serial: use parity32 in max3100

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng Acked-by: Greg Kroah-Hartman --- drivers/tty/serial/max3100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index 5c4c280..a0cc84a 100644 --- a/drivers/tty/serial/ma

[patch V4 10/31] sunrpc: use parity8

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- net/sunrpc/auth_gss/gss_krb5_keys.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/net/sunrpc/auth_gss/gss_krb5_keys.c b/net/sunrpc/auth_gss/gss_krb5_keys.c index 8701331..c41b389 100644 --- a/net/sunrpc/auth_gss/gss_

[patch V4 20/31] mtd: use parity functions in inftlcore

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/mtd/inftlcore.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c index b66b541..8c9457b 100644 --- a/drivers/mtd/inftlcore.c +++ b/drivers/mtd/inftl

[patch V4 15/31] input: use parity32 in grip_mp

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng Acked-by: Dmitry Torokhov --- drivers/input/joystick/grip_mp.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/input/joystick/grip_mp.c b/drivers/input/joystick/grip_mp.c index 573191d..3e29eb1 100644 -

[patch V4 18/31] scsi: use parity32 in isci's phy

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/scsi/isci/phy.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/scsi/isci/phy.c b/drivers/scsi/isci/phy.c index cb87b2e..a06aff6 100644 --- a/drivers/scsi/isci/phy.c +++ b/drivers/scsi/isci/ph

[patch V4 17/31] input: use parity16 in ams_delta_serio

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng Acked-by: Dmitry Torokhov --- drivers/input/serio/ams_delta_serio.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c index 45887e3..85459b3 1

[patch V4 16/31] input: use parity64 in sidewinder

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng Acked-by: Dmitry Torokhov --- drivers/input/joystick/sidewinder.c | 24 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c index 4a95b2

[patch V4 14/31] media: use parity functions in saa7115

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/media/i2c/saa7115.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c index d2a1ce2..4c22df8 100644 --- a/drivers/media/i2c/saa7115.c +++ b/d

[patch V4 12/31] lib: bch: use parity32

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- lib/bch.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/bch.c b/lib/bch.c index bc89dfe4..6c6e8d4 100644 --- a/lib/bch.c +++ b/lib/bch.c @@ -278,18 +278,6 @@ static inline int deg(unsigned int poly)

[patch V4 09/31] bitops: Add x86-specific parity functions

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Use alternatives, lifted from arch_hweight Signed-off-by: Zhaoxiu Zeng --- arch/x86/include/asm/arch_hweight.h | 5 ++ arch/x86/include/asm/arch_parity.h | 117 arch/x86/include/asm/bitops.h | 4 +- 3 files changed, 125 inserti

[patch V4 11/31] mips: use parity functions in cerr-sb1.c

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- arch/mips/mm/cerr-sb1.c | 67 + 1 file changed, 17 insertions(+), 50 deletions(-) diff --git a/arch/mips/mm/cerr-sb1.c b/arch/mips/mm/cerr-sb1.c index ee5c1ff..2e7d660 100644 --- a/arch/mips/mm/c

[patch V4 02/31] bitops: Include generic parity.h in some architectures' bitops.h

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Simply use the generic version. Signed-off-by: Zhaoxiu Zeng Acked-by: Hans-Christian Noren Egtvedt [for avr32] --- arch/arc/include/asm/bitops.h | 1 + arch/arm/include/asm/bitops.h | 1 + arch/arm64/include/asm/bitops.h| 1 + arch/avr32/include/asm/bitops.h

[patch V4 08/31] bitops: Add sparc-specific parity functions

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Use runtime patching for sparc64, lifted from hweight Signed-off-by: Zhaoxiu Zeng --- arch/sparc/include/asm/bitops_32.h | 1 + arch/sparc/include/asm/bitops_64.h | 18 ++ arch/sparc/kernel/sparc_ksyms_64.c | 6 ++ arch/sparc/lib/Makefile| 2 +- arch/s

[patch V4 07/31] bitops: Add powerpc-specific parity functions

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Use runtime patching for ppc64, lifted from hweight_64 Signed-off-by: Zhaoxiu Zeng --- arch/powerpc/include/asm/bitops.h | 11 +++ arch/powerpc/lib/Makefile | 2 +- arch/powerpc/lib/parity_64.S | 143 ++ arch/powerpc/lib/pp

[patch V4 06/31] bitops: Tile and MIPS (if has usable __builtin_popcount) use popcount parity functions

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng Acked-by: Chris Metcalf [for tile] --- arch/mips/include/asm/bitops.h | 7 +++ arch/tile/include/asm/bitops.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h index ce9666c.

[patch V4 05/31] bitops: Add ia-specific parity functions

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- arch/ia64/include/asm/bitops.h | 31 +++ 1 file changed, 31 insertions(+) diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h index 71e8145..041d1d6 100644 --- a/arch/ia64/include/asm/bitops

[patch V4 04/31] bitops: Add blackfin-specific parity functions

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- arch/blackfin/include/asm/bitops.h | 31 +++ 1 file changed, 31 insertions(+) diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h index b298b65..6609b7e 100644 --- a/arch/blackfin/i

[patch V4 03/31] bitops: Add alpha-specific parity functions

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng Acked-by: Richard Henderson --- arch/alpha/include/asm/bitops.h | 27 +++ 1 file changed, 27 insertions(+) diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h index 4bdfbd4..95a43fa 100644 --- a/

[patch V4 01/31] bitops: add parity functions

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng Add generic parity functions, adapted from "https://graphics.stanford.edu/~seander/bithacks.html#ParityParallel";. The function parityN returns whether an odd or even number of bits are on in a N-bit word. Signed-off-by: Zhaoxiu Zeng --- include/asm-generic/bitops.h

[patch V4 00/31] bitops: add parity functions

2016-05-11 Thread zengzhaoxiu
From: Zhaoxiu Zeng When I do "grep parity -r linux", I found many parity calculations distributed in many drivers. This patch series does: 1. provide generic and architecture-specific parity calculations 2. remove drivers' local parity calculations, use bitops' parity functions instead

[patch V4] lib: GCD: Use binary GCD algorithm instead of Euclidean

2016-05-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng The binary GCD algorithm is based on the following facts: 1. If a and b are all evens, then gcd(a,b) = 2 * gcd(a/2, b/2) 2. If a is even and b is odd, then gcd(a,b) = gcd(a/2, b) 3. If a and b are all odds, then gcd(a,b) = gcd((a-b)/2, b) = gcd((a+b)/2,

[patch V3] lib: GCD: add binary GCD algorithm

2016-04-28 Thread zengzhaoxiu
From: Zhaoxiu Zeng Because some architectures (alpha, armv6, etc.) don't provide hardware division, the mod operation is slow! Binary GCD algorithm uses simple arithmetic operations, it replaces division with arithmetic shifts, comparisons, and subtractions. I have compiled successfully with x8

[patch V2] lib: GCD: add binary GCD algorithm

2016-04-27 Thread zengzhaoxiu
From: Zhaoxiu Zeng Because some architectures (alpha, armv6, etc.) don't provide hardware division, the mod operation is slow! Binary GCD algorithm uses simple arithmetic operations, it replaces division with arithmetic shifts, comparisons, and subtraction. I have compiled successfully with x86

[PATCH] media: tuner: mt2063: use lib gcd

2016-04-27 Thread zengzhaoxiu
From: Zhaoxiu Zeng This patch removes the local MT2063_gcd function, uses lib gcd instead Signed-off-by: Zhaoxiu Zeng --- drivers/media/tuners/mt2063.c | 30 +- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/drivers/media/tuners/mt2063.c b/drivers/me

[PATCH V3] blackfin: optimize ffz, __ffs, ffs, __fls, and fls functions

2016-04-15 Thread zengzhaoxiu
From: Zeng Zhaoxiu blackfin has popcount instruction (ONES), we can do the efficient computing (ffz, __ffs, ffs, __fls, and fls) use this instruction. Adapted from "https://en.wikipedia.org/wiki/Find_first_set"; and arch/ia64/include/asm/bitops.h. Changes to V2: - Fix build errors Changes to V

[PATCH V2] blackfin: optimize ffz, __ffs, ffs, __fls, and fls functions

2016-04-15 Thread zengzhaoxiu
From: Zhaoxiu Zeng blackfin has popcount instruction (ONES), we can do the efficient computing (ffz, __ffs, ffs, __fls, and fls) use this instruction. Adapted from "https://en.wikipedia.org/wiki/Find_first_set"; and arch/ia64/include/asm/bitops.h. Changes to V1: - Use hweight32 instead __arch_h

[PATCH] blackfin: optimize ffz, __ffs, ffs, __fls, and fls functions

2016-04-15 Thread zengzhaoxiu
From: Zhaoxiu Zeng blackfin has popcount instruction (ONES), we can do the efficient computing (ffz, __ffs, ffs, __fls, and fls) use this instruction. Adapted from "https://en.wikipedia.org/wiki/Find_first_set"; and arch/ia64/include/asm/bitops.h. Signed-off-by: Zhaoxiu Zeng --- arch/blackfin

[PATCH V3 00/29] bitops: add parity functions

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng When I do "grep parity -r linux", I found many parity calculations distributed in many drivers. This patch series does: 1. provide generic and architecture-specific parity calculations 2. remove drivers' local parity calculations, use bitops' parity functions instead

[PATCH V3 14/29] media: use parity functions in saa7115

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/media/i2c/saa7115.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c index d2a1ce2..4c22df8 100644 --- a/drivers/media/i2c/saa7115.c +++ b/d

[PATCH V3 27/29] serial: use parity32 in max3100

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/tty/serial/max3100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index 5c4c280..a0cc84a 100644 --- a/drivers/tty/serial/max3100.c +++ b/drivers/tty/seri

[PATCH V3 19/29] mtd: use parity16 in ssfdc

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng The original get_parity return even parity of the input number. So hweight of "block_address & 0x7ff" must be odd if block_address is valid. This patch use parity16, and rearrange the code. Signed-off-by: Zhaoxiu Zeng --- drivers/mtd/ssfdc.c | 31 ---

[PATCH V3 29/29] ethernet: use parity8 in broadcom/tg3.c

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/net/ethernet/broadcom/tg3.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 3010080..802a429 100644 --- a/drivers/net/ethernet/bro

[PATCH V3 28/29] input: use parity8 in elantech

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Remove the even parity table, use parity8 instead. Signed-off-by: Zhaoxiu Zeng --- drivers/input/mouse/elantech.c | 10 +++--- drivers/input/mouse/elantech.h | 1 - 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/input/mouse/elantech.c b/drivers/i

[PATCH V3 24/29] input: use parity8 in pcips2

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/input/serio/pcips2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/serio/pcips2.c b/drivers/input/serio/pcips2.c index e862c6e..a51e7f0 100644 --- a/drivers/input/serio/pcips2.c +++ b/drivers/input/se

[PATCH V3 23/29] ethernet: use parity8 in sun/niu.c

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/net/ethernet/sun/niu.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index 9cc4564..8c344ef 100644 --- a/drivers/net/ethernet/sun/niu.c +++

[PATCH V3 22/29] mtd: use parity16 in sm_ftl

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/mtd/sm_ftl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c index b096f8b..345ff1a 100644 --- a/drivers/mtd/sm_ftl.c +++ b/drivers/mtd/sm_ftl.c @@ -136,7 +136,7 @@ st

[PATCH V3 25/29] input: use parity8 in sa1111ps2

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/input/serio/saps2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/serio/saps2.c b/drivers/input/serio/saps2.c index b3e6889..324b193 100644 --- a/drivers/input/serio/saps2.c +++ b/driv

[PATCH V3 26/29] iio: use parity32 in adxrs450

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/iio/gyro/adxrs450.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/gyro/adxrs450.c b/drivers/iio/gyro/adxrs450.c index a330d42..307f55b 100644 --- a/drivers/iio/gyro/adxrs450.c +++ b/drivers/iio/gyro

[PATCH V3 20/29] mtd: use parity functions in inftlcore

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/mtd/inftlcore.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c index b66b541..8c9457b 100644 --- a/drivers/mtd/inftlcore.c +++ b/drivers/mtd/inftl

[PATCH V3 21/29] crypto: use parity functions in qat_hal

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/crypto/qat/qat_common/qat_hal.c | 32 ++-- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/drivers/crypto/qat/qat_common/qat_hal.c b/drivers/crypto/qat/qat_common/qat_hal.c index 1e480f1..318

[PATCH V3 02/29] Include generic parity.h in some architectures' bitops.h

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- arch/arc/include/asm/bitops.h | 1 + arch/arm/include/asm/bitops.h | 1 + arch/arm64/include/asm/bitops.h| 1 + arch/avr32/include/asm/bitops.h| 1 + arch/c6x/include/asm/bitops.h | 1 + arch/cris/include/asm/bitops.h

[PATCH V3 18/29] scsi: use parity32 in isci's phy

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/scsi/isci/phy.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/scsi/isci/phy.c b/drivers/scsi/isci/phy.c index cb87b2e..a06aff6 100644 --- a/drivers/scsi/isci/phy.c +++ b/drivers/scsi/isci/ph

[PATCH V3 15/29] input: use parity32 in grip_mp

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/input/joystick/grip_mp.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/input/joystick/grip_mp.c b/drivers/input/joystick/grip_mp.c index 573191d..3e29eb1 100644 --- a/drivers/input/joystick

[PATCH V3 10/29] sunrpc: use parity8

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- net/sunrpc/auth_gss/gss_krb5_keys.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/net/sunrpc/auth_gss/gss_krb5_keys.c b/net/sunrpc/auth_gss/gss_krb5_keys.c index 8701331..c41b389 100644 --- a/net/sunrpc/auth_gss/gss_

[PATCH V3 13/29] media: use parity8 in vivid-vbi-gen.c

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/media/platform/vivid/vivid-vbi-gen.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/vivid/vivid-vbi-gen.c b/drivers/media/platform/vivid/vivid-vbi-gen.c index a2159de..d5ba0fc 100644

[PATCH V3 17/29] input: use parity16 in ams_delta_serio

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/input/serio/ams_delta_serio.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c index 45887e3..85459b3 100644 --- a/drivers/input/s

[PATCH V3 16/29] input: use parity64 in sidewinder

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/input/joystick/sidewinder.c | 24 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c index 4a95b22..7ea486e 100644 --- a/dri

[PATCH V3 08/29] Add sparc-specific parity functions

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Use runtime patching for sparc64, lifted from hweight Signed-off-by: Zhaoxiu Zeng --- arch/sparc/include/asm/bitops_32.h | 1 + arch/sparc/include/asm/bitops_64.h | 18 ++ arch/sparc/kernel/sparc_ksyms_64.c | 6 ++ arch/sparc/lib/Makefile| 2 +- arch/s

[PATCH V3 11/29] mips: use parity functions in cerr-sb1.c

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- arch/mips/mm/cerr-sb1.c | 67 + 1 file changed, 17 insertions(+), 50 deletions(-) diff --git a/arch/mips/mm/cerr-sb1.c b/arch/mips/mm/cerr-sb1.c index ee5c1ff..2e7d660 100644 --- a/arch/mips/mm/c

[PATCH V3 09/29] Add x86-specific parity functions

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Use alternatives, lifted from arch_hweight Signed-off-by: Zhaoxiu Zeng --- arch/x86/include/asm/arch_hweight.h | 5 ++ arch/x86/include/asm/arch_parity.h | 117 arch/x86/include/asm/bitops.h | 4 +- 3 files changed, 125 inserti

[PATCH V3 12/29] bch: use parity32

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- lib/bch.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/bch.c b/lib/bch.c index bc89dfe4..6c6e8d4 100644 --- a/lib/bch.c +++ b/lib/bch.c @@ -278,18 +278,6 @@ static inline int deg(unsigned int poly)

[PATCH V3 07/29] Add powerpc-specific parity functions

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Use runtime patching for ppc64, lifted from hweight_64 Signed-off-by: Zhaoxiu Zeng --- arch/powerpc/include/asm/bitops.h | 11 +++ arch/powerpc/lib/Makefile | 2 +- arch/powerpc/lib/parity_64.S | 142 ++ arch/powerpc/lib/pp

[PATCH V3 06/29] Tile and MIPS (if has usable __builtin_popcount) use popcount parity functions

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- arch/mips/include/asm/bitops.h | 7 +++ arch/tile/include/asm/bitops.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h index ce9666c..4192068 100644 --- a/arch/mips/incl

[PATCH V3 05/29] Add ia64-specific parity functions

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- arch/ia64/include/asm/bitops.h | 31 +++ 1 file changed, 31 insertions(+) diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h index 71e8145..041d1d6 100644 --- a/arch/ia64/include/asm/bitops

[PATCH V3 03/29] Add alpha-specific parity functions

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- arch/alpha/include/asm/bitops.h | 27 +++ 1 file changed, 27 insertions(+) diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h index 4bdfbd4..95a43fa 100644 --- a/arch/alpha/include/asm/bitops

[PATCH V3 04/29] Add blackfin-specific parity functions

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- arch/blackfin/include/asm/bitops.h | 31 +++ 1 file changed, 31 insertions(+) diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h index b298b65..6609b7e 100644 --- a/arch/blackfin/i

[PATCH V3 01/29] bitops: add parity functions

2016-04-13 Thread zengzhaoxiu
From: Zhaoxiu Zeng Add generic odd parity functions, adapted from "https://graphics.stanford.edu/~seander/bithacks.html#ParityParallel"; Signed-off-by: Zhaoxiu Zeng --- include/asm-generic/bitops.h | 1 + include/asm-generic/bitops/arch_parity.h | 39

[PATCH] mtd: nand: s3c2410: fix bug in s3c2410_nand_correct_data()

2016-04-12 Thread zengzhaoxiu
From: Zhaoxiu Zeng If there is only one bit difference in the ECC, the function should return 1. The result of "diff0 & ~(1< --- drivers/mtd/nand/s3c2410.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index 9c9397b.

[PATCH] mtd: nand: s3c2410: fix bug in s3c2410_nand_correct_data()

2016-04-07 Thread zengzhaoxiu
From: Zeng Zhaoxiu If there is only one bit difference in the ECC, the function should return 1. The result of "diff0 & ~(1<

[PATCH v2 06/30] Add mips-specific parity functions

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Lifted from arch_hweight.h Signed-off-by: Zhaoxiu Zeng --- arch/mips/include/asm/arch_parity.h | 43 + arch/mips/include/asm/bitops.h | 3 +++ 2 files changed, 46 insertions(+) create mode 100644 arch/mips/include/asm/arch_parity.h

[PATCH v2 30/30] ethernet: use parity8 in broadcom/tg3.c

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/net/ethernet/broadcom/tg3.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 3010080..802a429 100644 --- a/drivers/net/ethernet/bro

[PATCH v2 29/30] input: use parity8 in elantech

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Remove even parity table, use parity8 instead. Signed-off-by: Zhaoxiu Zeng --- drivers/input/mouse/elantech.c | 10 +++--- drivers/input/mouse/elantech.h | 1 - 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/input/mouse/elantech.c b/drivers/input

[PATCH v2 28/30] serial: use parity32 in max3100

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/tty/serial/max3100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index 5c4c280..a0cc84a 100644 --- a/drivers/tty/serial/max3100.c +++ b/drivers/tty/seri

[PATCH v2 27/30] iio: use parity32 in adxrs450

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/iio/gyro/adxrs450.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/gyro/adxrs450.c b/drivers/iio/gyro/adxrs450.c index a330d42..307f55b 100644 --- a/drivers/iio/gyro/adxrs450.c +++ b/drivers/iio/gyro

[PATCH v2 24/30] ethernet: use parity8 in sun/niu.c

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/net/ethernet/sun/niu.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index 9cc4564..8c344ef 100644 --- a/drivers/net/ethernet/sun/niu.c +++

[PATCH v2 26/30] input: use parity8 in sa1111ps2

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/input/serio/saps2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/serio/saps2.c b/drivers/input/serio/saps2.c index b3e6889..324b193 100644 --- a/drivers/input/serio/saps2.c +++ b/driv

[PATCH v2 25/30] input: use parity8 in pcips2

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/input/serio/pcips2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/serio/pcips2.c b/drivers/input/serio/pcips2.c index e862c6e..a51e7f0 100644 --- a/drivers/input/serio/pcips2.c +++ b/drivers/input/se

[PATCH v2 23/30] mtd: use parity16 in sm_ftl

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/mtd/sm_ftl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c index b096f8b..345ff1a 100644 --- a/drivers/mtd/sm_ftl.c +++ b/drivers/mtd/sm_ftl.c @@ -136,7 +136,7 @@ st

[PATCH v2 22/30] crypto: use parity functions in qat_hal

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/crypto/qat/qat_common/qat_hal.c | 32 ++-- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/drivers/crypto/qat/qat_common/qat_hal.c b/drivers/crypto/qat/qat_common/qat_hal.c index 1e480f1..318

[PATCH v2 21/30] mtd: use parity functions in inftlcore

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/mtd/inftlcore.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c index b66b541..8c9457b 100644 --- a/drivers/mtd/inftlcore.c +++ b/drivers/mtd/inftl

[PATCH v2 20/30] mtd: use parity16 in ssfdc

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng The original get_parity return even parity of the input number. So hweight of "block_address & 0x7ff" must be odd if block_address is valid. This patch use parity16, and rearrange the code. Signed-off-by: Zhaoxiu Zeng --- drivers/mtd/ssfdc.c | 31 ---

[PATCH v2 19/30] scsi: use parity32 in isci's phy

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/scsi/isci/phy.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/scsi/isci/phy.c b/drivers/scsi/isci/phy.c index cb87b2e..a06aff6 100644 --- a/drivers/scsi/isci/phy.c +++ b/drivers/scsi/isci/ph

[PATCH v2 18/30] input: use parity16 in ams_delta_serio

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/input/serio/ams_delta_serio.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c index 45887e3..85459b3 100644 --- a/drivers/input/s

[PATCH v2 17/30] input: use parity64 in sidewinder

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/input/joystick/sidewinder.c | 24 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c index 4a95b22..7ea486e 100644 --- a/dri

[PATCH v2 16/30] input: use parity32 in grip_mp

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/input/joystick/grip_mp.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/input/joystick/grip_mp.c b/drivers/input/joystick/grip_mp.c index 573191d..3e29eb1 100644 --- a/drivers/input/joystick

[PATCH v2 15/30] media: use parity functions in saa7115

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/media/i2c/saa7115.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c index d2a1ce2..4c22df8 100644 --- a/drivers/media/i2c/saa7115.c +++ b/d

[PATCH v2 14/30] media: use parity8 in vivid-vbi-gen.c

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- drivers/media/platform/vivid/vivid-vbi-gen.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/vivid/vivid-vbi-gen.c b/drivers/media/platform/vivid/vivid-vbi-gen.c index a2159de..d5ba0fc 100644

[PATCH v2 13/30] bch: use parity32

2016-04-06 Thread zengzhaoxiu
From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- lib/bch.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/bch.c b/lib/bch.c index bc89dfe4..6c6e8d4 100644 --- a/lib/bch.c +++ b/lib/bch.c @@ -278,18 +278,6 @@ static inline int deg(unsigned int poly)

  1   2   >