summaryrefslogtreecommitdiffstats
path: root/drivers/staging/dgnc
diff options
context:
space:
mode:
authorGiedrius Statkevičius2015-04-10 16:48:54 +0200
committerGreg Kroah-Hartman2015-05-08 09:24:01 +0200
commita74d8e21679cdb2b087ff386c34e874af8bac77a (patch)
treef38a92edc3452ca2793eb2c7cae7af0e110b8ee4 /drivers/staging/dgnc
parentstaging: ion: chunk_heap: use pr_debug for heap creation print (diff)
downloadkernel-qcow2-linux-a74d8e21679cdb2b087ff386c34e874af8bac77a.tar.gz
kernel-qcow2-linux-a74d8e21679cdb2b087ff386c34e874af8bac77a.tar.xz
kernel-qcow2-linux-a74d8e21679cdb2b087ff386c34e874af8bac77a.zip
staging: dgnc: remove dead code in dgnc_tty_write()
Remove the dead code protected by in_user in dgnc_tty_write() because it is set to 0 and never changed to 1 thus the code in ifs never gets executed. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dgnc')
-rw-r--r--drivers/staging/dgnc/dgnc_tty.c45
1 files changed, 1 insertions, 44 deletions
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 6c9261cb88ec..cde55e001f8d 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -42,16 +42,11 @@
#include "dgnc_sysfs.h"
#include "dgnc_utils.h"
-#define init_MUTEX(sem) sema_init(sem, 1)
-#define DECLARE_MUTEX(name) \
- struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1)
-
/*
* internal variables
*/
static struct dgnc_board *dgnc_BoardsByMajor[256];
static unsigned char *dgnc_TmpWriteBuf;
-static DECLARE_MUTEX(dgnc_TmpWriteSem);
/*
* Default transparent print information.
@@ -1692,7 +1687,6 @@ static int dgnc_tty_write(struct tty_struct *tty,
ushort tail;
ushort tmask;
uint remain;
- int from_user = 0;
if (tty == NULL || dgnc_TmpWriteBuf == NULL)
return 0;
@@ -1772,38 +1766,6 @@ static int dgnc_tty_write(struct tty_struct *tty,
if (count <= 0)
goto exit_retry;
- if (from_user) {
-
- count = min(count, WRITEBUFLEN);
-
- spin_unlock_irqrestore(&ch->ch_lock, flags);
-
- /*
- * If data is coming from user space, copy it into a temporary
- * buffer so we don't get swapped out while doing the copy to
- * the board.
- */
- /* we're allowed to block if it's from_user */
- if (down_interruptible(&dgnc_TmpWriteSem))
- return -EINTR;
-
- /*
- * copy_from_user() returns the number
- * of bytes that could *NOT* be copied.
- */
- count -= copy_from_user(dgnc_TmpWriteBuf, (const unsigned char __user *) buf, count);
-
- if (!count) {
- up(&dgnc_TmpWriteSem);
- return -EFAULT;
- }
-
- spin_lock_irqsave(&ch->ch_lock, flags);
-
- buf = dgnc_TmpWriteBuf;
-
- }
-
n = count;
/*
@@ -1840,12 +1802,7 @@ static int dgnc_tty_write(struct tty_struct *tty,
ch->ch_cpstime += (HZ * count) / ch->ch_digi.digi_maxcps;
}
- if (from_user) {
- spin_unlock_irqrestore(&ch->ch_lock, flags);
- up(&dgnc_TmpWriteSem);
- } else {
- spin_unlock_irqrestore(&ch->ch_lock, flags);
- }
+ spin_unlock_irqrestore(&ch->ch_lock, flags);
if (count) {
/*