Re: [PATCH 1/1] GCD: add binary GCD algorithm

2014-08-15 Thread zhaoxiu.zeng
在 2014/8/15 21:58, Peter Zijlstra 写道: > On Fri, Aug 15, 2014 at 08:49:16PM +0800, Zhaoxiu Zeng wrote: >> 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 divi

Re: [PATCH 04/10] omap_hwspinlock: Replace "hweight_long(i & 0xf) != 1" with "!is_power_of_2(i & 0xf)"

2015-12-07 Thread zhaoxiu.zeng
在 2015/12/7 19:08, Ohad Ben-Cohen 写道: > Hi, > > On Sun, Dec 6, 2015 at 12:33 PM, Zhaoxiu Zeng wrote: >> >> From: Zeng Zhaoxiu >> >> Signed-off-by: Zeng Zhaoxiu > > Please explain why do you think we should make this change. is_power_of_2 is simple, and faster than "hweightN(x) == 1" on most

Re: [PATCH 01/31] bitops: add parity functions

2016-03-26 Thread zhaoxiu.zeng
On 2016/3/24 16:38, Denys Vlasenko wrote: > On 03/24/2016 04:03 AM, Zhaoxiu Zeng wrote: >> +/* >> + * Type invariant interface to the compile time constant parity functions. >> + */ >> +#define PARITY(w)PARITY64((u64)w) > > Can result in incorrect expansion of w. Should be PARITY64((u64)(w)) >

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

2016-03-26 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Use the generic version. Signed-off-by: Zeng Zhaoxiu --- arch/arc/include/asm/bitops.h | 1 + arch/arm/include/asm/bitops.h | 1 + arch/arm64/include/asm/bitops.h| 1 + arch/c6x/include/asm/bitops.h | 1 + arch/cris/include/asm/bitops.h | 1 + arch/frv

[PATCH 03/31] Add alpha-specific parity functions

2016-03-26 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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 04/31] Add avr32-specific parity functions

2016-03-26 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- arch/avr32/include/asm/bitops.h | 32 1 file changed, 32 insertions(+) diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h index 910d537..80d7005 100644 --- a/arch/avr32/include/asm/b

[PATCH 05/31] Add blackfin-specific parity functions

2016-03-26 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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..81b078a 100644 --- a/arch/blackfin/i

[PATCH 06/31] Add ia64-specific parity functions

2016-03-26 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- arch/ia64/include/asm/bitops.h | 16 1 file changed, 16 insertions(+) diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h index 71e8145..de13d89 100644 --- a/arch/ia64/include/asm/bitops.h +++ b/arch/i

[PATCH 07/31] Add mips-specific parity functions

2016-03-26 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- arch/mips/include/asm/arch_parity.h | 44 + arch/mips/include/asm/bitops.h | 3 +++ 2 files changed, 47 insertions(+) create mode 100644 arch/mips/include/asm/arch_parity.h diff --git a/arch/mips/incl

[PATCH 08/31] Add tile-specific parity functions

2016-03-26 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- arch/tile/include/asm/bitops.h | 26 ++ 1 file changed, 26 insertions(+) diff --git a/arch/tile/include/asm/bitops.h b/arch/tile/include/asm/bitops.h index 20caa34..370d007 100644 --- a/arch/tile/include/asm/bitops.h ++

[PATCH 09/31] Add powerpc-specific parity functions

2016-03-26 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- arch/powerpc/include/asm/bitops.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h index 59abc62..90ee0f2 100644 --- a/arch/powerpc/include/asm/bitops.h +++ b/arch

[PATCH 10/31] Add sparc-specific parity functions

2016-03-26 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- arch/sparc/include/asm/bitops_32.h | 1 + arch/sparc/include/asm/bitops_64.h | 13 + 2 files changed, 14 insertions(+) diff --git a/arch/sparc/include/asm/bitops_32.h b/arch/sparc/include/asm/bitops_32.h index 600ed1d..8c41896 10

