2005-03-05 00:42:48

by Jean Tourrilhes

[permalink] [raw]
Subject: [PATCH 2.6 IrDA] cleanup obsolete construct in IrCOMM

ir261_ircomm_write_cleanup.diff :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
o [FEATURE] cleanup some construct obsoleted by Linus's patch
Signed-off-by: Jean Tourrilhes <[email protected]>



diff -u -p linux/net/irda/ircomm/ircomm_tty.d0.c linux/net/irda/ircomm/ircomm_tty.c
--- linux/net/irda/ircomm/ircomm_tty.d0.c Fri Feb 4 16:19:03 2005
+++ linux/net/irda/ircomm/ircomm_tty.c Fri Feb 4 16:20:54 2005
@@ -671,10 +671,9 @@ static void ircomm_tty_do_softint(void *
* accepted for writing. This routine is mandatory.
*/
static int ircomm_tty_write(struct tty_struct *tty,
- const unsigned char *ubuf, int count)
+ const unsigned char *buf, int count)
{
struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data;
- unsigned char *kbuf; /* Buffer in kernel space */
unsigned long flags;
struct sk_buff *skb;
int tailroom = 0;
@@ -714,9 +713,6 @@ static int ircomm_tty_write(struct tty_s
if (count < 1)
return 0;

- /* The buffer is already in kernel space */
- kbuf = (unsigned char *) ubuf;
-
/* Protect our manipulation of self->tx_skb and related */
spin_lock_irqsave(&self->spinlock, flags);

@@ -779,7 +775,7 @@ static int ircomm_tty_write(struct tty_s
}

/* Copy data */
- memcpy(skb_put(skb,size), kbuf + len, size);
+ memcpy(skb_put(skb,size), buf + len, size);

count -= size;
len += size;