Skip to content

Commit

Permalink
ixgb: format all if( to be if (
Browse files Browse the repository at this point in the history
this patch is trivial but because I want to have everything be nice and
tidy I'm updating it.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Jesse Brandeburg authored and Jeff Garzik committed Jul 11, 2008
1 parent 7490d71 commit 03f8304
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 132 deletions.
8 changes: 4 additions & 4 deletions drivers/net/ixgb/ixgb_ee.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ ixgb_shift_out_bits(struct ixgb_hw *hw,
*/
eecd_reg &= ~IXGB_EECD_DI;

if(data & mask)
if (data & mask)
eecd_reg |= IXGB_EECD_DI;

IXGB_WRITE_REG(hw, EECD, eecd_reg);
Expand Down Expand Up @@ -159,7 +159,7 @@ ixgb_shift_in_bits(struct ixgb_hw *hw)
eecd_reg = IXGB_READ_REG(hw, EECD);

eecd_reg &= ~(IXGB_EECD_DI);
if(eecd_reg & IXGB_EECD_DO)
if (eecd_reg & IXGB_EECD_DO)
data |= 1;

ixgb_lower_clock(hw, &eecd_reg);
Expand Down Expand Up @@ -300,7 +300,7 @@ ixgb_wait_eeprom_command(struct ixgb_hw *hw)
for(i = 0; i < 200; i++) {
eecd_reg = IXGB_READ_REG(hw, EECD);

if(eecd_reg & IXGB_EECD_DO)
if (eecd_reg & IXGB_EECD_DO)
return (true);

udelay(50);
Expand Down Expand Up @@ -331,7 +331,7 @@ ixgb_validate_eeprom_checksum(struct ixgb_hw *hw)
for(i = 0; i < (EEPROM_CHECKSUM_REG + 1); i++)
checksum += ixgb_read_eeprom(hw, i);

if(checksum == (u16) EEPROM_SUM)
if (checksum == (u16) EEPROM_SUM)
return (true);
else
return (false);
Expand Down
68 changes: 34 additions & 34 deletions drivers/net/ixgb/ixgb_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
ecmd->port = PORT_FIBRE;
ecmd->transceiver = XCVR_EXTERNAL;

if(netif_carrier_ok(adapter->netdev)) {
if (netif_carrier_ok(adapter->netdev)) {
ecmd->speed = SPEED_10000;
ecmd->duplex = DUPLEX_FULL;
} else {
Expand All @@ -122,11 +122,11 @@ ixgb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
{
struct ixgb_adapter *adapter = netdev_priv(netdev);

if(ecmd->autoneg == AUTONEG_ENABLE ||
if (ecmd->autoneg == AUTONEG_ENABLE ||
ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL)
return -EINVAL;

if(netif_running(adapter->netdev)) {
if (netif_running(adapter->netdev)) {
ixgb_down(adapter, true);
ixgb_reset(adapter);
ixgb_up(adapter);
Expand All @@ -146,11 +146,11 @@ ixgb_get_pauseparam(struct net_device *netdev,

pause->autoneg = AUTONEG_DISABLE;

if(hw->fc.type == ixgb_fc_rx_pause)
if (hw->fc.type == ixgb_fc_rx_pause)
pause->rx_pause = 1;
else if(hw->fc.type == ixgb_fc_tx_pause)
else if (hw->fc.type == ixgb_fc_tx_pause)
pause->tx_pause = 1;
else if(hw->fc.type == ixgb_fc_full) {
else if (hw->fc.type == ixgb_fc_full) {
pause->rx_pause = 1;
pause->tx_pause = 1;
}
Expand All @@ -163,19 +163,19 @@ ixgb_set_pauseparam(struct net_device *netdev,
struct ixgb_adapter *adapter = netdev_priv(netdev);
struct ixgb_hw *hw = &adapter->hw;

if(pause->autoneg == AUTONEG_ENABLE)
if (pause->autoneg == AUTONEG_ENABLE)
return -EINVAL;

if(pause->rx_pause && pause->tx_pause)
if (pause->rx_pause && pause->tx_pause)
hw->fc.type = ixgb_fc_full;
else if(pause->rx_pause && !pause->tx_pause)
else if (pause->rx_pause && !pause->tx_pause)
hw->fc.type = ixgb_fc_rx_pause;
else if(!pause->rx_pause && pause->tx_pause)
else if (!pause->rx_pause && pause->tx_pause)
hw->fc.type = ixgb_fc_tx_pause;
else if(!pause->rx_pause && !pause->tx_pause)
else if (!pause->rx_pause && !pause->tx_pause)
hw->fc.type = ixgb_fc_none;

if(netif_running(adapter->netdev)) {
if (netif_running(adapter->netdev)) {
ixgb_down(adapter, true);
ixgb_up(adapter);
ixgb_set_speed_duplex(netdev);
Expand All @@ -200,7 +200,7 @@ ixgb_set_rx_csum(struct net_device *netdev, u32 data)

adapter->rx_csum = data;

if(netif_running(netdev)) {
if (netif_running(netdev)) {
ixgb_down(adapter, true);
ixgb_up(adapter);
ixgb_set_speed_duplex(netdev);
Expand Down Expand Up @@ -229,7 +229,7 @@ ixgb_set_tx_csum(struct net_device *netdev, u32 data)
static int
ixgb_set_tso(struct net_device *netdev, u32 data)
{
if(data)
if (data)
netdev->features |= NETIF_F_TSO;
else
netdev->features &= ~NETIF_F_TSO;
Expand Down Expand Up @@ -415,7 +415,7 @@ ixgb_get_eeprom(struct net_device *netdev,
int i, max_len, first_word, last_word;
int ret_val = 0;

if(eeprom->len == 0) {
if (eeprom->len == 0) {
ret_val = -EINVAL;
goto geeprom_error;
}
Expand All @@ -424,20 +424,20 @@ ixgb_get_eeprom(struct net_device *netdev,

max_len = ixgb_get_eeprom_len(netdev);

if(eeprom->offset > eeprom->offset + eeprom->len) {
if (eeprom->offset > eeprom->offset + eeprom->len) {
ret_val = -EINVAL;
goto geeprom_error;
}

if((eeprom->offset + eeprom->len) > max_len)
if ((eeprom->offset + eeprom->len) > max_len)
eeprom->len = (max_len - eeprom->offset);

first_word = eeprom->offset >> 1;
last_word = (eeprom->offset + eeprom->len - 1) >> 1;

eeprom_buff = kmalloc(sizeof(__le16) *
(last_word - first_word + 1), GFP_KERNEL);
if(!eeprom_buff)
if (!eeprom_buff)
return -ENOMEM;

/* note the eeprom was good because the driver loaded */
Expand All @@ -464,35 +464,35 @@ ixgb_set_eeprom(struct net_device *netdev,
int max_len, first_word, last_word;
u16 i;

if(eeprom->len == 0)
if (eeprom->len == 0)
return -EINVAL;

if(eeprom->magic != (hw->vendor_id | (hw->device_id << 16)))
if (eeprom->magic != (hw->vendor_id | (hw->device_id << 16)))
return -EFAULT;

max_len = ixgb_get_eeprom_len(netdev);

if(eeprom->offset > eeprom->offset + eeprom->len)
if (eeprom->offset > eeprom->offset + eeprom->len)
return -EINVAL;

if((eeprom->offset + eeprom->len) > max_len)
if ((eeprom->offset + eeprom->len) > max_len)
eeprom->len = (max_len - eeprom->offset);

first_word = eeprom->offset >> 1;
last_word = (eeprom->offset + eeprom->len - 1) >> 1;
eeprom_buff = kmalloc(max_len, GFP_KERNEL);
if(!eeprom_buff)
if (!eeprom_buff)
return -ENOMEM;

ptr = (void *)eeprom_buff;

if(eeprom->offset & 1) {
if (eeprom->offset & 1) {
/* need read/modify/write of first changed EEPROM word */
/* only the second byte of the word is being modified */
eeprom_buff[0] = ixgb_read_eeprom(hw, first_word);
ptr++;
}
if((eeprom->offset + eeprom->len) & 1) {
if ((eeprom->offset + eeprom->len) & 1) {
/* need read/modify/write of last changed EEPROM word */
/* only the first byte of the word is being modified */
eeprom_buff[last_word - first_word]
Expand All @@ -504,7 +504,7 @@ ixgb_set_eeprom(struct net_device *netdev,
ixgb_write_eeprom(hw, first_word + i, eeprom_buff[i]);

/* Update the checksum over the first part of the EEPROM if needed */
if(first_word <= EEPROM_CHECKSUM_REG)
if (first_word <= EEPROM_CHECKSUM_REG)
ixgb_update_eeprom_checksum(hw);

kfree(eeprom_buff);
Expand Down Expand Up @@ -557,10 +557,10 @@ ixgb_set_ringparam(struct net_device *netdev,
tx_old = adapter->tx_ring;
rx_old = adapter->rx_ring;

if((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
return -EINVAL;

if(netif_running(adapter->netdev))
if (netif_running(adapter->netdev))
ixgb_down(adapter, true);

rxdr->count = max(ring->rx_pending,(u32)MIN_RXD);
Expand All @@ -571,11 +571,11 @@ ixgb_set_ringparam(struct net_device *netdev,
txdr->count = min(txdr->count,(u32)MAX_TXD);
txdr->count = ALIGN(txdr->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);

if(netif_running(adapter->netdev)) {
if (netif_running(adapter->netdev)) {
/* Try to get new resources before deleting old */
if((err = ixgb_setup_rx_resources(adapter)))
if ((err = ixgb_setup_rx_resources(adapter)))
goto err_setup_rx;
if((err = ixgb_setup_tx_resources(adapter)))
if ((err = ixgb_setup_tx_resources(adapter)))
goto err_setup_tx;

/* save the new, restore the old in order to free it,
Expand All @@ -589,7 +589,7 @@ ixgb_set_ringparam(struct net_device *netdev,
ixgb_free_tx_resources(adapter);
adapter->rx_ring = rx_new;
adapter->tx_ring = tx_new;
if((err = ixgb_up(adapter)))
if ((err = ixgb_up(adapter)))
return err;
ixgb_set_speed_duplex(netdev);
}
Expand All @@ -615,7 +615,7 @@ ixgb_led_blink_callback(unsigned long data)
{
struct ixgb_adapter *adapter = (struct ixgb_adapter *)data;

if(test_and_change_bit(IXGB_LED_ON, &adapter->led_status))
if (test_and_change_bit(IXGB_LED_ON, &adapter->led_status))
ixgb_led_off(&adapter->hw);
else
ixgb_led_on(&adapter->hw);
Expand All @@ -631,7 +631,7 @@ ixgb_phys_id(struct net_device *netdev, u32 data)
if (!data)
data = INT_MAX;

if(!adapter->blink_timer.function) {
if (!adapter->blink_timer.function) {
init_timer(&adapter->blink_timer);
adapter->blink_timer.function = ixgb_led_blink_callback;
adapter->blink_timer.data = (unsigned long)adapter;
Expand Down
13 changes: 6 additions & 7 deletions drivers/net/ixgb/ixgb_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ ixgb_adapter_stop(struct ixgb_hw *hw)
/* If we are stopped or resetting exit gracefully and wait to be
* started again before accessing the hardware.
*/
if(hw->adapter_stopped) {
if (hw->adapter_stopped) {
DEBUGOUT("Exiting because the adapter is already stopped!!!\n");
return false;
}
Expand Down Expand Up @@ -482,7 +482,7 @@ ixgb_mc_addr_list_update(struct ixgb_hw *hw,
/* Place this multicast address in the RAR if there is room, *
* else put it in the MTA
*/
if(rar_used_count < IXGB_RAR_ENTRIES) {
if (rar_used_count < IXGB_RAR_ENTRIES) {
ixgb_rar_set(hw,
mc_addr_list +
(i * (IXGB_ETH_LENGTH_OF_ADDRESS + pad)),
Expand Down Expand Up @@ -719,24 +719,23 @@ ixgb_setup_fc(struct ixgb_hw *hw)
/* Write the new settings */
IXGB_WRITE_REG(hw, CTRL0, ctrl_reg);

if (pap_reg != 0) {
if (pap_reg != 0)
IXGB_WRITE_REG(hw, PAP, pap_reg);
}

/* Set the flow control receive threshold registers. Normally,
* these registers will be set to a default threshold that may be
* adjusted later by the driver's runtime code. However, if the
* ability to transmit pause frames in not enabled, then these
* registers will be set to 0.
*/
if(!(hw->fc.type & ixgb_fc_tx_pause)) {
if (!(hw->fc.type & ixgb_fc_tx_pause)) {
IXGB_WRITE_REG(hw, FCRTL, 0);
IXGB_WRITE_REG(hw, FCRTH, 0);
} else {
/* We need to set up the Receive Threshold high and low water
* marks as well as (optionally) enabling the transmission of XON
* frames. */
if(hw->fc.send_xon) {
if (hw->fc.send_xon) {
IXGB_WRITE_REG(hw, FCRTL,
(hw->fc.low_water | IXGB_FCRTL_XONE));
} else {
Expand Down Expand Up @@ -1007,7 +1006,7 @@ ixgb_clear_hw_cntrs(struct ixgb_hw *hw)
DEBUGFUNC("ixgb_clear_hw_cntrs");

/* if we are stopped or resetting exit gracefully */
if(hw->adapter_stopped) {
if (hw->adapter_stopped) {
DEBUGOUT("Exiting because the adapter is stopped!!!\n");
return;
}
Expand Down
Loading

0 comments on commit 03f8304

Please sign in to comment.