for (i = 0; i < 2; i++) if (grip->mode[i]) { 
for (i = 0; i < 2; i++) { if (!grip->mode[i]) continue; 
static int grip_connect(struct gameport *gameport, struct gameport_driver *drv){	struct grip *grip;	unsigned int data[GRIP_LENGTH_XT];	int i, j, t;	int err;	if (!(grip = kzalloc(sizeof(struct grip), GFP_KERNEL)))		return -ENOMEM;	grip->gameport = gameport;	gameport_set_drvdata(gameport, grip);	err = gameport_open(gameport, drv, GAMEPORT_MODE_RAW);	if (err)		goto fail1;	for (i = 0; i < 2; i++) {		if (!grip_gpp_read_packet(gameport, (i << 1) + 4, data)) {			grip->mode[i] = GRIP_MODE_GPP;			continue;		}		if (!grip_xt_read_packet(gameport, (i << 1) + 4, data)) {			if (!(data[3] & 7)) {				grip->mode[i] = GRIP_MODE_BD;				continue;			}			if (!(data[2] & 0xf0)) {				grip->mode[i] = GRIP_MODE_XT;				continue;			}			grip->mode[i] = GRIP_MODE_DC;			continue;		}	}	if (!grip->mode[0] && !grip->mode[1]) {		err = -ENODEV;		goto fail2;	}	gameport_set_poll_handler(gameport, grip_poll);	gameport_set_poll_interval(gameport, 20);	for (i = 0; i < 2; i++)		if (grip->mode[i]) {			sprintf(grip->phys[i], "%s/input%d", gameport->phys, i);			grip->dev[i].private = grip;			grip->dev[i].open = grip_open;			grip->dev[i].close = grip_close;			grip->dev[i].name = grip_name[grip->mode[i]];			grip->dev[i].phys = grip->phys[i];			grip->dev[i].id.bustype = BUS_GAMEPORT;			grip->dev[i].id.vendor = GAMEPORT_ID_VENDOR_GRAVIS;			grip->dev[i].id.product = grip->mode[i];			grip->dev[i].id.version = 0x0100;			grip->dev[i].evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);			for (j = 0; (t = grip_abs[grip->mode[i]][j]) >= 0; j++) {				if (j < grip_cen[grip->mode[i]])					input_set_abs_params(&grip->dev[i], t, 14, 52, 1, 2);				else if (j < grip_anx[grip->mode[i]])					input_set_abs_params(&grip->dev[i], t, 3, 57, 1, 0);				else					input_set_abs_params(&grip->dev[i], t, -1, 1, 0, 0);			}			for (j = 0; (t = grip_btn[grip->mode[i]][j]) >= 0; j++)				if (t > 0)					set_bit(t, grip->dev[i].keybit);			printk(KERN_INFO "input: %s on %s\n",				grip_name[grip->mode[i]], gameport->phys);			input_register_device(grip->dev + i);		}	return 0;fail2:	gameport_close(gameport);fail1:	gameport_set_drvdata(gameport, NULL);	kfree(grip);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/17dd3f0f7aa729a042af5d3318ff9b3e7781b45b/grip.c/buggy/drivers/input/joystick/grip.c