From: Adrian Bunk <bunk@stusta.de>

The patch below does cleanups under drivers/char/rio/ including the 
following:

- remove some completely unused code
- make some needlessly global code static
- remove #ifndef linux code
- remove never enabled #ifdef XPRINT_SUPPORT code
- RIOStrlen -> string.h strlen
- RIOStrCmp -> string.h strcmp

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

 25-akpm/drivers/char/rio/func.h      |   21 ----
 25-akpm/drivers/char/rio/rio_linux.c |   26 +----
 25-akpm/drivers/char/rio/rioboot.c   |    4 
 25-akpm/drivers/char/rio/riocmd.c    |   58 ------------
 25-akpm/drivers/char/rio/rioctrl.c   |   33 ------
 25-akpm/drivers/char/rio/rioinit.c   |   57 +++---------
 25-akpm/drivers/char/rio/riointr.c   |  166 -----------------------------------
 25-akpm/drivers/char/rio/rioroute.c  |   18 ++-
 25-akpm/drivers/char/rio/riotable.c  |   19 ----
 25-akpm/drivers/char/rio/riotty.c    |   17 ++-
 10 files changed, 57 insertions(+), 362 deletions(-)

diff -puN drivers/char/rio/func.h~small-drivers-char-rio-cleanups-fwd drivers/char/rio/func.h
--- 25/drivers/char/rio/func.h~small-drivers-char-rio-cleanups-fwd	2004-11-17 22:04:58.005556920 -0800
+++ 25-akpm/drivers/char/rio/func.h	2004-11-17 22:04:58.039551752 -0800
@@ -47,7 +47,6 @@ int RIOBootCodeHOST(struct rio_info *, r
 int RIOBootCodeUNKNOWN(struct rio_info *, struct DownLoad *);
 void msec_timeout(struct Host *);
 int RIOBootRup(struct rio_info *, uint, struct Host *, struct PKT *);
-int RIOBootComplete(struct rio_info *, struct Host *, uint, struct PktCmd *);
 int RIOBootOk(struct rio_info *,struct Host *, ulong);
 int RIORtaBound(struct rio_info *, uint); 
 void FillSlot(int, int, uint, struct Host *);
@@ -61,15 +60,10 @@ int RIOIdentifyRta(struct rio_info *, ca
 int RIOKillNeighbour(struct rio_info *, caddr_t);
 int RIOSuspendBootRta(struct Host *, int, int);
 int RIOFoadWakeup(struct rio_info *);
-int RIOCommandRup(struct rio_info *, uint, struct Host *, struct PKT *);
 struct CmdBlk * RIOGetCmdBlk(void);
 void RIOFreeCmdBlk(struct CmdBlk *);
 int RIOQueueCmdBlk(struct Host *, uint, struct CmdBlk *);
 void RIOPollHostCommands(struct rio_info *, struct Host *);
-int RIOStrlen(register char *);
-int RIOStrCmp(register char *, register char *);
-int RIOStrnCmp(register char *, register char *, int);
-void  RIOStrNCpy(char *, char *, int);
 int RIOWFlushMark(int, struct CmdBlk *);
 int RIORFlushEnable(int, struct CmdBlk *);
 int RIOUnUse(int, struct CmdBlk *);
@@ -77,7 +71,6 @@ void ShowPacket(uint, struct PKT *);
 
 /* rioctrl.c */
 int copyin(int, caddr_t, int);
-int copyout(caddr_t, int, int);
 int riocontrol(struct rio_info *, dev_t,int,caddr_t,int); 
 int RIOPreemptiveCmd(struct rio_info *,struct Port *,uchar);
 
@@ -89,24 +82,17 @@ int RIODoAT(struct rio_info *, int, int)
 caddr_t RIOCheckForATCard(int);
 int RIOAssignAT(struct rio_info *, int, caddr_t, int);
 int RIOBoardTest(paddr_t, caddr_t, uchar, int);
-int RIOScrub(int, BYTE *, int);
-void RIOAllocateInterrupts(struct rio_info *);
-void RIOStopInterrupts(struct rio_info *, int, int);
 void RIOAllocDataStructs(struct rio_info *);
 void RIOSetupDataStructs(struct rio_info *);
 int RIODefaultName(struct rio_info *, struct Host *, uint);
-int RIOReport(struct rio_info *);
 struct rioVersion * RIOVersid(void);
 int RIOMapin(paddr_t, int, caddr_t *);
 void RIOMapout(paddr_t, long, caddr_t);
 void RIOHostReset(uint, volatile struct DpRam *, uint);
 
 /* riointr.c */
-void riopoll(struct rio_info *);
-void riointr(struct rio_info *);
 void RIOTxEnable(char *);
 void RIOServiceHost(struct rio_info *, struct Host *, int);
-void RIOReceive(struct rio_info *, struct Port *);
 int riotproc(struct rio_info *, register struct ttystatics *, int, int);
 
 /* rioparam.c */
@@ -123,22 +109,15 @@ void remove_receive(struct Port *);
 /* rioroute.c */
 int RIORouteRup(struct rio_info *, uint, struct Host *, struct PKT *);
 void RIOFixPhbs(struct rio_info *, struct Host *, uint); 
-int RIOCheckIsolated(struct rio_info *, struct Host *, uint);
-int RIOIsolate(struct rio_info *, struct Host *, uint);
-int RIOCheck(struct Host *, uint);
 uint GetUnitType(uint);
 int RIOSetChange(struct rio_info *);
-void RIOConCon(struct rio_info *, struct Host *, uint, uint, uint, uint, int);
 int RIOFindFreeID(struct rio_info *, struct Host *, uint *, uint *);
-int RIOFreeDisconnected(struct rio_info *, struct Host *, int );
-int RIORemoveFromSavedTable(struct rio_info *, struct Map *);
 
 
 /* riotty.c */
 
 int riotopen(struct tty_struct * tty, struct file * filp);
 int riotclose(void  *ptr);
-int RIOCookMode(struct ttystatics *);
 int riotioctl(struct rio_info *, struct tty_struct *, register int, register caddr_t); 
 void ttyseth(struct Port *, struct ttystatics *, struct old_sgttyb *sg);
 
diff -puN drivers/char/rio/rioboot.c~small-drivers-char-rio-cleanups-fwd drivers/char/rio/rioboot.c
--- 25/drivers/char/rio/rioboot.c~small-drivers-char-rio-cleanups-fwd	2004-11-17 22:04:58.008556464 -0800
+++ 25-akpm/drivers/char/rio/rioboot.c	2004-11-17 22:04:58.040551600 -0800
@@ -80,6 +80,8 @@ static char *_rioboot_c_sccs_ = "@(#)rio
 #include "cmdblk.h"
 #include "route.h"
 
+static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, struct PktCmd *PktCmdP );
+
 static uchar
 RIOAtVec2Ctrl[] =
 {
@@ -802,7 +804,7 @@ struct PKT *PacketP; 
 ** If booted by an RTA, HostP->Mapping[Rup].RtaUniqueNum is the booting RTA.
 ** RtaUniq is the booted RTA.
 */
-int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, struct PktCmd *PktCmdP )
+static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, struct PktCmd *PktCmdP )
 {
 	struct Map	*MapP = NULL;
 	struct Map	*MapP2 = NULL;
diff -puN drivers/char/rio/riocmd.c~small-drivers-char-rio-cleanups-fwd drivers/char/rio/riocmd.c
--- 25/drivers/char/rio/riocmd.c~small-drivers-char-rio-cleanups-fwd	2004-11-17 22:04:58.011556008 -0800
+++ 25-akpm/drivers/char/rio/riocmd.c	2004-11-17 22:04:58.041551448 -0800
@@ -397,7 +397,7 @@ struct rio_info *	p;
 /*
 ** Incoming command on the COMMAND_RUP to be processed.
 */
-int
+static int
 RIOCommandRup(p, Rup, HostP, PacketP)
 struct rio_info *	p;
 uint Rup;
@@ -917,62 +917,6 @@ struct Host *		HostP;
 	} while ( Rup );
 }
 
