[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

[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

[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

[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

[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 ---

[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

[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 +++

[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

[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

[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

[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

[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

[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

[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 ---

[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

[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 ---

[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

[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

[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

[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

[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

[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 ---

[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 ---

[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

[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

[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

[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 ---

[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 ---

[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

[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 -

[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 ---

[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

[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

[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

[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

[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

[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 ---

[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 @@

[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

[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 ---

[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

[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 ---

[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 ---

[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 +++

[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

[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 ---

[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 +++

[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

[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

[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

[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

[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

[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 +++

[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

[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

[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

[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

[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 ---

[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 +

[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 ++

[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 +-

[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

[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 ++

[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

[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

[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

[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 ---

[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

[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 ---

[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

[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 ---

[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

[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'

[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) =

[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) =

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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 ---

[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'

[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

[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 ---

[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 ---

  1   2   3   >