From: Adrian Bunk <bunk@fs.tum.de>
To: support@moxa.com.tw
Cc: linux-kernel@vger.kernel.org
Subject: [2.6 patch] mxser.c: fix inlines
Date: Tue, 13 Jul 2004 02:20:05 +0200 [thread overview]
Message-ID: <20040713002004.GC4701@fs.tum.de> (raw)
Trying to compile drivers/char/mxser.c with gcc 3.4 and
# define inline __inline__ __attribute__((always_inline))
results in the following compile error:
<-- snip -->
...
CC drivers/char/mxser.o
drivers/char/mxser.c: In function `mxser_interrupt':
drivers/char/mxser.c:352: sorry, unimplemented: inlining failed in call
to 'mxser_receive_chars': function body not available
drivers/char/mxser.c:1347: sorry, unimplemented: called from here
drivers/char/mxser.c:354: sorry, unimplemented: inlining failed in call
to 'mxser_check_modem_status': function body not available
drivers/char/mxser.c:1350: sorry, unimplemented: called from here
drivers/char/mxser.c:353: sorry, unimplemented: inlining failed in call
to 'mxser_transmit_chars': function body not available
drivers/char/mxser.c:1355: sorry, unimplemented: called from here
make[2]: *** [drivers/char/mxser.o] Error 1
<-- snip -->
The patch below moves mxser_interrupt below the inline functions it
uses.
An alternative approach would be to remove the inlines.
diffstat output:
drivers/char/mxser.c | 128 +++++++++++++++++++++----------------------
1 files changed, 64 insertions(+), 64 deletions(-)
Signed-off-by: Adrian Bunk <bunk@fs.tum.de>
--- linux-2.6.7-mm7-full-gcc3.4/drivers/char/mxser.c.old 2004-07-13 02:12:23.000000000 +0200
+++ linux-2.6.7-mm7-full-gcc3.4/drivers/char/mxser.c 2004-07-13 02:16:13.000000000 +0200
@@ -348,10 +348,10 @@
static void mxser_stop(struct tty_struct *);
static void mxser_start(struct tty_struct *);
static void mxser_hangup(struct tty_struct *);
-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 irqreturn_t mxser_interrupt(int, void *, struct pt_regs *);
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 *);
@@ -1302,69 +1302,6 @@
wake_up_interruptible(&info->open_wait);
}
-/*
- * This is the serial driver's generic interrupt routine
- */
-static irqreturn_t mxser_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-{
- int status, i;
- struct mxser_struct *info;
- struct mxser_struct *port;
- int max, irqbits, bits, msr;
- int pass_counter = 0;
- int handled = 0;
-
- port = 0;
- for (i = 0; i < MXSER_BOARDS; i++) {
- if (dev_id == &(mxvar_table[i * MXSER_PORTS_PER_BOARD])) {
- port = dev_id;
- break;
- }
- }
-
- if (i == MXSER_BOARDS)
- return IRQ_NONE;
- if (port == 0)
- return IRQ_NONE;
- max = mxser_numports[mxsercfg[i].board_type];
-
- while (1) {
- irqbits = inb(port->vector) & port->vectormask;
- if (irqbits == port->vectormask)
- break;
- handled = 1;
- for (i = 0, bits = 1; i < max; i++, irqbits |= bits, bits <<= 1) {
- if (irqbits == port->vectormask)
- break;
- if (bits & irqbits)
- continue;
- info = port + i;
- if (!info->tty ||
- (inb(info->base + UART_IIR) & UART_IIR_NO_INT))
- continue;
- status = inb(info->base + UART_LSR) & info->read_status_mask;
- if (status & UART_LSR_DR)
- mxser_receive_chars(info, &status);
- msr = inb(info->base + UART_MSR);
- if (msr & UART_MSR_ANY_DELTA)
- mxser_check_modem_status(info, msr);
- if (status & UART_LSR_THRE) {
-/* 8-2-99 by William
- if ( info->x_char || (info->xmit_cnt > 0) )
- */
- mxser_transmit_chars(info);
- }
- }
- if (pass_counter++ > MXSER_ISR_PASS_LIMIT) {
-#if 0
- printk("MOXA Smartio/Indusrtio family driver interrupt loop break\n");
-#endif
- break; /* Prevent infinite loops */
- }
- }
- return IRQ_RETVAL(handled);
-}
-
static inline void mxser_receive_chars(struct mxser_struct *info,
int *status)
{
@@ -1485,6 +1422,69 @@
}
}
+/*
+ * This is the serial driver's generic interrupt routine
+ */
+static irqreturn_t mxser_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+ int status, i;
+ struct mxser_struct *info;
+ struct mxser_struct *port;
+ int max, irqbits, bits, msr;
+ int pass_counter = 0;
+ int handled = 0;
+
+ port = 0;
+ for (i = 0; i < MXSER_BOARDS; i++) {
+ if (dev_id == &(mxvar_table[i * MXSER_PORTS_PER_BOARD])) {
+ port = dev_id;
+ break;
+ }
+ }
+
+ if (i == MXSER_BOARDS)
+ return IRQ_NONE;
+ if (port == 0)
+ return IRQ_NONE;
+ max = mxser_numports[mxsercfg[i].board_type];
+
+ while (1) {
+ irqbits = inb(port->vector) & port->vectormask;
+ if (irqbits == port->vectormask)
+ break;
+ handled = 1;
+ for (i = 0, bits = 1; i < max; i++, irqbits |= bits, bits <<= 1) {
+ if (irqbits == port->vectormask)
+ break;
+ if (bits & irqbits)
+ continue;
+ info = port + i;
+ if (!info->tty ||
+ (inb(info->base + UART_IIR) & UART_IIR_NO_INT))
+ continue;
+ status = inb(info->base + UART_LSR) & info->read_status_mask;
+ if (status & UART_LSR_DR)
+ mxser_receive_chars(info, &status);
+ msr = inb(info->base + UART_MSR);
+ if (msr & UART_MSR_ANY_DELTA)
+ mxser_check_modem_status(info, msr);
+ if (status & UART_LSR_THRE) {
+/* 8-2-99 by William
+ if ( info->x_char || (info->xmit_cnt > 0) )
+ */
+ mxser_transmit_chars(info);
+ }
+ }
+ if (pass_counter++ > MXSER_ISR_PASS_LIMIT) {
+#if 0
+ printk("MOXA Smartio/Indusrtio family driver interrupt loop break\n");
+#endif
+ break; /* Prevent infinite loops */
+ }
+ }
+ return IRQ_RETVAL(handled);
+}
+
static int mxser_block_til_ready(struct tty_struct *tty, struct file *filp,
struct mxser_struct *info)
{
reply other threads:[~2004-07-13 0:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040713002004.GC4701@fs.tum.de \
--to=bunk@fs.tum.de \
--cc=linux-kernel@vger.kernel.org \
--cc=support@moxa.com.tw \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.