for (i = 0; i < BTN_JOYSTICK - BTN_MISC + 1; i++) 
for (i = 0; i < BTN_JOYSTICK - BTN_MISC; i++) 
static struct input_handle *joydev_connect(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id){	struct joydev *joydev;	int i, j, t, minor;	for (minor = 0; minor < JOYDEV_MINORS && joydev_table[minor]; minor++);	if (minor == JOYDEV_MINORS) {		printk(KERN_ERR "joydev: no more free joydev devices\n");		return NULL;	}	if (!(joydev = kmalloc(sizeof(struct joydev), GFP_KERNEL)))		return NULL;	memset(joydev, 0, sizeof(struct joydev));	INIT_LIST_HEAD(&joydev->list);	init_waitqueue_head(&joydev->wait);	joydev->minor = minor;	joydev->exist = 1;	joydev->handle.dev = dev;	joydev->handle.name = joydev->name;	joydev->handle.handler = handler;	joydev->handle.private = joydev;	sprintf(joydev->name, "js%d", minor);	for (i = 0; i < ABS_MAX + 1; i++)		if (test_bit(i, dev->absbit)) {			joydev->absmap[i] = joydev->nabs;			joydev->abspam[joydev->nabs] = i;			joydev->nabs++;		}	for (i = BTN_JOYSTICK - BTN_MISC; i < KEY_MAX - BTN_MISC + 1; i++)		if (test_bit(i + BTN_MISC, dev->keybit)) {			joydev->keymap[i] = joydev->nkey;			joydev->keypam[joydev->nkey] = i + BTN_MISC;			joydev->nkey++;		}	for (i = 0; i < BTN_JOYSTICK - BTN_MISC + 1; i++)		if (test_bit(i + BTN_MISC, dev->keybit)) {			joydev->keymap[i] = joydev->nkey;			joydev->keypam[joydev->nkey] = i + BTN_MISC;			joydev->nkey++;		}	for (i = 0; i < joydev->nabs; i++) {		j = joydev->abspam[i];		if (dev->absmax[j] == dev->absmin[j]) {			joydev->corr[i].type = JS_CORR_NONE;			joydev->abs[i] = dev->abs[j];			continue;		}		joydev->corr[i].type = JS_CORR_BROKEN;		joydev->corr[i].prec = dev->absfuzz[j];		joydev->corr[i].coef[0] = (dev->absmax[j] + dev->absmin[j]) / 2 - dev->absflat[j];		joydev->corr[i].coef[1] = (dev->absmax[j] + dev->absmin[j]) / 2 + dev->absflat[j];		if (!(t = ((dev->absmax[j] - dev->absmin[j]) / 2 - 2 * dev->absflat[j])))			continue;		joydev->corr[i].coef[2] = (1 << 29) / t;		joydev->corr[i].coef[3] = (1 << 29) / t;		joydev->abs[i] = joydev_correct(dev->abs[j], joydev->corr + i);	}	joydev_table[minor] = joydev;	devfs_mk_cdev(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),			S_IFCHR|S_IRUGO|S_IWUSR, "input/js%d", minor);	class_simple_device_add(input_class,				MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),				dev->dev, "js%d", minor);	return &joydev->handle;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/f24949e8e0b9bed223ad9a435bf37e91ee8d0db7/joydev.c/buggy/drivers/input/joydev.c