-
-/*
-** Return the length of the named string
-*/
-int
-RIOStrlen(Str)
-register char *Str;
-{
-	register int len = 0;
-
-	while ( *Str++ )
-		len++;
-	return len;
-}
-
-/*
-** compares s1 to s2 and return 0 if they match.
-*/
-int
-RIOStrCmp(s1, s2)
-register char *s1;
-register char *s2;
-{
-	while ( *s1 && *s2 && *s1==*s2 )
-		s1++, s2++;
-	return *s1-*s2;
-}
-
-/*
-** compares s1 to s2 for upto n bytes and return 0 if they match.
-*/
-int
-RIOStrnCmp(s1, s2, n)
-register char *s1;
-register char *s2;
-int n;
-{
-	while ( n && *s1 && *s2 && *s1==*s2 )
-		n--, s1++, s2++;
-	return n ? *s1!=*s2 : 0;
-}
-
-/*
-** copy up to 'len' bytes from 'from' to 'to'.
-*/
-void
-RIOStrNCpy(to, from, len)
-char *to;
-char *from;
-int len; 
-{
-	while ( len-- && (*to++ = *from++) )
-		;
-	to[-1]='\0';
-}
-
 int
 RIOWFlushMark(iPortP, CmdBlkP)
 int iPortP;
