[2.6 patch] drivers/isdn/sc/: possible cleanups

2005-03-12 Thread Adrian Bunk
This patch contains the following possible cleanips:
- make some needlessly global code static
- remove the compiled but completely unused debug.c
- remove or #if 0 the following unused global functions:
  - command.c: loopback
  - command.c: loadproc
  - init.c: irq_supported
  - packet.c: print_skb
  - shmem.c: memset_shmem
  - timer.c: trace_timer

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>

---

This patch was already sent on:
- 9 Feb 2005

 drivers/isdn/sc/Makefile|2 
 drivers/isdn/sc/command.c   |   88 ++--
 drivers/isdn/sc/debug.c |   46 --
 drivers/isdn/sc/init.c  |   21 +---
 drivers/isdn/sc/interrupt.c |2 
 drivers/isdn/sc/ioctl.c |5 --
 drivers/isdn/sc/packet.c|   16 --
 drivers/isdn/sc/shmem.c |2 
 drivers/isdn/sc/timer.c |   18 ---
 9 files changed, 27 insertions(+), 173 deletions(-)

--- linux-2.6.11-rc3-mm1-full/drivers/isdn/sc/command.c.old 2005-02-09 
03:30:43.0 +0100
+++ linux-2.6.11-rc3-mm1-full/drivers/isdn/sc/command.c 2005-02-09 
03:34:19.0 +0100
@@ -22,14 +22,14 @@
 #include "card.h"
 #include "scioc.h"
 
-int dial(int card, unsigned long channel, setup_parm setup);
-int hangup(int card, unsigned long channel);
-int answer(int card, unsigned long channel);
-int clreaz(int card, unsigned long channel);
-int seteaz(int card, unsigned long channel, char *);
-int setl2(int card, unsigned long arg);
-int setl3(int card, unsigned long arg);
-int acceptb(int card, unsigned long channel);
+static int dial(int card, unsigned long channel, setup_parm setup);
+static int hangup(int card, unsigned long channel);
+static int answer(int card, unsigned long channel);
+static int clreaz(int card, unsigned long channel);
+static int seteaz(int card, unsigned long channel, char *);
+static int setl2(int card, unsigned long arg);
+static int setl3(int card, unsigned long arg);
+static int acceptb(int card, unsigned long channel);
 
 extern int cinst;
 extern board *sc_adapter[];
@@ -148,56 +148,6 @@
 }
 
 /*
- * Confirm our ability to communicate with the board.  This test assumes no
- * other message activity is present
- */
-int loopback(int card) 
-{
-
-   int status;
-   static char testmsg[] = "Test Message";
-   RspMessage rspmsg;
-
-   if(!IS_VALID_CARD(card)) {
-   pr_debug("Invalid param: %d is not a valid card id\n", card);
-   return -ENODEV;
-   }
-
-   pr_debug("%s: Sending loopback message\n",
-   sc_adapter[card]->devicename);
-
-   /*
-* Send the loopback message to confirm that memory transfer is
-* operational
-*/
-   status = send_and_receive(card, CMPID, cmReqType1,
- cmReqClass0,
- cmReqMsgLpbk,
- 0,
- (unsigned char) strlen(testmsg),
- (unsigned char *)testmsg,
- &rspmsg, SAR_TIMEOUT);
-
-
-   if (!status) {
-   pr_debug("%s: Loopback message successfully sent\n",
-   sc_adapter[card]->devicename);
-   if(strcmp(rspmsg.msg_data.byte_array, testmsg)) {
-   pr_debug("%s: Loopback return != sent\n",
-   sc_adapter[card]->devicename);
-   return -EIO;
-   }
-   return 0;
-   }
-   else {
-   pr_debug("%s: Send loopback message failed\n",
-   sc_adapter[card]->devicename);
-   return -EIO;
-   }
-
-}
-
-/*
  * start the onboard firmware
  */
 int startproc(int card) 
@@ -222,16 +172,10 @@
 }
 
 
-int loadproc(int card, char *data) 
-{
-   return -1;
-}
-
-
 /*
  * Dials the number passed in 
  */
