Commit fc238b3791447b93c69cd50a99dfcaad6162afba
Committed by
Linus Torvalds
1 parent
b19a8f0472
Exists in
master
and in
39 other branches
[PATCH] drivers/isdn/sc/: proper prototypes
Add proper prototypes in a header file for global code under drivers/isdn/sc/. Since the GNU C compiler is now able do tell us that caller and callee disagreed about the number of arguments of setup_buffers(), this patch also fixes this bug. Signed-off-by: Adrian Bunk <bunk@stusta.de> Cc: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 11 changed files with 38 additions and 78 deletions Side-by-side Diff
drivers/isdn/sc/card.h
... | ... | @@ -26,7 +26,9 @@ |
26 | 26 | #include <linux/timer.h> |
27 | 27 | #include <linux/time.h> |
28 | 28 | #include <linux/isdnif.h> |
29 | +#include <linux/irqreturn.h> | |
29 | 30 | #include "message.h" |
31 | +#include "scioc.h" | |
30 | 32 | |
31 | 33 | /* |
32 | 34 | * Amount of time to wait for a reset to complete |
... | ... | @@ -97,6 +99,34 @@ |
97 | 99 | int trace_mode; /* Indicate if tracing is on */ |
98 | 100 | spinlock_t lock; /* local lock */ |
99 | 101 | } board; |
102 | + | |
103 | + | |
104 | +extern board *sc_adapter[]; | |
105 | +extern int cinst; | |
106 | + | |
107 | +void memcpy_toshmem(int card, void *dest, const void *src, size_t n); | |
108 | +void memcpy_fromshmem(int card, void *dest, const void *src, size_t n); | |
109 | +int get_card_from_id(int driver); | |
110 | +int indicate_status(int card, int event, ulong Channel, char *Data); | |
111 | +irqreturn_t interrupt_handler(int interrupt, void *cardptr); | |
112 | +int sndpkt(int devId, int channel, struct sk_buff *data); | |
113 | +void rcvpkt(int card, RspMessage *rcvmsg); | |
114 | +int command(isdn_ctrl *cmd); | |
115 | +int reset(int card); | |
116 | +int startproc(int card); | |
117 | +int send_and_receive(int card, unsigned int procid, unsigned char type, | |
118 | + unsigned char class, unsigned char code, | |
119 | + unsigned char link, unsigned char data_len, | |
120 | + unsigned char *data, RspMessage *mesgdata, int timeout); | |
121 | +void flushreadfifo (int card); | |
122 | +int sendmessage(int card, unsigned int procid, unsigned int type, | |
123 | + unsigned int class, unsigned int code, unsigned int link, | |
124 | + unsigned int data_len, unsigned int *data); | |
125 | +int receivemessage(int card, RspMessage *rspmsg); | |
126 | +int sc_ioctl(int card, scs_ioctl *data); | |
127 | +int setup_buffers(int card, int c); | |
128 | +void check_reset(unsigned long data); | |
129 | +void check_phystat(unsigned long data); | |
100 | 130 | |
101 | 131 | #endif /* CARD_H */ |
drivers/isdn/sc/command.c
... | ... | @@ -31,19 +31,6 @@ |
31 | 31 | static int setl3(int card, unsigned long arg); |
32 | 32 | static int acceptb(int card, unsigned long channel); |
33 | 33 | |
34 | -extern int cinst; | |
35 | -extern board *sc_adapter[]; | |
36 | - | |
37 | -extern int sc_ioctl(int, scs_ioctl *); | |
38 | -extern int setup_buffers(int, int, unsigned int); | |
39 | -extern int indicate_status(int, int,ulong,char*); | |
40 | -extern void check_reset(unsigned long); | |
41 | -extern int send_and_receive(int, unsigned int, unsigned char, unsigned char, | |
42 | - unsigned char, unsigned char, unsigned char, unsigned char *, | |
43 | - RspMessage *, int); | |
44 | -extern int sendmessage(int, unsigned int, unsigned int, unsigned int, | |
45 | - unsigned int, unsigned int, unsigned int, unsigned int *); | |
46 | - | |
47 | 34 | #ifdef DEBUG |
48 | 35 | /* |
49 | 36 | * Translate command codes to strings |
... | ... | @@ -208,7 +195,7 @@ |
208 | 195 | return -ENODEV; |
209 | 196 | } |
210 | 197 | |
211 | - if(setup_buffers(card, channel+1, BUFFER_SIZE)) { | |
198 | + if(setup_buffers(card, channel+1)) { | |
212 | 199 | hangup(card, channel+1); |
213 | 200 | return -ENOBUFS; |
214 | 201 | } |
... | ... | @@ -297,7 +284,7 @@ |
297 | 284 | return -ENODEV; |
298 | 285 | } |
299 | 286 | |
300 | - if(setup_buffers(card, channel+1, BUFFER_SIZE)) | |
287 | + if(setup_buffers(card, channel+1)) | |
301 | 288 | { |
302 | 289 | hangup(card, channel+1); |
303 | 290 | return -ENOBUFS; |
drivers/isdn/sc/event.c
drivers/isdn/sc/init.c
... | ... | @@ -35,12 +35,6 @@ |
35 | 35 | module_param_array(ram, int, NULL, 0); |
36 | 36 | module_param(do_reset, bool, 0); |
37 | 37 | |
38 | -extern irqreturn_t interrupt_handler(int, void *); | |
39 | -extern int sndpkt(int, int, int, struct sk_buff *); | |
40 | -extern int command(isdn_ctrl *); | |
41 | -extern int indicate_status(int, int, ulong, char*); | |
42 | -extern int reset(int); | |
43 | - | |
44 | 38 | static int identify_board(unsigned long, unsigned int); |
45 | 39 | |
46 | 40 | static int __init sc_init(void) |
drivers/isdn/sc/interrupt.c
... | ... | @@ -21,16 +21,6 @@ |
21 | 21 | #include "card.h" |
22 | 22 | #include <linux/interrupt.h> |
23 | 23 | |
24 | -extern int indicate_status(int, int, ulong, char *); | |
25 | -extern void check_phystat(unsigned long); | |
26 | -extern int receivemessage(int, RspMessage *); | |
27 | -extern int sendmessage(int, unsigned int, unsigned int, unsigned int, | |
28 | - unsigned int, unsigned int, unsigned int, unsigned int *); | |
29 | -extern void rcvpkt(int, RspMessage *); | |
30 | - | |
31 | -extern int cinst; | |
32 | -extern board *sc_adapter[]; | |
33 | - | |
34 | 24 | static int get_card_from_irq(int irq) |
35 | 25 | { |
36 | 26 | int i; |
drivers/isdn/sc/ioctl.c
... | ... | @@ -12,16 +12,6 @@ |
12 | 12 | #include "card.h" |
13 | 13 | #include "scioc.h" |
14 | 14 | |
15 | -extern int indicate_status(int, int, unsigned long, char *); | |
16 | -extern int startproc(int); | |
17 | -extern int reset(int); | |
18 | -extern int send_and_receive(int, unsigned int, unsigned char,unsigned char, | |
19 | - unsigned char,unsigned char, | |
20 | - unsigned char, unsigned char *, RspMessage *, int); | |
21 | - | |
22 | -extern board *sc_adapter[]; | |
23 | - | |
24 | - | |
25 | 15 | static int GetStatus(int card, boardInfo *); |
26 | 16 | |
27 | 17 | /* |
drivers/isdn/sc/message.c
... | ... | @@ -22,16 +22,6 @@ |
22 | 22 | #include "message.h" |
23 | 23 | #include "card.h" |
24 | 24 | |
25 | -extern board *sc_adapter[]; | |
26 | -extern unsigned int cinst; | |
27 | - | |
28 | -/* | |
29 | - * Obligatory function prototypes | |
30 | - */ | |
31 | -extern int indicate_status(int,ulong,char*); | |
32 | -extern int scm_command(isdn_ctrl *); | |
33 | - | |
34 | - | |
35 | 25 | /* |
36 | 26 | * receive a message from the board |
37 | 27 | */ |
drivers/isdn/sc/packet.c
... | ... | @@ -20,16 +20,6 @@ |
20 | 20 | #include "message.h" |
21 | 21 | #include "card.h" |
22 | 22 | |
23 | -extern board *sc_adapter[]; | |
24 | -extern unsigned int cinst; | |
25 | - | |
26 | -extern int get_card_from_id(int); | |
27 | -extern int indicate_status(int, int,ulong, char*); | |
28 | -extern void memcpy_toshmem(int, void *, const void *, size_t); | |
29 | -extern void memcpy_fromshmem(int, void *, const void *, size_t); | |
30 | -extern int sendmessage(int, unsigned int, unsigned int, unsigned int, | |
31 | - unsigned int, unsigned int, unsigned int, unsigned int *); | |
32 | - | |
33 | 23 | int sndpkt(int devId, int channel, struct sk_buff *data) |
34 | 24 | { |
35 | 25 | LLData ReqLnkWrite; |
drivers/isdn/sc/scioc.h
1 | +#ifndef __ISDN_SC_SCIOC_H__ | |
2 | +#define __ISDN_SC_SCIOC_H__ | |
3 | + | |
1 | 4 | /* |
2 | 5 | * This software may be used and distributed according to the terms |
3 | 6 | * of the GNU General Public License, incorporated herein by reference. |
... | ... | @@ -103,4 +106,6 @@ |
103 | 106 | POTInfo potsinfo; |
104 | 107 | } info; |
105 | 108 | } boardInfo; |
109 | + | |
110 | +#endif /* __ISDN_SC_SCIOC_H__ */ |
drivers/isdn/sc/shmem.c
drivers/isdn/sc/timer.c
... | ... | @@ -20,14 +20,6 @@ |
20 | 20 | #include "message.h" |
21 | 21 | #include "card.h" |
22 | 22 | |
23 | -extern board *sc_adapter[]; | |
24 | - | |
25 | -extern void flushreadfifo(int); | |
26 | -extern int startproc(int); | |
27 | -extern int indicate_status(int, int, unsigned long, char *); | |
28 | -extern int sendmessage(int, unsigned int, unsigned int, unsigned int, | |
29 | - unsigned int, unsigned int, unsigned int, unsigned int *); | |
30 | - | |
31 | 23 | |
32 | 24 | /* |
33 | 25 | * Write the proper values into the I/O ports following a reset |