Commit 3e206b0a authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds

[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: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 886cca3a
......@@ -391,16 +391,6 @@ isdn_audio_adpcm2xlaw(adpcm_state * s, int fmt, unsigned char *in,
return olen;
}
int
isdn_audio_2adpcm_flush(adpcm_state * s, unsigned char *out)
{
int olen = 0;
if (s->nleft)
isdn_audio_put_bits(0, 8 - s->nleft, s, &out, &olen);
return olen;
}
int
isdn_audio_xlaw2adpcm(adpcm_state * s, int fmt, unsigned char *in,
unsigned char *out, int len)
......
......@@ -35,7 +35,6 @@ extern void isdn_audio_alaw2ulaw(unsigned char *, unsigned long);
extern adpcm_state *isdn_audio_adpcm_init(adpcm_state *, int);
extern int isdn_audio_adpcm2xlaw(adpcm_state *, int, unsigned char *, unsigned char *, int);
extern int isdn_audio_xlaw2adpcm(adpcm_state *, int, unsigned char *, unsigned char *, int);
extern int isdn_audio_2adpcm_flush(adpcm_state * s, unsigned char *out);
extern void isdn_audio_calc_dtmf(modem_info *, unsigned char *, int, int);
extern void isdn_audio_eval_dtmf(modem_info *);
dtmf_state *isdn_audio_dtmf_init(dtmf_state *);
......
......@@ -67,7 +67,7 @@ static isdn_divert_if *divert_if; /* = NULL */
static int isdn_writebuf_stub(int, int, const u_char __user *, int);
static void set_global_features(void);
static int isdn_wildmat(char *s, char *p);
static int isdn_add_channels(isdn_driver_t *d, int drvidx, int n, int adding);
static inline void
isdn_lock_driver(isdn_driver_t *drv)
......@@ -388,7 +388,7 @@ isdn_all_eaz(int di, int ch)
*/
#include <linux/isdn/capicmd.h>
int
static int
isdn_capi_rec_hl_msg(capi_msg *cm) {
int di;
......@@ -1923,7 +1923,7 @@ isdn_writebuf_skb_stub(int drvidx, int chan, int ack, struct sk_buff *skb)
return ret;
}
int
static int
isdn_add_channels(isdn_driver_t *d, int drvidx, int n, int adding)
{
int j, k, m;
......
......@@ -41,7 +41,6 @@ extern int isdn_get_free_channel(int, int, int, int, int, char *);
extern int isdn_writebuf_skb_stub(int, int, int, struct sk_buff *);
extern int register_isdn(isdn_if * i);
extern int isdn_msncmp( const char *, const char *);
extern int isdn_add_channels(isdn_driver_t *, int, int, int);
#if defined(ISDN_DEBUG_NET_DUMP) || defined(ISDN_DEBUG_MODEM_DUMP)
extern void isdn_dumppkt(char *, u_char *, int, int);
#endif
......@@ -39,7 +39,7 @@
*/
int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb)
static int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb)
{
struct net_device *ndev = concap -> net_dev;
isdn_net_dev *nd = ((isdn_net_local *) ndev->priv)->netdev;
......@@ -58,7 +58,7 @@ int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb)
}
int isdn_concap_dl_connect_req(struct concap_proto *concap)
static int isdn_concap_dl_connect_req(struct concap_proto *concap)
{
struct net_device *ndev = concap -> net_dev;
isdn_net_local *lp = (isdn_net_local *) ndev->priv;
......@@ -71,7 +71,7 @@ int isdn_concap_dl_connect_req(struct concap_proto *concap)
return ret;
}
int isdn_concap_dl_disconn_req(struct concap_proto *concap)
static int isdn_concap_dl_disconn_req(struct concap_proto *concap)
{
IX25DEBUG( "isdn_concap_dl_disconn_req: %s \n", concap -> net_dev -> name);
......@@ -85,15 +85,6 @@ struct concap_device_ops isdn_concap_reliable_dl_dops = {
&isdn_concap_dl_disconn_req
};
struct concap_device_ops isdn_concap_demand_dial_dops = {
NULL, /* set this first entry to something like &isdn_net_start_xmit,
but the entry part of the current isdn_net_start_xmit must be
separated first. */
/* no connection control for demand dial semantics */
NULL,
NULL,
};
/* The following should better go into a dedicated source file such that
this sourcefile does not need to include any protocol specific header
files. For now:
......
......@@ -8,7 +8,6 @@
*/
extern struct concap_device_ops isdn_concap_reliable_dl_dops;
extern struct concap_device_ops isdn_concap_demand_dial_dops;
extern struct concap_proto * isdn_concap_new( int );
......@@ -176,7 +176,7 @@ static __inline__ void isdn_net_zero_frame_cnt(isdn_net_local *lp)
/* Prototypes */
int isdn_net_force_dial_lp(isdn_net_local *);
static int isdn_net_force_dial_lp(isdn_net_local *);
static int isdn_net_start_xmit(struct sk_buff *, struct net_device *);
static void isdn_net_ciscohdlck_connected(isdn_net_local *lp);
......@@ -312,7 +312,7 @@ isdn_net_unbind_channel(isdn_net_local * lp)
* Since this function is called every second, simply reset the
* byte-counter of the interface after copying it to the cps-variable.
*/
unsigned long last_jiffies = -HZ;
static unsigned long last_jiffies = -HZ;
void
isdn_net_autohup(void)
......@@ -1131,7 +1131,7 @@ isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev)
}
void isdn_net_tx_timeout(struct net_device * ndev)
static void isdn_net_tx_timeout(struct net_device * ndev)
{
isdn_net_local *lp = (isdn_net_local *) ndev->priv;
......@@ -1424,7 +1424,7 @@ isdn_net_ciscohdlck_alloc_skb(isdn_net_local *lp, int len)
}
/* cisco hdlck device private ioctls */
int
static int
isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
isdn_net_local *lp = (isdn_net_local *) dev->priv;
......@@ -2461,7 +2461,7 @@ isdn_net_findif(char *name)
* This is called from the userlevel-routine below or
* from isdn_net_start_xmit().
*/
int
static int
isdn_net_force_dial_lp(isdn_net_local * lp)
{
if ((!(lp->flags & ISDN_NET_CONNECTED)) && !lp->dialstate) {
......
......@@ -273,7 +273,7 @@ isdn_tty_rcv_skb(int i, int di, int channel, struct sk_buff *skb)
return 1;
}
void
static void
isdn_tty_cleanup_xmit(modem_info * info)
{
skb_queue_purge(&info->xmit_queue);
......@@ -560,7 +560,7 @@ isdn_tty_modem_ncarrier(modem_info * info)
/*
* return the usage calculated by si and layer 2 protocol
*/
int
static int
isdn_calc_usage(int si, int l2)
{
int usg = ISDN_USAGE_MODEM;
......
......@@ -109,7 +109,6 @@ extern int isdn_tty_modem_init(void);
extern void isdn_tty_exit(void);
extern void isdn_tty_readmodem(void);
extern int isdn_tty_find_icall(int, int, setup_parm *);
extern void isdn_tty_cleanup_xmit(modem_info *);
extern int isdn_tty_stat_callback(int, isdn_ctrl *);
extern int isdn_tty_rcv_skb(int, int, int, struct sk_buff *);
extern int isdn_tty_capi_facility(capi_msg *cm);
......
......@@ -148,7 +148,7 @@ isdn_tty_fax_modem_result(int code, modem_info * info)
}
}
int
static int
isdn_tty_fax_command1(modem_info * info, isdn_ctrl * c)
{
static char *msg[] =
......@@ -316,7 +316,7 @@ isdn_tty_fax_bitorder(modem_info * info, struct sk_buff *skb)
* Parse AT+F.. FAX class 1 commands
*/
int
static int
isdn_tty_cmd_FCLASS1(char **p, modem_info * info)
{
static char *cmd[] =
......@@ -408,7 +408,7 @@ isdn_tty_cmd_FCLASS1(char **p, modem_info * info)
* Parse AT+F.. FAX class 2 commands
*/
int
static int
isdn_tty_cmd_FCLASS2(char **p, modem_info * info)
{
atemu *m = &info->emu;
......
......@@ -40,15 +40,15 @@ typedef struct isdn_x25iface_proto_data {
/* is now in header file (extern): struct concap_proto * isdn_x25iface_proto_new(void); */
void isdn_x25iface_proto_del( struct concap_proto * );
int isdn_x25iface_proto_close( struct concap_proto * );
int isdn_x25iface_proto_restart( struct concap_proto *,
struct net_device *,
struct concap_device_ops *);
int isdn_x25iface_xmit( struct concap_proto *, struct sk_buff * );
int isdn_x25iface_receive( struct concap_proto *, struct sk_buff * );
int isdn_x25iface_connect_ind( struct concap_proto * );
int isdn_x25iface_disconn_ind( struct concap_proto * );
static void isdn_x25iface_proto_del( struct concap_proto * );
static int isdn_x25iface_proto_close( struct concap_proto * );
static int isdn_x25iface_proto_restart( struct concap_proto *,
struct net_device *,
struct concap_device_ops *);
static int isdn_x25iface_xmit( struct concap_proto *, struct sk_buff * );
static int isdn_x25iface_receive( struct concap_proto *, struct sk_buff * );
static int isdn_x25iface_connect_ind( struct concap_proto * );
static int isdn_x25iface_disconn_ind( struct concap_proto * );
static struct concap_proto_ops ix25_pops = {
......@@ -102,7 +102,7 @@ struct concap_proto * isdn_x25iface_proto_new(void)
/* close the x25iface encapsulation protocol
*/
int isdn_x25iface_proto_close(struct concap_proto *cprot){
static int isdn_x25iface_proto_close(struct concap_proto *cprot){
ix25_pdata_t *tmp;
int ret = 0;
......@@ -129,7 +129,7 @@ int isdn_x25iface_proto_close(struct concap_proto *cprot){
/* Delete the x25iface encapsulation protocol instance
*/
void isdn_x25iface_proto_del(struct concap_proto *cprot){
static void isdn_x25iface_proto_del(struct concap_proto *cprot){
ix25_pdata_t * tmp;
......@@ -158,9 +158,9 @@ void isdn_x25iface_proto_del(struct concap_proto *cprot){
/* (re-)initialize the data structures for x25iface encapsulation
*/
int isdn_x25iface_proto_restart(struct concap_proto *cprot,
struct net_device *ndev,
struct concap_device_ops *dops)
static int isdn_x25iface_proto_restart(struct concap_proto *cprot,
struct net_device *ndev,
struct concap_device_ops *dops)
{
ix25_pdata_t * pda = cprot -> proto_data ;
ulong flags;
......@@ -187,7 +187,7 @@ int isdn_x25iface_proto_restart(struct concap_proto *cprot,
/* deliver a dl_data frame received from i4l HL driver to the network layer
*/
int isdn_x25iface_receive(struct concap_proto *cprot, struct sk_buff *skb)
static int isdn_x25iface_receive(struct concap_proto *cprot, struct sk_buff *skb)
{
IX25DEBUG( "isdn_x25iface_receive %s \n", MY_DEVNAME(cprot->net_dev) );
if ( ( (ix25_pdata_t*) (cprot->proto_data) )
......@@ -206,7 +206,7 @@ int isdn_x25iface_receive(struct concap_proto *cprot, struct sk_buff *skb)
/* a connection set up is indicated by lower layer
*/
int isdn_x25iface_connect_ind(struct concap_proto *cprot)
static int isdn_x25iface_connect_ind(struct concap_proto *cprot)
{
struct sk_buff * skb = dev_alloc_skb(1);
enum wan_states *state_p
......@@ -235,7 +235,7 @@ int isdn_x25iface_connect_ind(struct concap_proto *cprot)
/* a disconnect is indicated by lower layer
*/
int isdn_x25iface_disconn_ind(struct concap_proto *cprot)
static int isdn_x25iface_disconn_ind(struct concap_proto *cprot)
{
struct sk_buff *skb;
enum wan_states *state_p
......@@ -264,7 +264,7 @@ int isdn_x25iface_disconn_ind(struct concap_proto *cprot)
/* process a frame handed over to us from linux network layer. First byte
semantics as defined in Documentation/networking/x25-iface.txt
*/
int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb)
static int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb)
{
unsigned char firstbyte = skb->data[0];
enum wan_states *state = &((ix25_pdata_t*)cprot->proto_data)->state;
......
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