-int dial(int card, unsigned long channel, setup_parm setup) 
+static int dial(int card, unsigned long channel, setup_parm setup) 
 {
int status;
char Phone[48];
@@ -261,7 +205,7 @@
 /*
  * Answer an incoming call 
  */
-int answer(int card, unsigned long channel) 
+static int answer(int card, unsigned long channel) 
 {
if(!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
@@ -282,7 +226,7 @@
 /*
  * Hangup up the call on specified channel
  */
-int hangup(int card, unsigned long channel) 
+static int hangup(int card, unsigned long channel) 
 {
int status;
 
@@ -305,7 +249,7 @@
 /*
  * Set the layer 2 protocol (X.25, HDLC, Raw)
  */
-int setl2(int card, unsigned long arg) 
+static int setl2(int card, unsigned long arg) 
 {
int status =0;
int protocol,channel;
@@ -340,7 +284,7 @@
 /*
  * Set the layer 3 protocol
  */
-int setl3(int card, unsigned long channel) 
+static int setl3(int card, unsigned long channel) 
 {
int protocol = channel >> 8;
 
@@ -355,7 +299,7 @@
return 0;
 }
 
-

[2.6 patch] drivers/isdn/sc/: possible cleanups

2005-02-08 Thread Adrian Bunk
This patch contains the following possible cleanips:
- make some needlessly global code static
- remove the compiled but completely unused debug.c
- remove or #if 0 the following unused global functions:
  - command.c: loopback
  - command.c: loadproc
  - init.c: irq_supported
  - packet.c: print_skb
  - shmem.c: memset_shmem
  - timer.c: trace_timer

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>

 drivers/isdn/sc/Makefile|2 
 drivers/isdn/sc/command.c   |   88 ++--
 drivers/isdn/sc/debug.c |   46 --
 drivers/isdn/sc/init.c  |   21 +---
 drivers/isdn/sc/interrupt.c |2 
 drivers/isdn/sc/ioctl.c |5 --
 drivers/isdn/sc/packet.c|   16 --
 drivers/isdn/sc/shmem.c |2 
 drivers/isdn/sc/timer.c |   18 ---
 9 files changed, 27 insertions(+), 173 deletions(-)

--- linux-2.6.11-rc3-mm1-full/drivers/isdn/sc/command.c.old 2005-02-09 
03:30:43.0 +0100
+++ linux-2.6.11-rc3-mm1-full/drivers/isdn/sc/command.c 2005-02-09 
03:34:19.0 +0100
@@ -22,14 +22,14 @@
 #include "card.h"
 #include "scioc.h"
 
-int dial(int card, unsigned long channel, setup_parm setup);
-int hangup(int card, unsigned long channel);
-int answer(int card, unsigned long channel);
-int clreaz(int card, unsigned long channel);
-int seteaz(int card, unsigned long channel, char *);
-int setl2(int card, unsigned long arg);
-int setl3(int card, unsigned long arg);
-int acceptb(int card, unsigned long channel);
+static int dial(int card, unsigned long channel, setup_parm setup);
+static int hangup(int card, unsigned long channel);
+static int answer(int card, unsigned long channel);
+static int clreaz(int card, unsigned long channel);
+static int seteaz(int card, unsigned long channel, char *);
+static int setl2(int card, unsigned long arg);
+static int setl3(int card, unsigned long arg);
+static int acceptb(int card, unsigned long channel);
 
 extern int cinst;
 extern board *sc_adapter[];
@@ -148,56 +148,6 @@
 }
 
 /*
- * Confirm our ability to communicate with the board.  This test assumes no
- * other message activity is present
- */
-int loopback(int card) 
-{
-
-   int status;
-   static char testmsg[] = "Test Message";
-   RspMessage rspmsg;
-
-   if(!IS_VALID_CARD(card)) {
-   pr_debug("Invalid param: %d is not a valid card id\n", card);
-   return -ENODEV;
-   }
-
-   pr_debug("%s: Sending loopback message\n",
-   sc_adapter[card]->devicename);
-
-   /*
-* Send the loopback message to confirm that memory transfer is
-* operational
-*/
-   status = send_and_receive(card, CMPID, cmReqType1,
- cmReqClass0,
- cmReqMsgLpbk,
- 0,
- (unsigned char) strlen(testmsg),
- (unsigned char *)testmsg,
- &rspmsg, SAR_TIMEOUT);
-
-
-   if (!status) {
-   pr_debug("%s: Loopback message successfully sent\n",
-   sc_adapter[card]->devicename);
-   if(strcmp(rspmsg.msg_data.byte_array, testmsg)) {
-   pr_debug("%s: Loopback return != sent\n",
-   sc_adapter[card]->devicename);
-   return -EIO;
-   }
-   return 0;
-   }
-   else {
-   pr_debug("%s: Send loopback message failed\n",
-   sc_adapter[card]->devicename);
-   return -EIO;
-   }
-
-}
-
-/*
  * start the onboard firmware
  */
 int startproc(int card) 
@@ -222,16 +172,10 @@
 }
 
 
-int loadproc(int card, char *data) 
-{
-   return -1;
-}
-
-
 /*
  * Dials the number passed in 
  */
-int dial(int card, unsigned long channel, setup_parm setup) 
+static int dial(int card, unsigned long channel, setup_parm setup) 
 {
int status;
char Phone[48];
@@ -261,7 +205,7 @@
 /*
  * Answer an incoming call 
  */
-int answer(int card, unsigned long channel) 
+static int answer(int card, unsigned long channel) 
 {
if(!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
@@ -282,7 +226,7 @@
 /*
  * Hangup up the call on specified channel
  */
-int hangup(int card, unsigned long channel) 
+static int hangup(int card, unsigned long channel) 
 {
int status;
 
@@ -305,7 +249,7 @@
 /*
  * Set the layer 2 protocol (X.25, HDLC, Raw)
  */
-int setl2(int card, unsigned long arg) 
+static int setl2(int card, unsigned long arg) 
 {
int status =0;
int protocol,channel;
@@ -340,7 +284,7 @@
 /*
  * Set the layer 3 protocol
  */
-int setl3(int card, unsigned long channel) 
+static int setl3(int card, unsigned long channel) 
 {
int protocol = channel >> 8;
 
@@ -355,7 +299,7 @@
return 0;
 }
 
-int acceptb(int card, unsigned long channel)
+stati