public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix inlining related build failures in mxser.c
@ 2004-12-24  1:01 Jesper Juhl
  2004-12-24  0:59 ` Alan Cox
  2004-12-24 12:06 ` Jan Engelhardt
  0 siblings, 2 replies; 12+ messages in thread
From: Jesper Juhl @ 2004-12-24  1:01 UTC (permalink / raw)
  To: Alan Cox; +Cc: Moxa Technologies, Linux Kernel Mailing List


Hi,

An allyesconfig build of 2.6.10-rc3-bk16 revealed the following build 
failures (which arefixed by the patch below) :

  CC      drivers/char/mxser.o
drivers/char/mxser.c: In function `mxser_ioctl':
drivers/char/mxser.c:415: sorry, unimplemented: inlining failed in call to 
'mxser_check_modem_status': function body not available
drivers/char/mxser.c:1407: sorry, unimplemented: called from here
make[2]: *** [drivers/char/mxser.o] Error 1
make[1]: *** [drivers/char] Error 2
make: *** [drivers] Error 2

  CC      drivers/char/mxser.o
drivers/char/mxser.c: In function `mxser_interrupt':
drivers/char/mxser.c:413: sorry, unimplemented: inlining failed in call to 
'mxser_receive_chars': function body not available
drivers/char/mxser.c:1953: sorry, unimplemented: called from here
drivers/char/mxser.c:413: sorry, unimplemented: inlining failed in call to 
'mxser_receive_chars': function body not available
drivers/char/mxser.c:1960: sorry, unimplemented: called from here
drivers/char/mxser.c:414: sorry, unimplemented: inlining failed in call to 
'mxser_transmit_chars': function body not available
drivers/char/mxser.c:1969: sorry, unimplemented: called from here
drivers/char/mxser.c:414: sorry, unimplemented: inlining failed in call to 
'mxser_transmit_chars': function body not available
drivers/char/mxser.c:1978: sorry, unimplemented: called from here
make[2]: *** [drivers/char/mxser.o] Error 1
make[1]: *** [drivers/char] Error 2
make: *** [drivers] Error 2

  CC      drivers/char/mxser.o
drivers/char/mxser.c: In function `mxser_interrupt':
drivers/char/mxser.c:414: sorry, unimplemented: inlining failed in call to 
'mxser_transmit_chars': function body not available
drivers/char/mxser.c:1969: sorry, unimplemented: called from here
drivers/char/mxser.c:414: sorry, unimplemented: inlining failed in call to 
'mxser_transmit_chars': function body not available
drivers/char/mxser.c:1978: sorry, unimplemented: called from here
make[2]: *** [drivers/char/mxser.o] Error 1
make[1]: *** [drivers/char] Error 2
make: *** [drivers] Error 2


One simple way to fix those is to simply un-inline the functions in 
question (and since they are somewhat large that's what I did) - an 
alternative would be to rework the ordering of the file so the functions 
are defined before their first use.


Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>

diff -up linux-2.6.10-rc3-bk16-orig/drivers/char/mxser.c linux-2.6.10-rc3-bk16/drivers/char/mxser.c
--- linux-2.6.10-rc3-bk16-orig/drivers/char/mxser.c	2004-12-23 23:26:48.000000000 +0100
+++ linux-2.6.10-rc3-bk16/drivers/char/mxser.c	2004-12-24 01:54:15.000000000 +0100
@@ -410,9 +410,9 @@ static void mxser_start(struct tty_struc
 static void mxser_hangup(struct tty_struct *);
 static void mxser_rs_break(struct tty_struct *, int);
 static irqreturn_t mxser_interrupt(int, void *, struct pt_regs *);
-static inline void mxser_receive_chars(struct mxser_struct *, int *);
-static inline void mxser_transmit_chars(struct mxser_struct *);
-static inline void mxser_check_modem_status(struct mxser_struct *, int);
+static void mxser_receive_chars(struct mxser_struct *, int *);
+static void mxser_transmit_chars(struct mxser_struct *);
+static void mxser_check_modem_status(struct mxser_struct *, int);
 static int mxser_block_til_ready(struct tty_struct *, struct file *, struct mxser_struct *);
 static int mxser_startup(struct mxser_struct *);
 static void mxser_shutdown(struct mxser_struct *);
@@ -1989,7 +1989,7 @@ static irqreturn_t mxser_interrupt(int i
 	return handled;
 }
 
-static inline void mxser_receive_chars(struct mxser_struct *info, int *status)
+static void mxser_receive_chars(struct mxser_struct *info, int *status)
 {
 	struct tty_struct *tty = info->tty;
 	unsigned char ch, gdl;
@@ -2143,7 +2143,7 @@ intr_old:
 
 }
 
-static inline void mxser_transmit_chars(struct mxser_struct *info)
+static void mxser_transmit_chars(struct mxser_struct *info)
 {
 	int count, cnt;
 	unsigned long flags;
@@ -2206,7 +2206,7 @@ static inline void mxser_transmit_chars(
 	spin_unlock_irqrestore(&info->slock, flags);
 }
 
-static inline void mxser_check_modem_status(struct mxser_struct *info, int status)
+static void mxser_check_modem_status(struct mxser_struct *info, int status)
 {
 	/* update input line counters */
 	if (status & UART_MSR_TERI)




^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [PATCH] fix inlining related build failures in mxser.c
@ 2004-12-25 11:01 Mikael Pettersson
  2004-12-25 11:27 ` Jan Engelhardt
  0 siblings, 1 reply; 12+ messages in thread
From: Mikael Pettersson @ 2004-12-25 11:01 UTC (permalink / raw)
  To: fw, juhl-lkml; +Cc: linux-kernel

On Fri, 24 Dec 2004 14:54:43 +0100, Florian Weimer wrote:
>* Jesper Juhl:
>
>>> Add -funit-at-a-time to the CFLAGS, and the compiler is happy.
>>> 
>> But, does unit-at-a-time work reliably for all compilers on all archs back 
>> to and including gcc 2.95.3 ? 
>
>Unit-at-a-time is only available in GCC 3.4 and above.

The problem with unit-at-a-time isn't compiler availability,
but the fact that at least with gcc-3.4 on x86 it causes
significant stack usage increases, which in the kernel lead
to stack overflow problems. This is not a theoretical issue,
the overflows have been observed in normal kernels.

So wrt inlining failures, the correct fix is to remove the
inlines or rearrange the code to allow inlining w/o unit-at-a-time.

/Mikael

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

end of thread, other threads:[~2005-01-03 18:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-24  1:01 [PATCH] fix inlining related build failures in mxser.c Jesper Juhl
2004-12-24  0:59 ` Alan Cox
2004-12-24  1:20   ` Jesper Juhl
2004-12-24 12:06 ` Jan Engelhardt
2004-12-24 13:33   ` Jesper Juhl
2004-12-24 13:33     ` acct() ? Folkert van Heusden
2004-12-24 14:36       ` Jasper Spaans
2004-12-24 13:54     ` [PATCH] fix inlining related build failures in mxser.c Florian Weimer
2005-01-03 17:44       ` Adrian Bunk
  -- strict thread matches above, loose matches on Subject: below --
2004-12-25 11:01 Mikael Pettersson
2004-12-25 11:27 ` Jan Engelhardt
2004-12-25 21:15   ` Jesper Juhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox