From 359a118aa0fb6215e095380c99806183b7a8ba81 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Mon, 13 Oct 2003 18:35:30 -0700 Subject: [PATCH] Avoid unnecessary floating point calculations in amd8111e net driver --- drivers/net/amd8111e.c | 6 +++--- drivers/net/amd8111e.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c index bc9e1bfc72209..33314f1105353 100755 --- a/drivers/net/amd8111e.c +++ b/drivers/net/amd8111e.c @@ -1698,7 +1698,7 @@ static int amd8111e_resume(struct pci_dev *pci_dev) /* Restart ipg timer */ if(lp->options & OPTION_DYN_IPG_ENABLE) mod_timer(&lp->ipg_data.ipg_timer, - jiffies + (IPG_CONVERGE_TIME * HZ)); + jiffies + IPG_CONVERGE_JIFFIES); spin_unlock_irq(&lp->lock); return 0; @@ -1772,7 +1772,7 @@ static void amd8111e_config_ipg(struct net_device* dev) writew((u32)tmp_ipg, mmio + IPG); 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; } @@ -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.function = (void *)&amd8111e_config_ipg; lp->ipg_data.ipg_timer.expires = jiffies + - IPG_CONVERGE_TIME * HZ; + IPG_CONVERGE_JIFFIES; lp->ipg_data.ipg = DEFAULT_IPG; lp->ipg_data.ipg_state = CSTATE; }; diff --git a/drivers/net/amd8111e.h b/drivers/net/amd8111e.h index d751dc8dd53d8..836277399b8a9 100755 --- a/drivers/net/amd8111e.h +++ b/drivers/net/amd8111e.h @@ -606,7 +606,7 @@ typedef enum { /* ipg parameters */ #define DEFAULT_IPG 0x60 #define IFS1_DELTA 36 -#define IPG_CONVERGE_TIME 0.5 +#define IPG_CONVERGE_JIFFIES (HZ / 2) #define IPG_STABLE_TIME 5 #define MIN_IPG 96 #define MAX_IPG 255 -- 2.53.0