[PATCH 11/31] Add x86-specific parity functions

2016-03-26 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- arch/x86/include/asm/bitops.h | 12 1 file changed, 12 insertions(+) diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h index 7766d1c..d3210c0 100644 --- a/arch/x86/include/asm/bitops.h +++ b/arch/x86/inclu

[PATCH 12/31] sunrpc: auth_gss: use parity8

2016-03-26 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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 13/31] mips: use parity functions in cerr-sb1.c

2016-03-26 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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 14/31] lib: bch: use parity32

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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 15/31] media: use parity8 in vivid-vbi-gen.c

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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 16/31] media: saa7115: use parity functions

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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 17/31] input: joystick: use parity32 in grip_mp.c

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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 18/31] input: joystick: use parity64 in sidewinder.c

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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 19/31] input: serio: use parity16 in ams_delta_serio.c

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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 20/31] scsi: use parity32 in isci/phy.c

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- drivers/scsi/isci/phy.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/isci/phy.c b/drivers/scsi/isci/phy.c index cb87b2e..0b87ff4 100644 --- a/drivers/scsi/isci/phy.c +++ b/drivers/scsi/isc

[PATCH 21/31] mtd: use parity16 in ssfdc.c

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- drivers/mtd/ssfdc.c | 20 ++-- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/drivers/mtd/ssfdc.c b/drivers/mtd/ssfdc.c index daf82ba..b4d9144 100644 --- a/drivers/mtd/ssfdc.c +++ b/drivers/mtd/ssfdc.c @@ -182,24

[PATCH 22/31] mtd: use parity functions in inftlcore.c

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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..29567bb 100644 --- a/drivers/mtd/inftlcore.c +++ b/drivers/mtd/inftl

[PATCH 23/31] crypto: qat: use parity functions in qat_hal.c

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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 24/31] mtd: use parity16 in sm_ftl.c

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- drivers/mtd/sm_ftl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c index b096f8b..2244588 100644 --- a/drivers/mtd/sm_ftl.c +++ b/drivers/mtd/sm_ftl.c @@ -136,7 +136,7 @@ sta

[PATCH 25/31] ethernet: use parity8 in sun/niu.c

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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 26/31] input: serio: use parity8 in pcips2.c

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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 27/31] input: serio: use parity8 in sa1111ps2.c

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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 28/31] iio: gyro: use parity32 in adxrs450.c

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- drivers/iio/gyro/adxrs450.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/iio/gyro/adxrs450.c b/drivers/iio/gyro/adxrs450.c index a330d42..f1f19fc20 100644 --- a/drivers/iio/gyro/adxrs450.c +++ b/drivers/ii

[PATCH 29/31] serial: use parity32 in max3100.c

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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 30/31] input: mouse: use parity8 in elantech

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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/mouse/elantech.c index 78f93cf..778b5d1 100644

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

2016-03-27 Thread zhaoxiu.zeng
From: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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

Re: [PATCH 01/31] bitops: add parity functions

2016-03-27 Thread zhaoxiu.zeng
On 2016/3/27 6:08, Martin Kepplinger wrote: > We do. > > Am 24. März 2016 23:28:15 MEZ, schrieb Andrew Morton > : >> On Thu, 24 Mar 2016 09:38:21 +0100 Denys Vlasenko >> wrote: >> >>> On 03/24/2016 04:03 AM, Zhaoxiu Zeng wrote: +/* + * Type invariant interface to the compile time const

Re: [PATCH 01/31] bitops: add parity functions

2016-03-27 Thread zhaoxiu.zeng
On 2016/3/27 20:44, Sam Ravnborg wrote: > Hi Zeng. > > Looking through the arch specific implementations of __arch_parity(). > Some architectures uses #defines, other uses inline static functions. > > Any particular reason that you select one approach over the other > in the different cases? > >