Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1398844
| From | zengzhaoxiu@163.com |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [patch V4 15/31] input: use parity32 in grip_mp |
| Date | 2016-05-11 11:30 +0200 |
| Message-ID | <rxyCT-5ns-29@gated-at.bofh.it> (permalink) |
| References | <rxxGP-4ls-49@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Zhaoxiu Zeng <zhaoxiu.zeng@gmail.com>
Signed-off-by: Zhaoxiu Zeng <zhaoxiu.zeng@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
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/grip_mp.c
+++ b/drivers/input/joystick/grip_mp.c
@@ -112,20 +112,6 @@ static const int axis_map[] = { 5, 9, 1, 5, 6, 10, 2, 6, 4, 8, 0, 4, 5, 9, 1, 5
static int register_slot(int i, struct grip_mp *grip);
/*
- * Returns whether an odd or even number of bits are on in pkt.
- */
-
-static int bit_parity(u32 pkt)
-{
- int x = pkt ^ (pkt >> 16);
- x ^= x >> 8;
- x ^= x >> 4;
- x ^= x >> 2;
- x ^= x >> 1;
- return x & 1;
-}
-
-/*
* Poll gameport; return true if all bits set in 'onbits' are on and
* all bits set in 'offbits' are off.
*/
@@ -235,7 +221,7 @@ static int mp_io(struct gameport* gameport, int sendflags, int sendcode, u32 *pa
pkt = (pkt >> 2) | 0xf0000000;
}
- if (bit_parity(pkt) == 1)
+ if (parity32(pkt))
return IO_RESET;
/* Acknowledge packet receipt */
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[patch V4 00/31] bitops: add parity functions zengzhaoxiu@163.com - 2016-05-11 10:30 +0200
[patch V4 01/31] bitops: add parity functions zengzhaoxiu@163.com - 2016-05-11 11:10 +0200
Re: [patch V4 01/31] bitops: add parity functions Martin Kepplinger <martink@posteo.de> - 2016-05-11 16:40 +0200
[patch V4 02/31] bitops: Include generic parity.h in some architectures' bitops.h zengzhaoxiu@163.com - 2016-05-11 11:20 +0200
Re: [patch V4 02/31] bitops: Include generic parity.h in some architectures' bitops.h Jesper Nilsson <jesper.nilsson@axis.com> - 2016-05-11 12:10 +0200
Re: [patch V4 02/31] bitops: Include generic parity.h in some architectures' bitops.h Catalin Marinas <catalin.marinas@arm.com> - 2016-05-11 12:50 +0200
Re: [patch V4 02/31] bitops: Include generic parity.h in some architectures' bitops.h Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-05-11 16:00 +0200
Re: [patch V4 02/31] bitops: Include generic parity.h in some architectures' bitops.h Mark Salter <msalter@redhat.com> - 2016-05-11 17:30 +0200
[patch V4 09/31] bitops: Add x86-specific parity functions zengzhaoxiu@163.com - 2016-05-11 11:20 +0200
Re: [patch V4 09/31] bitops: Add x86-specific parity functions Peter Zijlstra <peterz@infradead.org> - 2016-05-11 11:40 +0200
Re: [patch V4 09/31] bitops: Add x86-specific parity functions Borislav Petkov <bp@suse.de> - 2016-05-11 12:00 +0200
[patch V4 06/31] bitops: Tile and MIPS (if has usable __builtin_popcount) use popcount parity functions zengzhaoxiu@163.com - 2016-05-11 11:20 +0200
[patch V4 12/31] lib: bch: use parity32 zengzhaoxiu@163.com - 2016-05-11 11:20 +0200
[patch V4 03/31] bitops: Add alpha-specific parity functions zengzhaoxiu@163.com - 2016-05-11 11:20 +0200
[patch V4 05/31] bitops: Add ia-specific parity functions zengzhaoxiu@163.com - 2016-05-11 11:20 +0200
[patch V4 11/31] mips: use parity functions in cerr-sb1.c zengzhaoxiu@163.com - 2016-05-11 11:20 +0200
[patch V4 08/31] bitops: Add sparc-specific parity functions zengzhaoxiu@163.com - 2016-05-11 11:20 +0200
Re: [patch V4 08/31] bitops: Add sparc-specific parity functions David Miller <davem@davemloft.net> - 2016-05-12 02:00 +0200
[patch V4 10/31] sunrpc: use parity8 zengzhaoxiu@163.com - 2016-05-11 11:20 +0200
[patch V4 07/31] bitops: Add powerpc-specific parity functions zengzhaoxiu@163.com - 2016-05-11 11:20 +0200
[patch V4 04/31] bitops: Add blackfin-specific parity functions zengzhaoxiu@163.com - 2016-05-11 11:20 +0200
[patch V4 28/31] input: use parity8 in elantech zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
[patch V4 19/31] mtd: use parity16 in ssfdc zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
[patch V4 23/31] ethernet: use parity8 in sun/niu.c zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
Re: [patch V4 23/31] ethernet: use parity8 in sun/niu.c David Miller <davem@davemloft.net> - 2016-05-12 02:10 +0200
[patch V4 20/31] mtd: use parity functions in inftlcore zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
[patch V4 14/31] media: use parity functions in saa7115 zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
[patch V4 31/31] edac: use parity8 in amd64_edac.c zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
[patch V4 29/31] ethernet: use parity8 in broadcom/tg3.c zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
Re: [patch V4 29/31] ethernet: use parity8 in broadcom/tg3.c David Miller <davem@davemloft.net> - 2016-05-12 02:00 +0200
[patch V4 18/31] scsi: use parity32 in isci's phy zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
[patch V4 21/31] crypto: use parity functions in qat_hal zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
[patch V4 15/31] input: use parity32 in grip_mp zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
[patch V4 30/31] crypto: use parity_long is sahara.c zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
[patch V4 22/31] mtd: use parity16 in sm_ftl zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
[patch V4 25/31] input: use parity8 in sa1111ps2 zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
[patch V4 16/31] input: use parity64 in sidewinder zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
[patch V4 27/31] serial: use parity32 in max3100 zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
[patch V4 24/31] input: use parity8 in pcips2 zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
[patch V4 26/31] iio: use parity32 in adxrs450 zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
[patch V4 17/31] input: use parity16 in ams_delta_serio zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
[patch V4 13/31] media: use parity8 in vivid-vbi-gen.c zengzhaoxiu@163.com - 2016-05-11 11:30 +0200
csiph-web