Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1365071

[PATCH 14/31] lib: bch: use parity32

From "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 14/31] lib: bch: use parity32
Date 2016-03-27 09:10 +0200
Message-ID <rhcZH-4Ir-5@gated-at.bofh.it> (permalink)
References <rg3ON-4FE-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>

Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
---
 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)
 	return fls(poly)-1;
 }
 
-static inline int parity(unsigned int x)
-{
-	/*
-	 * public domain code snippet, lifted from
-	 * http://www-graphics.stanford.edu/~seander/bithacks.html
-	 */
-	x ^= x >> 1;
-	x ^= x >> 2;
-	x = (x & 0x11111111U) * 0x11111111U;
-	return (x >> 28) & 1;
-}
-
 /* Galois field basic operations: multiply, divide, inverse, etc. */
 
 static inline unsigned int gf_mul(struct bch_control *bch, unsigned int a,
@@ -494,7 +482,7 @@ static int solve_linear_system(struct bch_control *bch, unsigned int *rows,
 		tmp = 0;
 		for (r = m-1; r >= 0; r--) {
 			mask = rows[r] & (tmp|1);
-			tmp |= parity(mask) << (m-r);
+			tmp |= parity32(mask) << (m-r);
 		}
 		sol[p] = tmp >> 1;
 	}
-- 
2.5.5

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 01/31] bitops: add parity functions Zhaoxiu Zeng <zhaoxiu.zeng@gmail.com> - 2016-03-24 04:10 +0100
  Re: [PATCH 01/31] bitops: add parity functions Denys Vlasenko <dvlasenk@redhat.com> - 2016-03-24 09:40 +0100
    Re: [PATCH 01/31] bitops: add parity functions Andrew Morton <akpm@linux-foundation.org> - 2016-03-24 23:30 +0100
      Re: [PATCH 01/31] bitops: add parity functions Martin Kepplinger <martink@posteo.de> - 2016-03-26 23:10 +0100
        Re: [PATCH 01/31] bitops: add parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 10:00 +0200
    Re: [PATCH 01/31] bitops: add parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 05:40 +0200
      Re: [PATCH 01/31] bitops: add parity functions Sam Ravnborg <sam@ravnborg.org> - 2016-03-27 14:50 +0200
        Re: [PATCH 01/31] bitops: add parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 15:40 +0200
          Re: [PATCH 01/31] bitops: add parity functions Sam Ravnborg <sam@ravnborg.org> - 2016-03-27 20:00 +0200
            Re: [PATCH 01/31] bitops: add parity functions Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com> - 2016-03-28 04:50 +0200
          Re: [PATCH 01/31] bitops: add parity functions Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com> - 2016-03-28 04:20 +0200
      Re: [PATCH 01/31] bitops: add parity functions Sam Ravnborg <sam@ravnborg.org> - 2016-03-28 09:00 +0200
        Re: [PATCH 01/31] bitops: add parity functions Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com> - 2016-03-29 04:30 +0200
          Re: [PATCH 01/31] bitops: add parity functions Joe Perches <joe@perches.com> - 2016-03-29 05:00 +0200
  [PATCH 02/31] Include generic parity.h in some architectures'  bitops.h "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 06:10 +0200
  [PATCH 03/31] Add alpha-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 07:50 +0200
    Re: [PATCH 03/31] Add alpha-specific parity functions Richard Henderson <rth@twiddle.net> - 2016-03-28 20:40 +0200
  [PATCH 04/31] Add avr32-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 07:50 +0200
    Re: [PATCH 04/31] Add avr32-specific parity functions Hans-Christian Noren Egtvedt <egtvedt@samfundet.no> - 2016-03-28 22:10 +0200
  [PATCH 05/31] Add blackfin-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 08:00 +0200
  [PATCH 07/31] Add mips-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 08:10 +0200
    Re: [PATCH 07/31] Add mips-specific parity functions David Daney <ddaney.cavm@gmail.com> - 2016-03-28 19:30 +0200
      Re: [PATCH 07/31] Add mips-specific parity functions Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com> - 2016-03-29 04:20 +0200
  [PATCH 06/31] Add ia64-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 08:10 +0200
  [PATCH 08/31] Add tile-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 08:20 +0200
  [PATCH 09/31] Add powerpc-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 08:40 +0200
  [PATCH 11/31] Add x86-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 08:50 +0200
    Re: [PATCH 11/31] Add x86-specific parity functions One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-03-29 14:20 +0200
  [PATCH 10/31] Add sparc-specific parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 08:50 +0200
    Re: [PATCH 10/31] Add sparc-specific parity functions David Miller <davem@davemloft.net> - 2016-03-28 04:50 +0200
      Re: [PATCH 10/31] Add sparc-specific parity functions Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com> - 2016-03-28 07:50 +0200
        Re: [PATCH 10/31] Add sparc-specific parity functions David Miller <davem@davemloft.net> - 2016-03-28 17:30 +0200
          Re: [PATCH 10/31] Add sparc-specific parity functions Sam Ravnborg <sam@ravnborg.org> - 2016-03-28 17:40 +0200
            Re: [PATCH 10/31] Add sparc-specific parity functions David Miller <davem@davemloft.net> - 2016-03-28 17:50 +0200
  [PATCH 12/31] sunrpc: auth_gss: use parity8 "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:00 +0200
  [PATCH 13/31] mips: use parity functions in cerr-sb1.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:00 +0200
  [PATCH 15/31] media: use parity8 in vivid-vbi-gen.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:10 +0200
  [PATCH 14/31] lib: bch: use parity32 "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:10 +0200
  [PATCH 17/31] input: joystick: use parity32 in grip_mp.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:20 +0200
  [PATCH 18/31] input: joystick: use parity64 in sidewinder.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:20 +0200
  [PATCH 16/31] media: saa7115: use parity functions "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:20 +0200
  [PATCH 19/31] input: serio: use parity16 in ams_delta_serio.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:20 +0200
  [PATCH 22/31] mtd: use parity functions in inftlcore.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:30 +0200
  [PATCH 21/31] mtd: use parity16 in ssfdc.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:30 +0200
    Re: [PATCH 21/31] mtd: use parity16 in ssfdc.c Brian Norris <computersforpeace@gmail.com> - 2016-04-02 01:50 +0200
  [PATCH 20/31] scsi: use parity32 in isci/phy.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:30 +0200
  [PATCH 26/31] input: serio: use parity8 in pcips2.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:40 +0200
  [PATCH 25/31] ethernet: use parity8 in sun/niu.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:40 +0200
    Re: [PATCH 25/31] ethernet: use parity8 in sun/niu.c Michal Nazarewicz <mina86@mina86.com> - 2016-03-28 16:40 +0200
  [PATCH 24/31] mtd: use parity16 in sm_ftl.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:40 +0200
  [PATCH 23/31] crypto: qat: use parity functions in qat_hal.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:40 +0200
  [PATCH 28/31] iio: gyro: use parity32 in adxrs450.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:50 +0200
    Re: [PATCH 28/31] iio: gyro: use parity32 in adxrs450.c Jonathan Cameron <jic23@kernel.org> - 2016-03-28 10:40 +0200
      Re: [PATCH 28/31] iio: gyro: use parity32 in adxrs450.c Lars-Peter Clausen <lars@metafoo.de> - 2016-03-28 11:30 +0200
  [PATCH 29/31] serial: use parity32 in max3100.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:50 +0200
  [PATCH 30/31] input: mouse: use parity8 in elantech "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:50 +0200
  [PATCH 27/31] input: serio: use parity8 in sa1111ps2.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 09:50 +0200
  [PATCH 31/31] ethernet: broadcom: use parity8 in tg3.c "zhaoxiu.zeng" <zhaoxiu.zeng@gmail.com> - 2016-03-27 10:00 +0200

csiph-web