All of lore.kernel.org
 help / color / mirror / Atom feed
* [build error] istallion build failure
@ 2008-07-21  9:21 Wang Chen
  2008-07-21  9:48 ` Wang Chen
  2008-07-21 10:33 ` [build error] istallion build failure Ingo Molnar
  0 siblings, 2 replies; 4+ messages in thread
From: Wang Chen @ 2008-07-21  9:21 UTC (permalink / raw)
  To: Alan Cox, Linus Torvalds, linux-kernel

Alan, commit "istallion: use tty_port"(b02f5ad6a3ff5a1ee2a7b8ec6eee338de553b060)
is guilty.

drivers/char/istallion.c: In function ‘stli_open’:
drivers/char/istallion.c:829: error: ‘struct stliport’ has no member named ‘refcount’
drivers/char/istallion.c: In function ‘stli_close’:
drivers/char/istallion.c:891: error: ‘struct stliport’ has no member named ‘refcount’
drivers/char/istallion.c:892: error: ‘struct stliport’ has no member named ‘refcount’
drivers/char/istallion.c:893: error: ‘struct stliport’ has no member named ‘refcount’
drivers/char/istallion.c:928: error: ‘struct tty_ldisc’ has no member named ‘flush_buffer’
drivers/char/istallion.c:929: error: ‘struct tty_ldisc’ has no member named ‘flush_buffer’
drivers/char/istallion.c: In function ‘stli_waitcarrier’:
drivers/char/istallion.c:1205: error: ‘struct stliport’ has no member named ‘refcount’
drivers/char/istallion.c:1234: error: ‘struct stliport’ has no member named ‘refcount’
drivers/char/istallion.c: In function ‘stli_ioctl’:
drivers/char/istallion.c:1663: warning: unused variable ‘ival’
drivers/char/istallion.c: In function ‘stli_hangup’:
drivers/char/istallion.c:1860: error: ‘struct stliport’ has no member named ‘refcount’
drivers/char/istallion.c: In function ‘stli_portcmdstats’:
drivers/char/istallion.c:4249: error: ‘struct tty_port’ has no member named ‘flag’
drivers/char/istallion.c: At top level:
drivers/char/istallion.c:4500: warning: initialization from incompatible pointer type
make[2]: *** [drivers/char/istallion.o] Error 1
make[1]: *** [drivers/char] Error 2
make: *** [drivers] Error 2



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [build error] istallion build failure
  2008-07-21  9:21 [build error] istallion build failure Wang Chen
