Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Adrian Bunk and committed by
Linus Torvalds
fc238b37 b19a8f04

+38 -78
+30
drivers/isdn/sc/card.h
··· 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 ··· 99 97 int trace_mode; /* Indicate if tracing is on */ 100 98 spinlock_t lock; /* local lock */ 101 99 } board; 100 + 101 + 102 + extern board *sc_adapter[]; 103 + extern int cinst; 104 + 105 + void memcpy_toshmem(int card, void *dest, const void *src, size_t n); 106 + void memcpy_fromshmem(int card, void *dest, const void *src, size_t n); 107 + int get_card_from_id(int driver); 108 + int indicate_status(int card, int event, ulong Channel, char *Data); 109 + irqreturn_t interrupt_handler(int interrupt, void *cardptr); 110 + int sndpkt(int devId, int channel, struct sk_buff *data); 111 + void rcvpkt(int card, RspMessage *rcvmsg); 112 + int command(isdn_ctrl *cmd); 113 + int reset(int card); 114 + int startproc(int card); 115 + int send_and_receive(int card, unsigned int procid, unsigned char type, 116 + unsigned char class, unsigned char code, 117 + unsigned char link, unsigned char data_len, 118 + unsigned char *data, RspMessage *mesgdata, int timeout); 119 + void flushreadfifo (int card); 120 + int sendmessage(int card, unsigned int procid, unsigned int type, 121 + unsigned int class, unsigned int code, unsigned int link, 122 + unsigned int data_len, unsigned int *data); 123 + int receivemessage(int card, RspMessage *rspmsg); 124 + int sc_ioctl(int card, scs_ioctl *data); 125 + int setup_buffers(int card, int c); 126 + void check_reset(unsigned long data); 127 + void check_phystat(unsigned long data); 102 128 103 129 #endif /* CARD_H */
+2 -15
drivers/isdn/sc/command.c
··· 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 ··· 195 208 return -ENODEV; 196 209 } 197 210 198 - if(setup_buffers(card, channel+1, BUFFER_SIZE)) { 211 + if(setup_buffers(card, channel+1)) { 199 212 hangup(card, channel+1); 200 213 return -ENOBUFS; 201 214 } ··· 284 297 return -ENODEV; 285 298 } 286 299 287 - if(setup_buffers(card, channel+1, BUFFER_SIZE)) 300 + if(setup_buffers(card, channel+1)) 288 301 { 289 302 hangup(card, channel+1); 290 303 return -ENOBUFS;
-3
drivers/isdn/sc/event.c
··· 20 20 #include "message.h" 21 21 #include "card.h" 22 22 23 - extern int cinst; 24 - extern board *sc_adapter[]; 25 - 26 23 #ifdef DEBUG 27 24 static char *events[] = { "ISDN_STAT_STAVAIL", 28 25 "ISDN_STAT_ICALL",
-6
drivers/isdn/sc/init.c
··· 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)
-10
drivers/isdn/sc/interrupt.c
··· 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;
-10
drivers/isdn/sc/ioctl.c
··· 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 /*
-10
drivers/isdn/sc/message.c
··· 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 */
-10
drivers/isdn/sc/packet.c
··· 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;
+6
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. ··· 106 103 POTInfo potsinfo; 107 104 } info; 108 105 } boardInfo; 106 + 107 + #endif /* __ISDN_SC_SCIOC_H__ */ 108 +
-6
drivers/isdn/sc/shmem.c
··· 22 22 #include "card.h" 23 23 24 24 /* 25 - * Main adapter array 26 - */ 27 - extern board *sc_adapter[]; 28 - extern int cinst; 29 - 30 - /* 31 25 * 32 26 */ 33 27 void memcpy_toshmem(int card, void *dest, const void *src, size_t n)
-8
drivers/isdn/sc/timer.c
··· 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