drivers/net/wan/: possible cleanups
Subsystems (5)
PATCH 1/1 drivers/net/wan/: possible cleanups
This patch contains the following possible cleanups:
- make needlessly global code static
- #if 0 the following unused global function:
- sdladrv.c: sdla_intde
- remove the following unused global variable:
- lmc_media.c: lmc_t1_cables
- remove the following unneeded EXPORT_SYMBOL's:
- cycx_drv.c: cycx_inten
- sdladrv.c: sdla_inten
- sdladrv.c: sdla_intde
- sdladrv.c: sdla_intack
- sdladrv.c: sdla_intr
- syncppp.c: sppp_input
- syncppp.c: sppp_change_mtu
- z85230.c: z8530_dma_sync
- z85230.c: z8530_txdma_sync
Signed-off-by Adrian Bunk <[email protected]>
---
This patch was already sent on:
- 19 Feb 2005
drivers/net/wan/cycx_drv.c | 7 +- drivers/net/wan/cycx_main.c | 2 drivers/net/wan/farsync.c | 24 ++++---- drivers/net/wan/hdlc_fr.c | 2 drivers/net/wan/lmc/lmc_media.c | 8 -- drivers/net/wan/pc300.h | 16 ----- drivers/net/wan/pc300_drv.c | 87 ++++++++++++++++---------------- drivers/net/wan/sdla.c | 20 +++---- drivers/net/wan/sdladrv.c | 16 ++--- drivers/net/wan/syncppp.c | 10 +-- drivers/net/wan/z85230.c | 8 -- include/linux/cycx_drv.h | 1 include/linux/sdladrv.h | 4 - include/net/syncppp.h | 1
include/linux/cycx_drv.h renamed from include/linux/cycx_drv.h.old +0 -1
@@ -60,6 +60,5 @@extern int cycx_poke (struct cycx_hw *hw,u32 addr,void *buf,u32 len);extern int cycx_exec (void __iomem *addr); -extern void cycx_inten (struct cycx_hw *hw);extern void cycx_intr (struct cycx_hw *hw);#endif /* _CYCX_DRV_H */
drivers/net/wan/cycx_drv.c renamed from drivers/net/wan/cycx_drv.c.old +3 -4
@@ -110,7 +110,7 @@* < 0 error. * Context: process */ -int __init cycx_drv_init (void ) +static int __init cycx_drv_init (void ) {printk (KERN_INFO "%s v%u.%u %s\n" , fullname,MOD_VERSION ,MOD_RELEASE , copyright);
@@ -120,7 +120,7 @@/* Module 'remove' entry point. * o release all remaining system resources */ -void cycx_drv_cleanup (void ) +static void cycx_drv_cleanup (void ) { }
@@ -185,8 +185,7 @@ }/* Enable interrupt generation. */ -EXPORT_SYMBOL (cycx_inten); -void cycx_inten (struct cycx_hw *hw) +static void cycx_inten (struct cycx_hw *hw) {writeb (0 , hw->dpmbase); }
drivers/net/wan/cycx_main.c renamed from drivers/net/wan/cycx_main.c.old +1 -1
@@ -103,7 +103,7 @@* < 0 error. * Context: process */ -int __init cycx_init (void ) +static int __init cycx_init (void ) {int cnt, err = -ENOMEM ;
drivers/net/wan/farsync.c renamed from drivers/net/wan/farsync.c.old +12 -12
@@ -74,11 +74,11 @@/* * Modules parameters and associated varaibles */ -int fst_txq_low =FST_LOW_WATER_MARK ; -int fst_txq_high =FST_HIGH_WATER_MARK ; -int fst_max_reads =7 ; -int fst_excluded_cards =0 ; -int fst_excluded_list[FST_MAX_CARDS ]; +static int fst_txq_low =FST_LOW_WATER_MARK ; +static int fst_txq_high =FST_HIGH_WATER_MARK ; +static int fst_max_reads =7 ; +static int fst_excluded_cards =0 ; +static int fst_excluded_list[FST_MAX_CARDS ];module_param (fst_txq_low, int,0 );module_param (fst_txq_high, int,0 );
@@ -572,13 +572,13 @@static void fst_process_tx_work_q (unsigned long work_q);static void fst_process_int_work_q (unsigned long work_q); -DECLARE_TASKLET (fst_tx_task, fst_process_tx_work_q,0 ); -DECLARE_TASKLET (fst_int_task, fst_process_int_work_q,0 ); +static DECLARE_TASKLET(fst_tx_task, fst_process_tx_work_q, 0); +static DECLARE_TASKLET(fst_int_task, fst_process_int_work_q, 0); -struct fst_card_info *fst_card_array[FST_MAX_CARDS ]; -spinlock_t fst_work_q_lock; -u64 fst_work_txq; -u64 fst_work_intq; +static struct fst_card_info *fst_card_array[FST_MAX_CARDS ]; +static spinlock_t fst_work_q_lock; +static u64 fst_work_txq; +static u64 fst_work_intq;static void fst_q_work_item (u64 * queue,int card_index)
@@ -1498,7 +1498,7 @@* The interrupt service routine * Dev_id is our fst_card_info pointer */ -irqreturn_t +static irqreturn_t fst_intr (int irq,void *dev_id,struct pt_regs *regs) {struct fst_card_info *card;
drivers/net/wan/hdlc_fr.c renamed from drivers/net/wan/hdlc_fr.c.old +1 -1
@@ -347,7 +347,7 @@ -int pvc_ioctl (struct net_device *dev,struct ifreq *ifr,int cmd) +static int pvc_ioctl (struct net_device *dev,struct ifreq *ifr,int cmd) {pvc_device *pvc =dev_to_pvc (dev);fr_proto_pvc_info info;
drivers/net/wan/lmc/lmc_media.c renamed from drivers/net/wan/lmc/lmc_media.c.old +0 -8
@@ -48,14 +48,6 @@*/ /* -* For lack of a better place, put the SSI cable stuff here. -*/ -char *lmc_t1_cables[] = { -"V.10/RS423" ,"EIA530A" ,"reserved" ,"X.21" ,"V.35" , -"EIA449/EIA530/V.36" ,"V.28/EIA232" ,"none" ,NULL -}; - -/* * protocol independent method. */ static void lmc_set_protocol (lmc_softc_t *const ,lmc_ctl_t *);
drivers/net/wan/pc300.h renamed from drivers/net/wan/pc300.h.old +0 -16
@@ -472,24 +472,8 @@#ifdef __KERNEL__/* Function Prototypes */ -int dma_buf_write (pc300_t *,int ,ucchar *,int ); -int dma_buf_read (pc300_t *,int ,struct sk_buff *);void tx_dma_start (pc300_t *,int ); -void rx_dma_start (pc300_t *,int ); -void tx_dma_stop (pc300_t *,int ); -void rx_dma_stop (pc300_t *,int ); -int cpc_queue_xmit (struct sk_buff *,struct net_device *); -void cpc_net_rx (struct net_device *); -void cpc_sca_status (pc300_t *,int ); -int cpc_change_mtu (struct net_device *,int ); -int cpc_ioctl (struct net_device *,struct ifreq *,int ); -int ch_config (pc300dev_t *); -int rx_config (pc300dev_t *); -int tx_config (pc300dev_t *); -void cpc_opench (pc300dev_t *); -void cpc_closech (pc300dev_t *);int cpc_open (struct net_device *dev); -int cpc_close (struct net_device *dev);int cpc_set_media (hdlc_device *,int );#endif /* __KERNEL__ */
drivers/net/wan/pc300_drv.c renamed from drivers/net/wan/pc300_drv.c.old +44 -43
351 lines not on this page · raw message
drivers/net/wan/sdla.c renamed from drivers/net/wan/sdla.c.old +10 -10
@@ -182,7 +182,7 @@return (byte); } -void sdla_stop (struct net_device *dev) +static void sdla_stop (struct net_device *dev) {struct frad_local *flp;
@@ -209,7 +209,7 @@ } } -void sdla_start (struct net_device *dev) +static void sdla_start (struct net_device *dev) {struct frad_local *flp;
@@ -247,7 +247,7 @@* ***************************************************/ -int sdla_z80_poll (struct net_device *dev,int z80_addr,int jiffs,char resp1,char resp2) +static int sdla_z80_poll (struct net_device *dev,int z80_addr,int jiffs,char resp1,char resp2) {unsigned long start, done, now;char resp, *temp;
@@ -505,7 +505,7 @@static int sdla_reconfig (struct net_device *dev); -int sdla_activate (struct net_device *slave,struct net_device *master) +static int sdla_activate (struct net_device *slave,struct net_device *master) {struct frad_local *flp;int i;
@@ -527,7 +527,7 @@return (0 ); } -int sdla_deactivate (struct net_device *slave,struct net_device *master) +static int sdla_deactivate (struct net_device *slave,struct net_device *master) {struct frad_local *flp;int i;
@@ -549,7 +549,7 @@return (0 ); } -int sdla_assoc (struct net_device *slave,struct net_device *master) +static int sdla_assoc (struct net_device *slave,struct net_device *master) {struct frad_local *flp;int i;
@@ -585,7 +585,7 @@return (0 ); } -int sdla_deassoc (struct net_device *slave,struct net_device *master) +static int sdla_deassoc (struct net_device *slave,struct net_device *master) {struct frad_local *flp;int i;
@@ -613,7 +613,7 @@return (0 ); } -int sdla_dlci_conf (struct net_device *slave,struct net_device *master,int get) +static int sdla_dlci_conf (struct net_device *slave,struct net_device *master,int get) {struct frad_local *flp;struct dlci_local *dlp;
@@ -1324,7 +1324,7 @@return (0 ); } -int sdla_change_mtu (struct net_device *dev,int new_mtu) +static int sdla_change_mtu (struct net_device *dev,int new_mtu) {struct frad_local *flp;
@@ -1337,7 +1337,7 @@return (-EOPNOTSUPP ); } -int sdla_set_config (struct net_device *dev,struct ifmap *map) +static int sdla_set_config (struct net_device *dev,struct ifmap *map) {struct frad_local *flp;int i;
include/linux/sdladrv.h renamed from include/linux/sdladrv.h.old +0 -4
@@ -52,12 +52,8 @@extern int sdla_setup (sdlahw_t * hw,void * sfm,unsigned len);extern int sdla_down (sdlahw_t * hw); -extern int sdla_inten (sdlahw_t * hw); -extern int sdla_intde (sdlahw_t * hw); -extern int sdla_intack (sdlahw_t * hw);extern void S514_intack (sdlahw_t * hw,u32 int_status);extern void read_S514_int_stat (sdlahw_t * hw,u32 * int_status); -extern int sdla_intr (sdlahw_t * hw);extern int sdla_mapmem (sdlahw_t * hw,unsigned long addr);extern int sdla_peek (sdlahw_t * hw,unsigned long addr,void * buf,unsigned len);
drivers/net/wan/sdladrv.c renamed from drivers/net/wan/sdladrv.c.old +6 -10
@@ -642,9 +642,7 @@* Enable interrupt generation. */ -EXPORT_SYMBOL (sdla_inten); - -int sdla_inten (sdlahw_t * hw) +static int sdla_inten (sdlahw_t * hw) {unsigned port = hw->port;int tmp, i;
@@ -698,8 +696,7 @@* Disable interrupt generation. */ -EXPORT_SYMBOL (sdla_intde); - +#if 0 int sdla_intde (sdlahw_t * hw) {unsigned port = hw->port;
@@ -748,14 +745,13 @@ }return 0 ; } +#endif /* 0 */ /*============================================================================ * Acknowledge SDLA hardware interrupt. */ -EXPORT_SYMBOL (sdla_intack); - -int sdla_intack (sdlahw_t * hw) +static int sdla_intack (sdlahw_t * hw) {unsigned port = hw->port;int tmp;
@@ -827,8 +823,7 @@* Generate an interrupt to adapter's CPU. */ -EXPORT_SYMBOL (sdla_intr); - +#if 0 int sdla_intr (sdlahw_t * hw) {unsigned port = hw->port;
@@ -863,6 +858,7 @@ }return 0 ; } +#endif /* 0 */ /*============================================================================ * Execute Adapter Command.
include/net/syncppp.h renamed from include/net/syncppp.h.old +0 -1
@@ -86,7 +86,6 @@void sppp_attach (struct ppp_device *pd);void sppp_detach (struct net_device *dev); -void sppp_input (struct net_device *dev,struct sk_buff *m);int sppp_do_ioctl (struct net_device *dev,struct ifreq *ifr,int cmd);struct sk_buff *sppp_dequeue (struct net_device *dev);int sppp_isempty (struct net_device *dev);
drivers/net/wan/syncppp.c renamed from drivers/net/wan/syncppp.c.old +3 -7
@@ -221,7 +221,7 @@* here. */ -void sppp_input (struct net_device *dev,struct sk_buff *skb) +static void sppp_input (struct net_device *dev,struct sk_buff *skb) {struct ppp_header *h;struct sppp *sp = (struct sppp *)sppp_of (dev);
@@ -355,8 +355,6 @@return ; } -EXPORT_SYMBOL (sppp_input); -/* * Handle transmit packets. */
@@ -990,7 +988,7 @@* the mtu is out of range. */ -int sppp_change_mtu (struct net_device *dev,int new_mtu) +static int sppp_change_mtu (struct net_device *dev,int new_mtu) {if (new_mtu<128 ||new_mtu>PPP_MTU ||(dev->flags&IFF_UP ))return -EINVAL ;
@@ -998,8 +996,6 @@return 0 ; } -EXPORT_SYMBOL (sppp_change_mtu); -/** * sppp_do_ioctl - Ioctl handler for ppp/hdlc * @dev: Device subject to ioctl
@@ -1455,7 +1451,7 @@return 0 ; } -struct packet_type sppp_packet_type = { +static struct packet_type sppp_packet_type = { .type =__constant_htons (ETH_P_WAN_PPP ), .func = sppp_rcv, };
drivers/net/wan/z85230.c renamed from drivers/net/wan/z85230.c.old +2 -6
@@ -621,24 +621,20 @@spin_unlock (chan->lock); } -struct z8530_irqhandler z8530_dma_sync= +static struct z8530_irqhandler z8530_dma_sync = { z8530_dma_rx, z8530_dma_tx, z8530_dma_status }; -EXPORT_SYMBOL (z8530_dma_sync); - -struct z8530_irqhandler z8530_txdma_sync= +static struct z8530_irqhandler z8530_txdma_sync = { z8530_rx, z8530_dma_tx, z8530_dma_status }; -EXPORT_SYMBOL (z8530_txdma_sync); -/** * z8530_rx_clear - Handle RX events from a stopped chip * @c: Z8530 channel to shut up
BTW, please send to [email protected] not linux-net.