diff -puN drivers/char/rio/rioctrl.c~small-drivers-char-rio-cleanups-fwd drivers/char/rio/rioctrl.c
--- 25/drivers/char/rio/rioctrl.c~small-drivers-char-rio-cleanups-fwd	2004-11-17 22:04:58.015555400 -0800
+++ 25-akpm/drivers/char/rio/rioctrl.c	2004-11-17 22:04:58.042551296 -0800
@@ -130,7 +130,6 @@ static int 
 
 #define drv_makedev(maj, min) ((((uint) maj & 0xff) << 8) | ((uint) min & 0xff))
 
-#ifdef linux
 int copyin (int arg, caddr_t dp, int siz)
 {
   int rv;
@@ -141,8 +140,7 @@ int copyin (int arg, caddr_t dp, int siz
   else return rv;
 }
 
-
-int copyout (caddr_t dp, int arg, int siz)
+static int copyout (caddr_t dp, int arg, int siz)
 {
   int rv;
 
@@ -152,35 +150,6 @@ int copyout (caddr_t dp, int arg, int si
   else return rv;
 }
 
-#else
-
-int
-copyin(arg, dp, siz)
-int arg;
-caddr_t dp;
-int siz; 
-{
-	if (rbounds ((unsigned long) arg) >= siz) {
-		bcopy ( arg, dp, siz );
-		return OK;
-	} else
-		return ( COPYFAIL );
-}
-
-int
-copyout (dp, arg, siz)
-caddr_t dp;
-int arg;
-int siz;
-{
-	if (wbounds ((unsigned long) arg) >=  siz ) {
-		bcopy ( dp, arg, siz );
-		return OK;
-	} else
-		return ( COPYFAIL );
-}
-#endif
-
 int
 riocontrol(p, dev, cmd, arg, su)
 struct rio_info	* p;
diff -puN drivers/char/rio/rioinit.c~small-drivers-char-rio-cleanups-fwd drivers/char/rio/rioinit.c
--- 25/drivers/char/rio/rioinit.c~small-drivers-char-rio-cleanups-fwd	2004-11-17 22:04:58.018554944 -0800
+++ 25-akpm/drivers/char/rio/rioinit.c	2004-11-17 22:04:58.043551144 -0800
@@ -84,9 +84,15 @@ static char *_rioinit_c_sccs_ = "@(#)rio
 #undef bcopy
 #define bcopy rio_pcicopy
 
-int
-RIOPCIinit(struct rio_info *p, int Mode);
+int RIOPCIinit(struct rio_info *p, int Mode);
+
+#if 0
+static void RIOAllocateInterrupts(struct rio_info *);
+static int RIOReport(struct rio_info *);
+static void RIOStopInterrupts(struct rio_info *, int, int);
+#endif
 
+static int RIOScrub(int, BYTE *, int);
 
 #if 0
 extern int	rio_intr();
@@ -1116,7 +1122,7 @@ int		slot;
 ** Call with op not zero, and the RAM will be read and compated with val[op-1]
 ** to check that the data from the previous phase was retained.
 */
-int
+static int
 RIOScrub(op, ram, size)
 int		op;
 BYTE *	ram;
@@ -1262,7 +1268,8 @@ int		size; 
 ** and force into polled mode if told to. Patch up the
 ** interrupt vector & salute The Queen when you've done.
 */
-void
+#if 0
+static void
 RIOAllocateInterrupts(p)
 struct rio_info *	p;
 {
@@ -1301,7 +1308,7 @@ struct rio_info *	p;
 ** new-fangled interrupt thingies. Set everything up to just
 ** poll.
 */
-void
+static void
 RIOStopInterrupts(p, Reason, Host)
 struct rio_info *	p;
 int	Reason;
@@ -1360,7 +1367,6 @@ int	Host; 
 	}
 }
 
-#if 0
 /*
 ** This function is called at init time to setup the data structures.
 */
@@ -1476,7 +1482,8 @@ uint			UnitId;
 #define RIO_RELEASE	"Linux"
 #define RELEASE_ID	"1.0"
 
-int
+#if 0
+static int
 RIOReport(p)
 struct rio_info *	p;
 {
@@ -1500,41 +1507,7 @@ struct rio_info *	p;
 	}
 	return 0;
 }
