Commit f061c584 authored by Al Viro's avatar Al Viro Committed by Linus Torvalds

[PATCH] i2Output always takes kernel data now

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent cff52daf
...@@ -1007,7 +1007,7 @@ i2InputAvailable(i2ChanStrPtr pCh) ...@@ -1007,7 +1007,7 @@ i2InputAvailable(i2ChanStrPtr pCh)
// applications that one cannot break out of. // applications that one cannot break out of.
//****************************************************************************** //******************************************************************************
static int static int
i2Output(i2ChanStrPtr pCh, const char *pSource, int count, int user ) i2Output(i2ChanStrPtr pCh, const char *pSource, int count)
{ {
i2eBordStrPtr pB; i2eBordStrPtr pB;
unsigned char *pInsert; unsigned char *pInsert;
...@@ -1020,7 +1020,7 @@ i2Output(i2ChanStrPtr pCh, const char *pSource, int count, int user ) ...@@ -1020,7 +1020,7 @@ i2Output(i2ChanStrPtr pCh, const char *pSource, int count, int user )
int bailout = 10; int bailout = 10;
ip2trace (CHANN, ITRC_OUTPUT, ITRC_ENTER, 2, count, user ); ip2trace (CHANN, ITRC_OUTPUT, ITRC_ENTER, 2, count, 0 );
// Ensure channel structure seems real // Ensure channel structure seems real
if ( !i2Validate ( pCh ) ) if ( !i2Validate ( pCh ) )
...@@ -1087,12 +1087,7 @@ i2Output(i2ChanStrPtr pCh, const char *pSource, int count, int user ) ...@@ -1087,12 +1087,7 @@ i2Output(i2ChanStrPtr pCh, const char *pSource, int count, int user )
DATA_COUNT_OF(pInsert) = amountToMove; DATA_COUNT_OF(pInsert) = amountToMove;
// Move the data // Move the data
if ( user ) {
rc = copy_from_user((char*)(DATA_OF(pInsert)), pSource,
amountToMove );
} else {
memcpy( (char*)(DATA_OF(pInsert)), pSource, amountToMove ); memcpy( (char*)(DATA_OF(pInsert)), pSource, amountToMove );
}
// Adjust pointers and indices // Adjust pointers and indices
pSource += amountToMove; pSource += amountToMove;
pCh->Obuf_char_count += amountToMove; pCh->Obuf_char_count += amountToMove;
......
...@@ -332,7 +332,7 @@ static int i2QueueCommands(int, i2ChanStrPtr, int, int, cmdSyntaxPtr,...); ...@@ -332,7 +332,7 @@ static int i2QueueCommands(int, i2ChanStrPtr, int, int, cmdSyntaxPtr,...);
static int i2GetStatus(i2ChanStrPtr, int); static int i2GetStatus(i2ChanStrPtr, int);
static int i2Input(i2ChanStrPtr); static int i2Input(i2ChanStrPtr);
static int i2InputFlush(i2ChanStrPtr); static int i2InputFlush(i2ChanStrPtr);
static int i2Output(i2ChanStrPtr, const char *, int, int); static int i2Output(i2ChanStrPtr, const char *, int);
static int i2OutputFree(i2ChanStrPtr); static int i2OutputFree(i2ChanStrPtr);
static int i2ServiceBoard(i2eBordStrPtr); static int i2ServiceBoard(i2eBordStrPtr);
static void i2DrainOutput(i2ChanStrPtr, int); static void i2DrainOutput(i2ChanStrPtr, int);
......
...@@ -1704,7 +1704,7 @@ ip2_write( PTTY tty, const unsigned char *pData, int count) ...@@ -1704,7 +1704,7 @@ ip2_write( PTTY tty, const unsigned char *pData, int count)
/* This is the actual move bit. Make sure it does what we need!!!!! */ /* This is the actual move bit. Make sure it does what we need!!!!! */
WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags);
bytesSent = i2Output( pCh, pData, count, 0 ); bytesSent = i2Output( pCh, pData, count);
WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags);
ip2trace (CHANN, ITRC_WRITE, ITRC_RETURN, 1, bytesSent ); ip2trace (CHANN, ITRC_WRITE, ITRC_RETURN, 1, bytesSent );
...@@ -1764,7 +1764,7 @@ ip2_flush_chars( PTTY tty ) ...@@ -1764,7 +1764,7 @@ ip2_flush_chars( PTTY tty )
// //
// We may need to restart i2Output if it does not fullfill this request // We may need to restart i2Output if it does not fullfill this request
// //
strip = i2Output( pCh, pCh->Pbuf, pCh->Pbuf_stuff, 0 ); strip = i2Output( pCh, pCh->Pbuf, pCh->Pbuf_stuff);
if ( strip != pCh->Pbuf_stuff ) { if ( strip != pCh->Pbuf_stuff ) {
memmove( pCh->Pbuf, &pCh->Pbuf[strip], pCh->Pbuf_stuff - strip ); memmove( pCh->Pbuf, &pCh->Pbuf[strip], pCh->Pbuf_stuff - strip );
} }
......
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