atl1[ce]: fix sparse warnings
authorstephen hemminger <shemminger@vyatta.com>
Wed, 23 Feb 2011 09:06:49 +0000 (09:06 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Feb 2011 22:11:31 +0000 (14:11 -0800)
The dmaw_block is an enum and max_pay_load is u32. Therefore
sparse gives warning about comparison of unsigned and signed value.
Resolve by using min_t to force cast.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/atl1c/atl1c_main.c
drivers/net/atl1e/atl1e_main.c

index e60595f0247c4ff5530de1138d732ad70440e065..7d9d5067a65ce1bb368bd2128d75c5ef87446828 100644 (file)
@@ -1102,10 +1102,10 @@ static void atl1c_configure_tx(struct atl1c_adapter *adapter)
        AT_READ_REG(hw, REG_DEVICE_CTRL, &dev_ctrl_data);
        max_pay_load  = (dev_ctrl_data >> DEVICE_CTRL_MAX_PAYLOAD_SHIFT) &
                        DEVICE_CTRL_MAX_PAYLOAD_MASK;
-       hw->dmaw_block = min(max_pay_load, hw->dmaw_block);
+       hw->dmaw_block = min_t(u32, max_pay_load, hw->dmaw_block);
        max_pay_load  = (dev_ctrl_data >> DEVICE_CTRL_MAX_RREQ_SZ_SHIFT) &
                        DEVICE_CTRL_MAX_RREQ_SZ_MASK;
-       hw->dmar_block = min(max_pay_load, hw->dmar_block);
+       hw->dmar_block = min_t(u32, max_pay_load, hw->dmar_block);
 
        txq_ctrl_data = (hw->tpd_burst & TXQ_NUM_TPD_BURST_MASK) <<
                        TXQ_NUM_TPD_BURST_SHIFT;
index bf7500ccd73f9fe57a4182d064baba77ad2db11b..21f5011840235dc15e4130498af2f4eb3d60c30c 100644 (file)
@@ -932,11 +932,11 @@ static inline void atl1e_configure_tx(struct atl1e_adapter *adapter)
        max_pay_load  = ((dev_ctrl_data >> DEVICE_CTRL_MAX_PAYLOAD_SHIFT)) &
                        DEVICE_CTRL_MAX_PAYLOAD_MASK;
 
-       hw->dmaw_block = min(max_pay_load, hw->dmaw_block);
+       hw->dmaw_block = min_t(u32, max_pay_load, hw->dmaw_block);
 
        max_pay_load  = ((dev_ctrl_data >> DEVICE_CTRL_MAX_RREQ_SZ_SHIFT)) &
                        DEVICE_CTRL_MAX_RREQ_SZ_MASK;
-       hw->dmar_block = min(max_pay_load, hw->dmar_block);
+       hw->dmar_block = min_t(u32, max_pay_load, hw->dmar_block);
 
        if (hw->nic_type != athr_l2e_revB)
                AT_WRITE_REGW(hw, REG_TXQ_CTRL + 2,