-
-/*
-** This function returns release/version information as used by ioctl() calls
-** It returns a MAX_VERSION_LEN byte string, null terminated.
-*/
-char *
-OLD_RIOVersid( void )
-{
-	static char	Info[MAX_VERSION_LEN];
-	char *	RIORelease = RIO_RELEASE;
-	char *	cp;
-	int		ct = 0;
-
-	for ( ct=0; RIORelease[ct] && ct<MAX_VERSION_LEN; ct++ )
-		Info[ct] = RIORelease[ct];
-	if ( ct>=MAX_VERSION_LEN ) {
-		Info[MAX_VERSION_LEN-1] = '\0';
-		return Info;
-	}
-	Info[ct++]=' ';
-	if ( ct>=MAX_VERSION_LEN ) {
-		Info[MAX_VERSION_LEN-1] = '\0';
-		return Info;
-	}
-
-	cp="";	/* Fill the RCS Id here */
-
-	while ( *cp && ct<MAX_VERSION_LEN )
-		Info[ct++] = *cp++;
-	if ( ct<MAX_VERSION_LEN-1 )
-		Info[ct] = '\0';
-	Info[MAX_VERSION_LEN-1] = '\0';
-	return Info;
-}
-
+#endif
 
 static struct rioVersion	stVersion;
 
diff -puN drivers/char/rio/riointr.c~small-drivers-char-rio-cleanups-fwd drivers/char/rio/riointr.c
--- 25/drivers/char/rio/riointr.c~small-drivers-char-rio-cleanups-fwd	2004-11-17 22:04:58.021554488 -0800
+++ 25-akpm/drivers/char/rio/riointr.c	2004-11-17 22:04:58.044550992 -0800
@@ -84,83 +84,10 @@ static char *_riointr_c_sccs_ = "@(#)rio
 #include "rioioctl.h"
 
 
