if (usage->hat_min < usage->hat_max || usage->hat_dir) { 
if (usage->hat_min < usage->hat_max || usage->hat_dir) { 
void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value, struct pt_regs *regs){	struct input_dev *input = &field->hidinput->input;	int *quirks = &hid->quirks;	if (!input)		return;	input_regs(input, regs);	if (!usage->type)		return;	if (((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_5) && (usage->hid == 0x00090005))		|| ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_7) && (usage->hid == 0x00090007))) {		if (value) hid->quirks |=  HID_QUIRK_2WHEEL_MOUSE_HACK_ON;		else       hid->quirks &= ~HID_QUIRK_2WHEEL_MOUSE_HACK_ON;		return;	}	if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_ON) && (usage->code == REL_WHEEL)) {		input_event(input, usage->type, REL_HWHEEL, value);		return;	}	if (usage->hat_min < usage->hat_max || usage->hat_dir) { 		int hat_dir = usage->hat_dir;		if (!hat_dir)			hat_dir = (value - usage->hat_min) * 8 / (usage->hat_max - usage->hat_min + 1) + 1;		if (hat_dir < 0 || hat_dir > 8) hat_dir = 0;		input_event(input, usage->type, usage->code    , hid_hat_to_axis[hat_dir].x);                input_event(input, usage->type, usage->code + 1, hid_hat_to_axis[hat_dir].y);                return;        }	if (usage->hid == (HID_UP_DIGITIZER | 0x003c)) { /* Invert */		*quirks = value ? (*quirks | HID_QUIRK_INVERT) : (*quirks & ~HID_QUIRK_INVERT);		return;	}	if (usage->hid == (HID_UP_DIGITIZER | 0x0032)) { /* InRange */		if (value) {			input_event(input, usage->type, (*quirks & HID_QUIRK_INVERT) ? BTN_TOOL_RUBBER : usage->code, 1);			return;		}		input_event(input, usage->type, usage->code, 0);		input_event(input, usage->type, BTN_TOOL_RUBBER, 0);		return;	}	if (usage->hid == (HID_UP_DIGITIZER | 0x0030) && (*quirks & HID_QUIRK_NOTOUCH)) { /* Pressure */		int a = field->logical_minimum;		int b = field->logical_maximum;		input_event(input, EV_KEY, BTN_TOUCH, value > a + ((b - a) >> 3));	}	if (usage->hid == (HID_UP_PID | 0x83UL)) { /* Simultaneous Effects Max */		input->ff_effects_max = value;		dbg("Maximum Effects - %d",input->ff_effects_max);		return;	}	if (usage->hid == (HID_UP_PID | 0x7fUL)) {		dbg("PID Pool Report\n");		return;	}	if((usage->type == EV_KEY) && (usage->code == 0)) /* Key 0 is "unassigned", not KEY_UNKNOWN */		return;	input_event(input, usage->type, usage->code, value);	if ((field->flags & HID_MAIN_ITEM_RELATIVE) && (usage->type == EV_KEY))		input_event(input, usage->type, usage->code, 0);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/05f091ab4c8c1f12f8dd38ee789489904fea327d/hid-input.c/buggy/drivers/usb/input/hid-input.c