@ 2008-07-21  9:48 ` Wang Chen
  2008-07-22 12:44   ` [PATCH] istallion: Small follow up for the fixes to istallion Alan Cox
  2008-07-21 10:33 ` [build error] istallion build failure Ingo Molnar
  1 sibling, 1 reply; 4+ messages in thread
From: Wang Chen @ 2008-07-21  9:48 UTC (permalink / raw)
  To: Alan Cox, Linus Torvalds, linux-kernel

Wang Chen said the following on 2008-7-21 17:21:
> Alan, commit "istallion: use tty_port"(b02f5ad6a3ff5a1ee2a7b8ec6eee338de553b060)
> is guilty.
> 
> drivers/char/istallion.c: In function ‘stli_open’:
> drivers/char/istallion.c:829: error: ‘struct stliport’ has no member named ‘refcount’
> drivers/char/istallion.c: In function ‘stli_close’:
> drivers/char/istallion.c:891: error: ‘struct stliport’ has no member named ‘refcount’
> drivers/char/istallion.c:892: error: ‘struct stliport’ has no member named ‘refcount’
> drivers/char/istallion.c:893: error: ‘struct stliport’ has no member named ‘refcount’
> drivers/char/istallion.c:928: error: ‘struct tty_ldisc’ has no member named ‘flush_buffer’
> drivers/char/istallion.c:929: error: ‘struct tty_ldisc’ has no member named ‘flush_buffer’
> drivers/char/istallion.c: In function ‘stli_waitcarrier’:
> drivers/char/istallion.c:1205: error: ‘struct stliport’ has no member named ‘refcount’
> drivers/char/istallion.c:1234: error: ‘struct stliport’ has no member named ‘refcount’
> drivers/char/istallion.c: In function ‘stli_ioctl’:
> drivers/char/istallion.c:1663: warning: unused variable ‘ival’
> drivers/char/istallion.c: In function ‘stli_hangup’:
> drivers/char/istallion.c:1860: error: ‘struct stliport’ has no member named ‘refcount’
> drivers/char/istallion.c: In function ‘stli_portcmdstats’:
> drivers/char/istallion.c:4249: error: ‘struct tty_port’ has no member named ‘flag’
> drivers/char/istallion.c: At top level:
> drivers/char/istallion.c:4500: warning: initialization from incompatible pointer type
> make[2]: *** [drivers/char/istallion.o] Error 1
> make[1]: *** [drivers/char] Error 2
> make: *** [drivers] Error 2
> 

Fix the compile error which was caused by commit "istallion: use tty_port" and "tty: Ldisc revamp".
Also make the warning silent.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
---
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index 6ef1c56..7930fba 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -598,7 +598,7 @@ static int	stli_parsebrd(struct stlconf *confp, char **argp);
 static int	stli_open(struct tty_struct *tty, struct file *filp);
 static void	stli_close(struct tty_struct *tty, struct file *filp);
 static int	stli_write(struct tty_struct *tty, const unsigned char *buf, int count);
-static void	stli_putchar(struct tty_struct *tty, unsigned char ch);
+static int	stli_putchar(struct tty_struct *tty, unsigned char ch);
 static void	stli_flushchars(struct tty_struct *tty);
 static int	stli_writeroom(struct tty_struct *tty);
 static int	stli_charsinbuffer(struct tty_struct *tty);
@@ -826,7 +826,7 @@ static int stli_open(struct tty_struct *tty, struct file *filp)
  */
 	portp->port.tty = tty;
 	tty->driver_data = portp;
-	portp->refcount++;
+	portp->port.count++;
 
 	wait_event_interruptible(portp->raw_wait,
 			!test_bit(ST_INITIALIZING, &portp->state));
@@ -888,9 +888,9 @@ static void stli_close(struct tty_struct *tty, struct file *filp)
 		spin_unlock_irqrestore(&stli_lock, flags);
 		return;
 	}
-	if ((tty->count == 1) && (portp->refcount != 1))
-		portp->refcount = 1;
-	if (portp->refcount-- > 1) {
+	if ((tty->count == 1) && (portp->port.count != 1))
+		portp->port.count = 1;
+	if (portp->port.count-- > 1) {
 		spin_unlock_irqrestore(&stli_lock, flags);
 		return;
 	}
@@ -925,8 +925,8 @@ static void stli_close(struct tty_struct *tty, struct file *filp)
 	clear_bit(ST_TXBUSY, &portp->state);
 	clear_bit(ST_RXSTOP, &portp->state);
 	set_bit(TTY_IO_ERROR, &tty->flags);
-	if (tty->ldisc.flush_buffer)
-		(tty->ldisc.flush_buffer)(tty);
+	if (tty->ldisc.ops->flush_buffer)
+		(tty->ldisc.ops->flush_buffer)(tty);
 	set_bit(ST_DOFLUSHRX, &portp->state);
 	stli_flushbuffer(tty);
 
@@ -1202,7 +1202,7 @@ static int stli_waitcarrier(struct stlibrd *brdp, struct stliport *portp, struct
 	spin_lock_irqsave(&stli_lock, flags);
 	portp->openwaitcnt++;
 	if (! tty_hung_up_p(filp))
-		portp->refcount--;
+		portp->port.count--;
 	spin_unlock_irqrestore(&stli_lock, flags);
 
 	for (;;) {
@@ -1231,7 +1231,7 @@ static int stli_waitcarrier(struct stlibrd *brdp, struct stliport *portp, struct
 
 	spin_lock_irqsave(&stli_lock, flags);
 	if (! tty_hung_up_p(filp))
-		portp->refcount++;
+		portp->port.count++;
 	portp->openwaitcnt--;
 	spin_unlock_irqrestore(&stli_lock, flags);
 
@@ -1333,7 +1333,7 @@ static int stli_write(struct tty_struct *tty, const unsigned char *buf, int coun
  *	first them do the new ports.
  */
 
-static void stli_putchar(struct tty_struct *tty, unsigned char ch)
+static int stli_putchar(struct tty_struct *tty, unsigned char ch)
 {
 	if (tty != stli_txcooktty) {
 		if (stli_txcooktty != NULL)
@@ -1342,6 +1342,7 @@ static void stli_putchar(struct tty_struct *tty, unsigned char ch)
 	}
 
 	stli_txcookbuf[stli_txcooksize++] = ch;
+	return 0;
 }
 
 /*****************************************************************************/
@@ -1660,7 +1661,6 @@ static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
 {
 	struct stliport *portp;
 	struct stlibrd *brdp;
-	unsigned int ival;
 	int rc;
 	void __user *argp = (void __user *)arg;
 
@@ -1857,7 +1857,7 @@ static void stli_hangup(struct tty_struct *tty)
 	set_bit(TTY_IO_ERROR, &tty->flags);
 	portp->port.tty = NULL;
 	portp->port.flags &= ~ASYNC_NORMAL_ACTIVE;
-	portp->refcount = 0;
+	portp->port.count = 0;
 	spin_unlock_irqrestore(&stli_lock, flags);
 
 	wake_up_interruptible(&portp->port.open_wait);
@@ -4246,7 +4246,7 @@ static int stli_portcmdstats(struct stliport *portp)
 	stli_comstats.panel = portp->panelnr;
 	stli_comstats.port = portp->portnr;
 	stli_comstats.state = portp->state;
-	stli_comstats.flags = portp->port.flag;
+	stli_comstats.flags = portp->port.flags;
 
 	spin_lock_irqsave(&brd_lock, flags);
 	if (portp->port.tty != NULL) {



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [build error] istallion build failure
  2008-07-21  9:21 [build error] istallion build failure Wang Chen
  2008-07-21  9:48 ` Wang Chen