+static void RIOReceive(struct rio_info *, struct Port *);
 
 
-/*
-** riopoll is called every clock tick. Once the /dev/rio device has been
-** opened, and polldistributed( ) has been called, this routine is called
-** every clock tick *by every cpu*. The 'interesting' piece of code that
-** manipulates 'RIONumCpus' and 'RIOCpuCountdown' is used to fair-share
-** the work between the CPUs. If there are 'N' cpus, then each poll time
-** we increment a counter, modulo 'N-1'. When this counter is 0, we call
-** the interrupt handler. This has the effect that polls are serviced
-** by processor 'N', 'N-1', 'N-2', ... '0', round and round. Neat.
-*/
-void
-riopoll(p)
-struct rio_info *	p;
-{
-	int   host;
-
-	/*
-	** Here's the deal. We try to fair share as much as possible amongst
-	** all the processors that are available. Since each processor 
-	** should generate HZ ticks per second and since we only need HZ ticks
-	** in total for proper operation we simply attempt to cycle round each
-	** processor in turn, using RIOCpuCountdown to decide whether to call
-	** the interrupt routine. ( In fact the count zeroes when it reaches
-	** one less than the total number of processors - so e.g. on a two
-	** processor system RIOService will get called 2*HZ times per second. )
-	** this_cpu (cur_cpu()) tells us the number of the current processor
-	** as follows:
-	**
-	**		0 - default CPU
-	**		1 - first extra CPU
-	**		2 - second extra CPU
-	**		etc.
-	*/
-
-	/*
-	** okay, we've got a cpu that hasn't had a go recently 
-	** - lets check to see what needs doing.
-	*/
-	for ( host=0; host<p->RIONumHosts; host++ ) {
-		struct Host *HostP = &p->RIOHosts[host];
-
-		rio_spin_lock( &HostP->HostLock );
-
-		if ( ( (HostP->Flags & RUN_STATE) != RC_RUNNING ) ||
-		     HostP->InIntr ) {
-			rio_spin_unlock (&HostP->HostLock); 
-			continue;
-		}
-
-		if ( RWORD( HostP->ParmMapP->rup_intr ) ||
-			 RWORD( HostP->ParmMapP->rx_intr  ) ||
-			 RWORD( HostP->ParmMapP->tx_intr  ) ) {
-			HostP->InIntr = 1;
-
-#ifdef FUTURE_RELEASE
-			if( HostP->Type == RIO_EISA )
-				INBZ( HostP->Slot, EISA_INTERRUPT_RESET );
-			else
-#endif
-				WBYTE( HostP->ResetInt , 0xff );
-
-			rio_spin_lock(&HostP->HostLock); 
-
-			p->_RIO_Polled++;
-			RIOServiceHost(p, HostP, 'p' );
-			rio_spin_lock( &HostP->HostLock); 
-			HostP->InIntr = 0;
-			rio_spin_unlock (&HostP->HostLock);
-		}
-	}
-	rio_spin_unlock (&p->RIOIntrSem); 
-}
-
-
-char *firstchars (char *p, int nch)
+static char *firstchars (char *p, int nch)
 {
   static char buf[2][128];
   static int t=0;
@@ -258,93 +185,6 @@ char *		en;
 
 
 /*
-** When a real-life interrupt comes in here, we try to find out
-** which host card it belongs to, and then service only that host
-** Notice the cunning way that, once we've found a candidate, we
-** continue just in case we are sharing interrupts.
-*/
-void
-riointr(p)
-struct rio_info *	p;
-{
-	int host;
-
-	for ( host=0; host<p->RIONumHosts; host++ ) {
-		struct Host *HostP = &p->RIOHosts[host];
-
-		rio_dprintk (RIO_DEBUG_INTR,  "riointr() doing host %d type %d\n", host, HostP->Type);
-
-		switch( HostP->Type ) {
-			case RIO_AT:
-			case RIO_MCA:
-			case RIO_PCI:
-			  	rio_spin_lock(&HostP->HostLock);
-				WBYTE(HostP->ResetInt , 0xff);
-				if ( !HostP->InIntr ) {
-					HostP->InIntr = 1;
-					rio_spin_unlock (&HostP->HostLock);
-					p->_RIO_Interrupted++;
-					RIOServiceHost(p, HostP, 'i');
-					rio_spin_lock(&HostP->HostLock);
-					HostP->InIntr = 0;
-				}
-				rio_spin_unlock(&HostP->HostLock); 
-				break;
-#ifdef FUTURE_RELEASE
-		case RIO_EISA:
-			if ( ivec == HostP->Ivec )
-			{
-				OldSpl = LOCKB( &HostP->HostLock );
-				INBZ( HostP->Slot, EISA_INTERRUPT_RESET );
-				if ( !HostP->InIntr )
-				{
-					HostP->InIntr = 1;
-					UNLOCKB( &HostP->HostLock, OldSpl );
-					if ( this_cpu < RIO_CPU_LIMIT )
-					{
-						int intrSpl = LOCKB( &RIOIntrLock );
-						UNLOCKB( &RIOIntrLock, intrSpl );
-					}
-						p->_RIO_Interrupted++;
-					RIOServiceHost( HostP, 'i' );
-					OldSpl = LOCKB( &HostP->HostLock );
-					HostP->InIntr = 0;
-				}
-				UNLOCKB( &HostP->HostLock, OldSpl );
-				done++;
-			}
-			break;
-#endif
-		}
-
-		HostP->IntSrvDone++;
-	}
-
-#ifdef FUTURE_RELEASE
-	if ( !done )
-	{
-		cmn_err( CE_WARN, "RIO: Interrupt received with vector 0x%x\n", ivec );
-		cmn_err( CE_CONT, "	 Valid vectors are:\n");
-		for ( host=0; host<RIONumHosts; host++ )
-		{
-			switch( RIOHosts[host].Type )
-			{
-				case RIO_AT:
-				case RIO_MCA:
-				case RIO_EISA:
-						cmn_err( CE_CONT, "0x%x ", RIOHosts[host].Ivec );
-						break;
-				case RIO_PCI:
-						cmn_err( CE_CONT, "0x%x ", get_intr_arg( RIOHosts[host].PciDevInfo.busnum, IDIST_PCI_IRQ( RIOHosts[host].PciDevInfo.slotnum, RIOHosts[host].PciDevInfo.funcnum ) ));
-						break;
-			}
-		}
-		cmn_err( CE_CONT, "\n" );
-	}
-#endif
-}
-
-/*
 ** RIO Host Service routine. Does all the work traditionally associated with an
 ** interrupt.
 */
@@ -710,7 +550,7 @@ int From; 
 ** NB: Called with the tty locked. The spl from the lockb( ) is passed.
 ** we return the ttySpl level that we re-locked at.
 */
-void
+static void
 RIOReceive(p, PortP)
 struct rio_info *	p;
 struct Port *		PortP;
diff -puN drivers/char/rio/rio_linux.c~small-drivers-char-rio-cleanups-fwd drivers/char/rio/rio_linux.c
--- 25/drivers/char/rio/rio_linux.c~small-drivers-char-rio-cleanups-fwd	2004-11-17 22:04:58.024554032 -0800
+++ 25-akpm/drivers/char/rio/rio_linux.c	2004-11-17 22:05:19.980216264 -0800
@@ -32,11 +32,6 @@
  *
  * */
 
-
-#define RCS_ID "$Id: rio.c,v 1.1 1999/07/11 10:13:54 wolff Exp wolff $"
-#define RCS_REV "$Revision: 1.1 $"
-
-
 #include <linux/module.h>
 #include <linux/config.h> 
 #include <linux/kdev_t.h>
@@ -198,7 +193,7 @@ static int rio_fw_ioctl (struct inode *i
 		         unsigned int cmd, unsigned long arg);
 static int rio_init_drivers(void);
 
-void my_hd (void *addr, int len);
+static void my_hd (void *addr, int len);
 
 static struct tty_driver *rio_driver, *rio_driver2;
 
@@ -206,11 +201,6 @@ static struct tty_driver *rio_driver, *r
 sources use all over the place. */
 struct rio_info *p;
 
-/* struct rio_board boards[RIO_HOSTS]; */
-struct rio_port *rio_ports;
-
-int rio_initialized;
-int rio_nports;
 int rio_debug;
 
 
@@ -218,12 +208,12 @@ int rio_debug;
     - Set rio_poll to 1 to poll every timer tick (10ms on Intel). 
       This is used when the card cannot use an interrupt for some reason.
 */
-int rio_poll = 1;
+static int rio_poll = 1;
 
 
 /* These are the only open spaces in my computer. Yours may have more
    or less.... */
-int rio_probe_addrs[]= {0xc0000, 0xd0000, 0xe0000};
+static int rio_probe_addrs[]= {0xc0000, 0xd0000, 0xe0000};
 
 #define NR_RIO_ADDRS (sizeof(rio_probe_addrs)/sizeof (int))
 
@@ -264,7 +254,7 @@ static struct file_operations rio_fw_fop
 	.ioctl		= rio_fw_ioctl,
 };
 
