@@ -1693,9 +1693,9 @@ bnad_rx_res_alloc(struct bnad *bnad, struct bna_res_info *res_info,
1693
1693
/* Timer callbacks */
1694
1694
/* a) IOC timer */
1695
1695
static void
1696
- bnad_ioc_timeout (unsigned long data )
1696
+ bnad_ioc_timeout (struct timer_list * t )
1697
1697
{
1698
- struct bnad * bnad = ( struct bnad * ) data ;
1698
+ struct bnad * bnad = from_timer ( bnad , t , bna . ioceth . ioc . ioc_timer ) ;
1699
1699
unsigned long flags ;
1700
1700
1701
1701
spin_lock_irqsave (& bnad -> bna_lock , flags );
@@ -1704,9 +1704,9 @@ bnad_ioc_timeout(unsigned long data)
1704
1704
}
1705
1705
1706
1706
static void
1707
- bnad_ioc_hb_check (unsigned long data )
1707
+ bnad_ioc_hb_check (struct timer_list * t )
1708
1708
{
1709
- struct bnad * bnad = ( struct bnad * ) data ;
1709
+ struct bnad * bnad = from_timer ( bnad , t , bna . ioceth . ioc . hb_timer ) ;
1710
1710
unsigned long flags ;
1711
1711
1712
1712
spin_lock_irqsave (& bnad -> bna_lock , flags );
@@ -1715,9 +1715,9 @@ bnad_ioc_hb_check(unsigned long data)
1715
1715
}
1716
1716
1717
1717
static void
1718
- bnad_iocpf_timeout (unsigned long data )
1718
+ bnad_iocpf_timeout (struct timer_list * t )
1719
1719
{
1720
- struct bnad * bnad = ( struct bnad * ) data ;
1720
+ struct bnad * bnad = from_timer ( bnad , t , bna . ioceth . ioc . iocpf_timer ) ;
1721
1721
unsigned long flags ;
1722
1722
1723
1723
spin_lock_irqsave (& bnad -> bna_lock , flags );
@@ -1726,9 +1726,9 @@ bnad_iocpf_timeout(unsigned long data)
1726
1726
}
1727
1727
1728
1728
static void
1729
- bnad_iocpf_sem_timeout (unsigned long data )
1729
+ bnad_iocpf_sem_timeout (struct timer_list * t )
1730
1730
{
1731
- struct bnad * bnad = ( struct bnad * ) data ;
1731
+ struct bnad * bnad = from_timer ( bnad , t , bna . ioceth . ioc . sem_timer ) ;
1732
1732
unsigned long flags ;
1733
1733
1734
1734
spin_lock_irqsave (& bnad -> bna_lock , flags );
@@ -1748,9 +1748,9 @@ bnad_iocpf_sem_timeout(unsigned long data)
1748
1748
1749
1749
/* b) Dynamic Interrupt Moderation Timer */
1750
1750
static void
1751
- bnad_dim_timeout (unsigned long data )
1751
+ bnad_dim_timeout (struct timer_list * t )
1752
1752
{
1753
- struct bnad * bnad = ( struct bnad * ) data ;
1753
+ struct bnad * bnad = from_timer ( bnad , t , dim_timer ) ;
1754
1754
struct bnad_rx_info * rx_info ;
1755
1755
struct bnad_rx_ctrl * rx_ctrl ;
1756
1756
int i , j ;
@@ -1781,9 +1781,9 @@ bnad_dim_timeout(unsigned long data)
1781
1781
1782
1782
/* c) Statistics Timer */
1783
1783
static void
1784
- bnad_stats_timeout (unsigned long data )
1784
+ bnad_stats_timeout (struct timer_list * t )
1785
1785
{
1786
- struct bnad * bnad = ( struct bnad * ) data ;
1786
+ struct bnad * bnad = from_timer ( bnad , t , stats_timer ) ;
1787
1787
unsigned long flags ;
1788
1788
1789
1789
if (!netif_running (bnad -> netdev ) ||
@@ -1804,8 +1804,7 @@ bnad_dim_timer_start(struct bnad *bnad)
1804
1804
{
1805
1805
if (bnad -> cfg_flags & BNAD_CF_DIM_ENABLED &&
1806
1806
!test_bit (BNAD_RF_DIM_TIMER_RUNNING , & bnad -> run_flags )) {
1807
- setup_timer (& bnad -> dim_timer , bnad_dim_timeout ,
1808
- (unsigned long )bnad );
1807
+ timer_setup (& bnad -> dim_timer , bnad_dim_timeout , 0 );
1809
1808
set_bit (BNAD_RF_DIM_TIMER_RUNNING , & bnad -> run_flags );
1810
1809
mod_timer (& bnad -> dim_timer ,
1811
1810
jiffies + msecs_to_jiffies (BNAD_DIM_TIMER_FREQ ));
@@ -1823,8 +1822,7 @@ bnad_stats_timer_start(struct bnad *bnad)
1823
1822
1824
1823
spin_lock_irqsave (& bnad -> bna_lock , flags );
1825
1824
if (!test_and_set_bit (BNAD_RF_STATS_TIMER_RUNNING , & bnad -> run_flags )) {
1826
- setup_timer (& bnad -> stats_timer , bnad_stats_timeout ,
1827
- (unsigned long )bnad );
1825
+ timer_setup (& bnad -> stats_timer , bnad_stats_timeout , 0 );
1828
1826
mod_timer (& bnad -> stats_timer ,
1829
1827
jiffies + msecs_to_jiffies (BNAD_STATS_TIMER_FREQ ));
1830
1828
}
@@ -3692,14 +3690,11 @@ bnad_pci_probe(struct pci_dev *pdev,
3692
3690
goto res_free ;
3693
3691
3694
3692
/* Set up timers */
3695
- setup_timer (& bnad -> bna .ioceth .ioc .ioc_timer , bnad_ioc_timeout ,
3696
- (unsigned long )bnad );
3697
- setup_timer (& bnad -> bna .ioceth .ioc .hb_timer , bnad_ioc_hb_check ,
3698
- (unsigned long )bnad );
3699
- setup_timer (& bnad -> bna .ioceth .ioc .iocpf_timer , bnad_iocpf_timeout ,
3700
- (unsigned long )bnad );
3701
- setup_timer (& bnad -> bna .ioceth .ioc .sem_timer , bnad_iocpf_sem_timeout ,
3702
- (unsigned long )bnad );
3693
+ timer_setup (& bnad -> bna .ioceth .ioc .ioc_timer , bnad_ioc_timeout , 0 );
3694
+ timer_setup (& bnad -> bna .ioceth .ioc .hb_timer , bnad_ioc_hb_check , 0 );
3695
+ timer_setup (& bnad -> bna .ioceth .ioc .iocpf_timer , bnad_iocpf_timeout , 0 );
3696
+ timer_setup (& bnad -> bna .ioceth .ioc .sem_timer , bnad_iocpf_sem_timeout ,
3697
+ 0 );
3703
3698
3704
3699
/*
3705
3700
* Start the chip
0 commit comments