@ 2008-07-21 10:33 ` Ingo Molnar
  1 sibling, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2008-07-21 10:33 UTC (permalink / raw)
  To: Wang Chen; +Cc: Alan Cox, Linus Torvalds, linux-kernel


* Wang Chen <wangchen@cn.fujitsu.com> wrote:

> Alan, commit "istallion: use tty_port"(b02f5ad6a3ff5a1ee2a7b8ec6eee338de553b060)
> is guilty.
> 
> drivers/char/istallion.c: In function ‘stli_open’:
> drivers/char/istallion.c:829: error: ‘struct stliport’ has no member named ‘refcount’
> drivers/char/istallion.c: In function ‘stli_close’:
> drivers/char/istallion.c:891: error: ‘struct stliport’ has no member named ‘refcount’

i've triggered it too and bisected it back to:

| a352def21a642133758b868c71bee12ab34ad5c5 is first bad commit
| commit a352def21a642133758b868c71bee12ab34ad5c5
| Author: Alan Cox <alan@redhat.com>
| Date:   Wed Jul 16 21:53:12 2008 +0100
|
|    tty: Ldisc revamp

	Ingo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] istallion: Small follow up for the fixes to istallion
  2008-07-21  9:48 ` Wang Chen
@ 2008-07-22 12:44   ` Alan Cox
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Cox @ 2008-07-22 12:44 UTC (permalink / raw)
  To: Wang Chen; +Cc: Alan Cox, Linus Torvalds, linux-kernel

> Fix the compile error which was caused by commit "istallion: use tty_port" and "tty: Ldisc revamp".
> Also make the warning silent.

Sorry about that one.

There is a bit more fixing needed as the ldisc reference isn't held
during close. 

--

istallion: Use helpers

From: Alan Cox <alan@redhat.com>

The ldisc needs to be referenced properly when used. The tty layer has a
helper for this which should have been used but this driver got missed
originally.

Signed-off-by: Alan Cox <alan@redhat.com>
---

 drivers/char/istallion.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)


diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index 63d22b5..f9ebcd4 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -925,8 +925,7 @@ static void stli_close(struct tty_struct *tty, struct file *filp)
 	clear_bit(ST_TXBUSY, &portp->state);
 	clear_bit(ST_RXSTOP, &portp->state);
 	set_bit(TTY_IO_ERROR, &tty->flags);
-	if (tty->ldisc.ops->flush_buffer)
-		(tty->ldisc.ops->flush_buffer)(tty);
+	tty_ldisc_flush(tty);
 	set_bit(ST_DOFLUSHRX, &portp->state);
 	stli_flushbuffer(tty);
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-07-22 13:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-21  9:21 [build error] istallion build failure Wang Chen
2008-07-21  9:48 ` Wang Chen
2008-07-22 12:44   ` [PATCH] istallion: Small follow up for the fixes to istallion Alan Cox
2008-07-21 10:33 ` [build error] istallion build failure Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.