-struct miscdevice rio_fw_device = {
+static struct miscdevice rio_fw_device = {
 	RIOCTL_MISC_MINOR, "rioctl", &rio_fw_fops
 };
 
@@ -302,7 +292,7 @@ static inline int rio_paranoia_check(str
 
 
 #ifdef DEBUG
-void my_hd (void *ad, int len)
+static void my_hd (void *ad, int len)
 {
   int i, j, ch;
   unsigned char *addr = ad;
@@ -387,7 +377,7 @@ static int rio_set_real_termios (void *p
 }
 
 
-void rio_reset_interrupt (struct Host *HostP)
+static void rio_reset_interrupt (struct Host *HostP)
 {
   func_enter();
 
@@ -824,7 +814,7 @@ static void rio_unthrottle (struct tty_s
  * ********************************************************************** */
 
 
-struct vpd_prom *get_VPD_PROM (struct Host *hp)
+static struct vpd_prom *get_VPD_PROM (struct Host *hp)
 {
   static struct vpd_prom vpdp;
   char *p;
@@ -1045,7 +1035,7 @@ static void  __exit rio_release_drivers(
    EEprom.  As the bit is read/write for the CPU, we can fix it here,
    if we detect that it isn't set correctly. -- REW */
 
-void fix_rio_pci (struct pci_dev *pdev)
+static void fix_rio_pci (struct pci_dev *pdev)
 {
   unsigned int hwbase;
   unsigned long rebase;
diff -puN drivers/char/rio/rioroute.c~small-drivers-char-rio-cleanups-fwd drivers/char/rio/rioroute.c
--- 25/drivers/char/rio/rioroute.c~small-drivers-char-rio-cleanups-fwd	2004-11-17 22:04:58.027553576 -0800
+++ 25-akpm/drivers/char/rio/rioroute.c	2004-11-17 22:04:59.652306576 -0800
@@ -83,6 +83,12 @@ static char *_rioroute_c_sccs_ = "@(#)ri
 #include "list.h"
 #include "sam.h"
 
+static int RIOCheckIsolated(struct rio_info *, struct Host *, uint);
+static int RIOIsolate(struct rio_info *, struct Host *, uint);
+static int RIOCheck(struct Host *, uint);
+static void RIOConCon(struct rio_info *, struct Host *, uint, uint, uint, uint, int);
+
+
 /*
 ** Incoming on the ROUTE_RUP
 ** I wrote this while I was tired. Forgive me.
@@ -717,7 +723,7 @@ uint unit;
 ** the world about it. This is done to ensure that the configurator
 ** only gets up-to-date information about what is going on.
 */
-int
+static int
 RIOCheckIsolated(p, HostP, UnitId)
 struct rio_info *	p;
 struct Host *HostP;
@@ -747,7 +753,7 @@ uint UnitId;
 ** all the units attached to it. This will mean that the entire
 ** subnet will re-introduce itself.
 */
-int
+static int
 RIOIsolate(p, HostP, UnitId)
 struct rio_info *	p;
 struct Host *		HostP;
@@ -782,7 +788,7 @@ uint UnitId; 
 	return 1;
 }
 
-int
+static int
 RIOCheck(HostP, UnitId)
 struct Host *HostP;
 uint UnitId;
@@ -883,7 +889,7 @@ struct rio_info *	p;
 	return(0);
 }
 
-void
+static void
 RIOConCon(p, HostP, FromId, FromLink, ToId, ToLink, Change)
 struct rio_info *	p;
 struct Host *HostP;
@@ -966,7 +972,7 @@ int Change; 
 ** Delete and RTA entry from the saved table given to us
 ** by the configuration program.
 */
-int
+static int
 RIORemoveFromSavedTable(struct rio_info *p, struct Map *pMap)
 {
     int		entry;
@@ -993,7 +999,7 @@ RIORemoveFromSavedTable(struct rio_info 
 ** Scan the unit links to and return zero if the unit is completely
 ** disconnected.
 */
-int
+static int
 RIOFreeDisconnected(struct rio_info *p, struct Host *HostP, int unit)
 {
     int		link;
diff -puN drivers/char/rio/riotable.c~small-drivers-char-rio-cleanups-fwd drivers/char/rio/riotable.c
--- 25/drivers/char/rio/riotable.c~small-drivers-char-rio-cleanups-fwd	2004-11-17 22:04:58.031552968 -0800
+++ 25-akpm/drivers/char/rio/riotable.c	2004-11-17 22:04:59.653306424 -0800
@@ -37,6 +37,7 @@ static char *_riotable_c_sccs_ = "@(#)ri
 #include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
+#include <linux/string.h>
 
 #include <asm/io.h>
 #include <asm/system.h>
@@ -276,7 +277,7 @@ struct rio_info *	p;
 						return -ENXIO;
 					}
 					rio_dprintk (RIO_DEBUG_TABLE, "RIONewTable: entering(9)\n"); 
-					if (RIOStrCmp(MapP->Name,
+					if (strcmp(MapP->Name,
 							p->RIOConnectTable[SubEnt].Name)==0 && !(MapP->Flags & RTA16_SECOND_SLOT)) { /* (9) */
 						rio_dprintk (RIO_DEBUG_TABLE, "RTA name %s used twice\n", MapP->Name);
 						p->RIOError.Error = NAME_USED_TWICE;
@@ -405,7 +406,7 @@ struct rio_info *	p;
 			for ( Host2=0; Host2<p->RIONumHosts; Host2++ ) {
 				if (Host2 == Host)
 					continue;
-				if (RIOStrCmp(p->RIOHosts[Host].Name, p->RIOHosts[Host2].Name)
+				if (strcmp(p->RIOHosts[Host].Name, p->RIOHosts[Host2].Name)
 									 == 0) {
 					NameIsUnique = 0;
 					Host1++;
@@ -940,20 +941,6 @@ struct Map *HostMapP; 
 		PortP->FirstOpen	= 1;
 
 		/*
-		** handle the xprint issues
-		*/
-#ifdef XPRINT_SUPPORT
-		PortP->Xprint.XpActive	= 0;
-		PortP->Xprint.XttyP = &riox_tty[SysPort];
-		/*				TO				FROM			MAXLEN */
-		RIOStrNCpy( PortP->Xprint.XpOn,	RIOConf.XpOn,	MAX_XP_CTRL_LEN );
-		RIOStrNCpy( PortP->Xprint.XpOff, RIOConf.XpOff, MAX_XP_CTRL_LEN );
-		PortP->Xprint.XpCps = RIOConf.XpCps;
-		PortP->Xprint.XpLen = RIOStrlen(PortP->Xprint.XpOn)+
-									RIOStrlen(PortP->Xprint.XpOff);
-#endif
-
-		/*
 		** Buffers 'n things
 		*/
 		PortP->RxDataStart	= 0;
diff -puN drivers/char/rio/riotty.c~small-drivers-char-rio-cleanups-fwd drivers/char/rio/riotty.c
--- 25/drivers/char/rio/riotty.c~small-drivers-char-rio-cleanups-fwd	2004-11-17 22:04:58.034552512 -0800
+++ 25-akpm/drivers/char/rio/riotty.c	2004-11-17 22:04:59.654306272 -0800
@@ -40,6 +40,7 @@ static char *_riotty_c_sccs_ = "@(#)riot
 #include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/tty.h>
+#include <linux/string.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/string.h>
@@ -97,6 +98,9 @@ static void RIOClearUp(struct Port *Port
 int RIOShortCommand(struct rio_info *p, struct Port *PortP, 
 			   int command, int len, int arg);
 
+#if 0
+static int RIOCookMode(struct ttystatics *);
+#endif
 
 extern int	conv_vb[];	/* now defined in ttymgr.c */
 extern int	conv_bv[];	/* now defined in ttymgr.c */
@@ -726,7 +730,8 @@ close_end:
 ** COOK_WELL if the line discipline must be used to do the processing
 ** COOK_MEDIUM if the card can do all the processing necessary.
 */
-int
+#if 0
+static int
 RIOCookMode(struct ttystatics *tp)
 {
 	/*
@@ -757,7 +762,7 @@ RIOCookMode(struct ttystatics *tp)
 	*/
 	return COOK_MEDIUM;
 }
-
+#endif
 
 static void
 RIOClearUp(PortP)
@@ -1011,8 +1016,8 @@ riotioctl(struct rio_info *p, struct tty
 				pseterr(EFAULT);
 			}
 			PortP->Xprint.XpOn[MAX_XP_CTRL_LEN-1] = '\0';
-			PortP->Xprint.XpLen = RIOStrlen(PortP->Xprint.XpOn)+
-												RIOStrlen(PortP->Xprint.XpOff);
+			PortP->Xprint.XpLen = strlen(PortP->Xprint.XpOn)+
+												strlen(PortP->Xprint.XpOff);
 			rio_spin_unlock_irqrestore(&PortP->portSem, flags);
 			return 0;
 
@@ -1026,8 +1031,8 @@ riotioctl(struct rio_info *p, struct tty
 				pseterr(EFAULT);
 			}
 			PortP->Xprint.XpOff[MAX_XP_CTRL_LEN-1] = '\0';
-			PortP->Xprint.XpLen = RIOStrlen(PortP->Xprint.XpOn)+
-										RIOStrlen(PortP->Xprint.XpOff);
+			PortP->Xprint.XpLen = strlen(PortP->Xprint.XpOn)+
+										strlen(PortP->Xprint.XpOff);
 			rio_spin_unlock_irqrestore(&PortP->portSem, flags);
 			return 0;
 
_