[PATCH] drivers/isdn/i4l/: possible cleanups

This patch contains the following possible cleanups:
- make needlessly global code static
- remove the following unused global function:
- isdn_audio.c: isdn_audio_2adpcm_flush
- remove the following unused struct:
- isdn_net.c: isdn_concap_demand_dial_dops

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Adrian Bunk and committed by Linus Torvalds 3e206b0a 886cca3a

+34 -57
-10
drivers/isdn/i4l/isdn_audio.c
··· 392 392 } 393 393 394 394 int 395 - isdn_audio_2adpcm_flush(adpcm_state * s, unsigned char *out) 396 - { 397 - int olen = 0; 398 - 399 - if (s->nleft) 400 - isdn_audio_put_bits(0, 8 - s->nleft, s, &out, &olen); 401 - return olen; 402 - } 403 - 404 - int 405 395 isdn_audio_xlaw2adpcm(adpcm_state * s, int fmt, unsigned char *in, 406 396 unsigned char *out, int len) 407 397 {
-1
drivers/isdn/i4l/isdn_audio.h
··· 35 35 extern adpcm_state *isdn_audio_adpcm_init(adpcm_state *, int); 36 36 extern int isdn_audio_adpcm2xlaw(adpcm_state *, int, unsigned char *, unsigned char *, int); 37 37 extern int isdn_audio_xlaw2adpcm(adpcm_state *, int, unsigned char *, unsigned char *, int); 38 - extern int isdn_audio_2adpcm_flush(adpcm_state * s, unsigned char *out); 39 38 extern void isdn_audio_calc_dtmf(modem_info *, unsigned char *, int, int); 40 39 extern void isdn_audio_eval_dtmf(modem_info *); 41 40 dtmf_state *isdn_audio_dtmf_init(dtmf_state *);
+3 -3
drivers/isdn/i4l/isdn_common.c
··· 67 67 static int isdn_writebuf_stub(int, int, const u_char __user *, int); 68 68 static void set_global_features(void); 69 69 static int isdn_wildmat(char *s, char *p); 70 - 70 + static int isdn_add_channels(isdn_driver_t *d, int drvidx, int n, int adding); 71 71 72 72 static inline void 73 73 isdn_lock_driver(isdn_driver_t *drv) ··· 388 388 */ 389 389 #include <linux/isdn/capicmd.h> 390 390 391 - int 391 + static int 392 392 isdn_capi_rec_hl_msg(capi_msg *cm) { 393 393 394 394 int di; ··· 1923 1923 return ret; 1924 1924 } 1925 1925 1926 - int 1926 + static int 1927 1927 isdn_add_channels(isdn_driver_t *d, int drvidx, int n, int adding) 1928 1928 { 1929 1929 int j, k, m;
-1
drivers/isdn/i4l/isdn_common.h
··· 41 41 extern int isdn_writebuf_skb_stub(int, int, int, struct sk_buff *); 42 42 extern int register_isdn(isdn_if * i); 43 43 extern int isdn_msncmp( const char *, const char *); 44 - extern int isdn_add_channels(isdn_driver_t *, int, int, int); 45 44 #if defined(ISDN_DEBUG_NET_DUMP) || defined(ISDN_DEBUG_MODEM_DUMP) 46 45 extern void isdn_dumppkt(char *, u_char *, int, int); 47 46 #endif
+3 -12
drivers/isdn/i4l/isdn_concap.c
··· 39 39 */ 40 40 41 41 42 - int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb) 42 + static int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb) 43 43 { 44 44 struct net_device *ndev = concap -> net_dev; 45 45 isdn_net_dev *nd = ((isdn_net_local *) ndev->priv)->netdev; ··· 58 58 } 59 59 60 60 61 - int isdn_concap_dl_connect_req(struct concap_proto *concap) 61 + static int isdn_concap_dl_connect_req(struct concap_proto *concap) 62 62 { 63 63 struct net_device *ndev = concap -> net_dev; 64 64 isdn_net_local *lp = (isdn_net_local *) ndev->priv; ··· 71 71 return ret; 72 72 } 73 73 74 - int isdn_concap_dl_disconn_req(struct concap_proto *concap) 74 + static int isdn_concap_dl_disconn_req(struct concap_proto *concap) 75 75 { 76 76 IX25DEBUG( "isdn_concap_dl_disconn_req: %s \n", concap -> net_dev -> name); 77 77 ··· 83 83 &isdn_concap_dl_data_req, 84 84 &isdn_concap_dl_connect_req, 85 85 &isdn_concap_dl_disconn_req 86 - }; 87 - 88 - struct concap_device_ops isdn_concap_demand_dial_dops = { 89 - NULL, /* set this first entry to something like &isdn_net_start_xmit, 90 - but the entry part of the current isdn_net_start_xmit must be 91 - separated first. */ 92 - /* no connection control for demand dial semantics */ 93 - NULL, 94 - NULL, 95 86 }; 96 87 97 88 /* The following should better go into a dedicated source file such that
-1
drivers/isdn/i4l/isdn_concap.h
··· 8 8 */ 9 9 10 10 extern struct concap_device_ops isdn_concap_reliable_dl_dops; 11 - extern struct concap_device_ops isdn_concap_demand_dial_dops; 12 11 extern struct concap_proto * isdn_concap_new( int ); 13 12 14 13
+5 -5
drivers/isdn/i4l/isdn_net.c
··· 176 176 177 177 /* Prototypes */ 178 178 179 - int isdn_net_force_dial_lp(isdn_net_local *); 179 + static int isdn_net_force_dial_lp(isdn_net_local *); 180 180 static int isdn_net_start_xmit(struct sk_buff *, struct net_device *); 181 181 182 182 static void isdn_net_ciscohdlck_connected(isdn_net_local *lp); ··· 312 312 * Since this function is called every second, simply reset the 313 313 * byte-counter of the interface after copying it to the cps-variable. 314 314 */ 315 - unsigned long last_jiffies = -HZ; 315 + static unsigned long last_jiffies = -HZ; 316 316 317 317 void 318 318 isdn_net_autohup(void) ··· 1131 1131 } 1132 1132 1133 1133 1134 - void isdn_net_tx_timeout(struct net_device * ndev) 1134 + static void isdn_net_tx_timeout(struct net_device * ndev) 1135 1135 { 1136 1136 isdn_net_local *lp = (isdn_net_local *) ndev->priv; 1137 1137 ··· 1424 1424 } 1425 1425 1426 1426 /* cisco hdlck device private ioctls */ 1427 - int 1427 + static int 1428 1428 isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 1429 1429 { 1430 1430 isdn_net_local *lp = (isdn_net_local *) dev->priv; ··· 2461 2461 * This is called from the userlevel-routine below or 2462 2462 * from isdn_net_start_xmit(). 2463 2463 */ 2464 - int 2464 + static int 2465 2465 isdn_net_force_dial_lp(isdn_net_local * lp) 2466 2466 { 2467 2467 if ((!(lp->flags & ISDN_NET_CONNECTED)) && !lp->dialstate) {
+2 -2
drivers/isdn/i4l/isdn_tty.c
··· 273 273 return 1; 274 274 } 275 275 276 - void 276 + static void 277 277 isdn_tty_cleanup_xmit(modem_info * info) 278 278 { 279 279 skb_queue_purge(&info->xmit_queue); ··· 560 560 /* 561 561 * return the usage calculated by si and layer 2 protocol 562 562 */ 563 - int 563 + static int 564 564 isdn_calc_usage(int si, int l2) 565 565 { 566 566 int usg = ISDN_USAGE_MODEM;
-1
drivers/isdn/i4l/isdn_tty.h
··· 109 109 extern void isdn_tty_exit(void); 110 110 extern void isdn_tty_readmodem(void); 111 111 extern int isdn_tty_find_icall(int, int, setup_parm *); 112 - extern void isdn_tty_cleanup_xmit(modem_info *); 113 112 extern int isdn_tty_stat_callback(int, isdn_ctrl *); 114 113 extern int isdn_tty_rcv_skb(int, int, int, struct sk_buff *); 115 114 extern int isdn_tty_capi_facility(capi_msg *cm);
+3 -3
drivers/isdn/i4l/isdn_ttyfax.c
··· 148 148 } 149 149 } 150 150 151 - int 151 + static int 152 152 isdn_tty_fax_command1(modem_info * info, isdn_ctrl * c) 153 153 { 154 154 static char *msg[] = ··· 316 316 * Parse AT+F.. FAX class 1 commands 317 317 */ 318 318 319 - int 319 + static int 320 320 isdn_tty_cmd_FCLASS1(char **p, modem_info * info) 321 321 { 322 322 static char *cmd[] = ··· 408 408 * Parse AT+F.. FAX class 2 commands 409 409 */ 410 410 411 - int 411 + static int 412 412 isdn_tty_cmd_FCLASS2(char **p, modem_info * info) 413 413 { 414 414 atemu *m = &info->emu;
+18 -18
drivers/isdn/i4l/isdn_x25iface.c
··· 40 40 41 41 42 42 /* is now in header file (extern): struct concap_proto * isdn_x25iface_proto_new(void); */ 43 - void isdn_x25iface_proto_del( struct concap_proto * ); 44 - int isdn_x25iface_proto_close( struct concap_proto * ); 45 - int isdn_x25iface_proto_restart( struct concap_proto *, 46 - struct net_device *, 47 - struct concap_device_ops *); 48 - int isdn_x25iface_xmit( struct concap_proto *, struct sk_buff * ); 49 - int isdn_x25iface_receive( struct concap_proto *, struct sk_buff * ); 50 - int isdn_x25iface_connect_ind( struct concap_proto * ); 51 - int isdn_x25iface_disconn_ind( struct concap_proto * ); 43 + static void isdn_x25iface_proto_del( struct concap_proto * ); 44 + static int isdn_x25iface_proto_close( struct concap_proto * ); 45 + static int isdn_x25iface_proto_restart( struct concap_proto *, 46 + struct net_device *, 47 + struct concap_device_ops *); 48 + static int isdn_x25iface_xmit( struct concap_proto *, struct sk_buff * ); 49 + static int isdn_x25iface_receive( struct concap_proto *, struct sk_buff * ); 50 + static int isdn_x25iface_connect_ind( struct concap_proto * ); 51 + static int isdn_x25iface_disconn_ind( struct concap_proto * ); 52 52 53 53 54 54 static struct concap_proto_ops ix25_pops = { ··· 102 102 103 103 /* close the x25iface encapsulation protocol 104 104 */ 105 - int isdn_x25iface_proto_close(struct concap_proto *cprot){ 105 + static int isdn_x25iface_proto_close(struct concap_proto *cprot){ 106 106 107 107 ix25_pdata_t *tmp; 108 108 int ret = 0; ··· 129 129 130 130 /* Delete the x25iface encapsulation protocol instance 131 131 */ 132 - void isdn_x25iface_proto_del(struct concap_proto *cprot){ 132 + static void isdn_x25iface_proto_del(struct concap_proto *cprot){ 133 133 134 134 ix25_pdata_t * tmp; 135 135 ··· 158 158 159 159 /* (re-)initialize the data structures for x25iface encapsulation 160 160 */ 161 - int isdn_x25iface_proto_restart(struct concap_proto *cprot, 162 - struct net_device *ndev, 163 - struct concap_device_ops *dops) 161 + static int isdn_x25iface_proto_restart(struct concap_proto *cprot, 162 + struct net_device *ndev, 163 + struct concap_device_ops *dops) 164 164 { 165 165 ix25_pdata_t * pda = cprot -> proto_data ; 166 166 ulong flags; ··· 187 187 188 188 /* deliver a dl_data frame received from i4l HL driver to the network layer 189 189 */ 190 - int isdn_x25iface_receive(struct concap_proto *cprot, struct sk_buff *skb) 190 + static int isdn_x25iface_receive(struct concap_proto *cprot, struct sk_buff *skb) 191 191 { 192 192 IX25DEBUG( "isdn_x25iface_receive %s \n", MY_DEVNAME(cprot->net_dev) ); 193 193 if ( ( (ix25_pdata_t*) (cprot->proto_data) ) ··· 206 206 207 207 /* a connection set up is indicated by lower layer 208 208 */ 209 - int isdn_x25iface_connect_ind(struct concap_proto *cprot) 209 + static int isdn_x25iface_connect_ind(struct concap_proto *cprot) 210 210 { 211 211 struct sk_buff * skb = dev_alloc_skb(1); 212 212 enum wan_states *state_p ··· 235 235 236 236 /* a disconnect is indicated by lower layer 237 237 */ 238 - int isdn_x25iface_disconn_ind(struct concap_proto *cprot) 238 + static int isdn_x25iface_disconn_ind(struct concap_proto *cprot) 239 239 { 240 240 struct sk_buff *skb; 241 241 enum wan_states *state_p ··· 264 264 /* process a frame handed over to us from linux network layer. First byte 265 265 semantics as defined in Documentation/networking/x25-iface.txt 266 266 */ 267 - int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb) 267 + static int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb) 268 268 { 269 269 unsigned char firstbyte = skb->data[0]; 270 270 enum wan_states *state = &((ix25_pdata_t*)cprot->proto_data)->state;