patch-2.4.4 linux/drivers/char/joystick/adi.c

Next file: linux/drivers/char/joystick/cobra.c
Previous file: linux/drivers/char/joystick/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.3/linux/drivers/char/joystick/adi.c linux/drivers/char/joystick/adi.c
@@ -1,5 +1,5 @@
 /*
- * $Id: adi.c,v 1.12 2000/06/03 20:18:52 vojtech Exp $
+ * $Id: adi.c,v 1.15 2001/01/09 13:32:39 vojtech Exp $
  *
  *  Copyright (c) 1998-2000 Vojtech Pavlik
  *
@@ -370,7 +370,8 @@
 		adi->cname[i] = adi_get_bits(adi, 8);
 	adi->cname[i] = 0;
 
-	if (adi->length != (t = 8 + adi->buttons + adi->axes10 * 10 + adi->axes8 * 8 + adi->hats * 4)) {
+	t = 8 + adi->buttons + adi->axes10 * 10 + adi->axes8 * 8 + adi->hats * 4;
+	if (adi->length != t && adi->length != t + (t & 1)) {
 		printk(KERN_WARNING "adi: Expected length %d != data length %d\n", t, adi->length);
 		adi->length = 0;
 		return;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)