/* Voltage indication is higher for lower voltage. Lower voltage requires more gain (lower gain table index).  */
static s32 iwl4965_get_voltage_compensation(s32 eeprom_voltage, s32 current_voltage)
/* Voltage indication is higher for lower voltage. Lower voltage requires more gain (lower gain table index).  */
static s32 iwl4965_get_voltage_compensation(s32 eeprom_voltage, s32 current_voltage)
{
	s32 comp = 0;
	if ((TX_POWER_IWL_ILLEGAL_VOLTAGE == eeprom_voltage) ||
	    (TX_POWER_IWL_ILLEGAL_VOLTAGE == current_voltage))
		return 0;
	iwl4965_math_div_round(current_voltage - eeprom_voltage,
			       TX_POWER_IWL_VOLTAGE_CODES_PER_03V, &comp);
	if (current_voltage > eeprom_voltage)
		comp *= 2;
	if ((comp < -2) || (comp > 2))
		comp = 0;
	return comp;
}