Commit 359a118a authored by Linus Torvalds's avatar Linus Torvalds

Avoid unnecessary floating point calculations in amd8111e net driver

parent 75ab7f1d
...@@ -1698,7 +1698,7 @@ static int amd8111e_resume(struct pci_dev *pci_dev) ...@@ -1698,7 +1698,7 @@ static int amd8111e_resume(struct pci_dev *pci_dev)
/* Restart ipg timer */ /* Restart ipg timer */
if(lp->options & OPTION_DYN_IPG_ENABLE) if(lp->options & OPTION_DYN_IPG_ENABLE)
mod_timer(&lp->ipg_data.ipg_timer, mod_timer(&lp->ipg_data.ipg_timer,
jiffies + (IPG_CONVERGE_TIME * HZ)); jiffies + IPG_CONVERGE_JIFFIES);
spin_unlock_irq(&lp->lock); spin_unlock_irq(&lp->lock);
return 0; return 0;
...@@ -1772,7 +1772,7 @@ static void amd8111e_config_ipg(struct net_device* dev) ...@@ -1772,7 +1772,7 @@ static void amd8111e_config_ipg(struct net_device* dev)
writew((u32)tmp_ipg, mmio + IPG); writew((u32)tmp_ipg, mmio + IPG);
writew((u32)(tmp_ipg - IFS1_DELTA), mmio + IFS1); writew((u32)(tmp_ipg - IFS1_DELTA), mmio + IFS1);
} }
mod_timer(&lp->ipg_data.ipg_timer, jiffies + (IPG_CONVERGE_TIME * HZ)); mod_timer(&lp->ipg_data.ipg_timer, jiffies + IPG_CONVERGE_JIFFIES);
return; return;
} }
...@@ -1909,7 +1909,7 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev, ...@@ -1909,7 +1909,7 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
lp->ipg_data.ipg_timer.data = (unsigned long) dev; lp->ipg_data.ipg_timer.data = (unsigned long) dev;
lp->ipg_data.ipg_timer.function = (void *)&amd8111e_config_ipg; lp->ipg_data.ipg_timer.function = (void *)&amd8111e_config_ipg;
lp->ipg_data.ipg_timer.expires = jiffies + lp->ipg_data.ipg_timer.expires = jiffies +
IPG_CONVERGE_TIME * HZ; IPG_CONVERGE_JIFFIES;
lp->ipg_data.ipg = DEFAULT_IPG; lp->ipg_data.ipg = DEFAULT_IPG;
lp->ipg_data.ipg_state = CSTATE; lp->ipg_data.ipg_state = CSTATE;
}; };
......
...@@ -606,7 +606,7 @@ typedef enum { ...@@ -606,7 +606,7 @@ typedef enum {
/* ipg parameters */ /* ipg parameters */
#define DEFAULT_IPG 0x60 #define DEFAULT_IPG 0x60
#define IFS1_DELTA 36 #define IFS1_DELTA 36
#define IPG_CONVERGE_TIME 0.5 #define IPG_CONVERGE_JIFFIES (HZ / 2)
#define IPG_STABLE_TIME 5 #define IPG_STABLE_TIME 5
#define MIN_IPG 96 #define MIN_IPG 96
#define MAX_IPG 255 #define MAX_IPG 255
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment