/* Scale an unsigned value with range 0..max for the given field  */
static int pidff_rescale(int i, int max, struct hid_field *field)
/* Scale an unsigned value with range 0..max for the given field  */
static int pidff_rescale(int i, int max, struct hid_field *field)
{
	return i * (field->logical_maximum - field->logical_minimum) / max +
	    field->logical_minimum;
}