Commit b3f36a2a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix inlining failure (all GCCs) in parport

From: Jan Hubicka <jh@suse.cz>

GCC never inline extern inline function redefined by new body (because it is
not clear what body one should choose)

parport contains such duplicated functions for apparently no good reasons.
Both copies differ slightly, not sure whether it is intentional or just
garbage.
parent 1f98dc7e
......@@ -270,95 +270,6 @@ static irqreturn_t parport_pc_interrupt(int irq, void *dev_id, struct pt_regs *r
return IRQ_HANDLED;
}
void parport_pc_write_data(struct parport *p, unsigned char d)
{
outb (d, DATA (p));
}
unsigned char parport_pc_read_data(struct parport *p)
{
return inb (DATA (p));
}
void parport_pc_write_control(struct parport *p, unsigned char d)
{
const unsigned char wm = (PARPORT_CONTROL_STROBE |
PARPORT_CONTROL_AUTOFD |
PARPORT_CONTROL_INIT |
PARPORT_CONTROL_SELECT);
/* Take this out when drivers have adapted to the newer interface. */
if (d & 0x20) {
printk (KERN_DEBUG "%s (%s): use data_reverse for this!\n",
p->name, p->cad->name);
parport_pc_data_reverse (p);
}
__parport_pc_frob_control (p, wm, d & wm);
}
unsigned char parport_pc_read_control(struct parport *p)
{
const unsigned char wm = (PARPORT_CONTROL_STROBE |
PARPORT_CONTROL_AUTOFD |
PARPORT_CONTROL_INIT |
PARPORT_CONTROL_SELECT);
const struct parport_pc_private *priv = p->physport->private_data;
return priv->ctr & wm; /* Use soft copy */
}
unsigned char parport_pc_frob_control (struct parport *p, unsigned char mask,
unsigned char val)
{
const unsigned char wm = (PARPORT_CONTROL_STROBE |
PARPORT_CONTROL_AUTOFD |
PARPORT_CONTROL_INIT |
PARPORT_CONTROL_SELECT);
/* Take this out when drivers have adapted to the newer interface. */
if (mask & 0x20) {
printk (KERN_DEBUG "%s (%s): use data_%s for this!\n",
p->name, p->cad->name,
(val & 0x20) ? "reverse" : "forward");
if (val & 0x20)
parport_pc_data_reverse (p);
else
parport_pc_data_forward (p);
}
/* Restrict mask and val to control lines. */
mask &= wm;
val &= wm;
return __parport_pc_frob_control (p, mask, val);
}
unsigned char parport_pc_read_status(struct parport *p)
{
return inb (STATUS (p));
}
void parport_pc_disable_irq(struct parport *p)
{
__parport_pc_frob_control (p, 0x10, 0);
}
void parport_pc_enable_irq(struct parport *p)
{
if (p->irq != PARPORT_IRQ_NONE)
__parport_pc_frob_control (p, 0x10, 0x10);
}
void parport_pc_data_forward (struct parport *p)
{
__parport_pc_frob_control (p, 0x20, 0);
}
void parport_pc_data_reverse (struct parport *p)
{
__parport_pc_frob_control (p, 0x20, 0x20);
}
void parport_pc_init_state(struct pardevice *dev, struct parport_state *s)
{
s->u.pc.ctr = 0xc;
......@@ -1235,6 +1146,8 @@ dump_parport_state ("fwd idle", port);
* ******************************************
*/
/* GCC is not inlining extern inline function later overwriten to non-inline,
so we use outlined_ variants here. */
struct parport_operations parport_pc_ops =
{
.write_data = parport_pc_write_data,
......
......@@ -41,7 +41,7 @@ struct parport_pc_private {
struct pci_dev *dev;
};
extern __inline__ void parport_pc_write_data(struct parport *p, unsigned char d)
static __inline__ void parport_pc_write_data(struct parport *p, unsigned char d)
{
#ifdef DEBUG_PARPORT
printk (KERN_DEBUG "parport_pc_write_data(%p,0x%02x)\n", p, d);
......@@ -49,7 +49,7 @@ extern __inline__ void parport_pc_write_data(struct parport *p, unsigned char d)
outb(d, DATA(p));
}
extern __inline__ unsigned char parport_pc_read_data(struct parport *p)
static __inline__ unsigned char parport_pc_read_data(struct parport *p)
{
unsigned char val = inb (DATA (p));
#ifdef DEBUG_PARPORT
......@@ -124,17 +124,17 @@ static __inline__ unsigned char __parport_pc_frob_control (struct parport *p,
return ctr;
}
extern __inline__ void parport_pc_data_reverse (struct parport *p)
static __inline__ void parport_pc_data_reverse (struct parport *p)
{
__parport_pc_frob_control (p, 0x20, 0x20);
}
extern __inline__ void parport_pc_data_forward (struct parport *p)
static __inline__ void parport_pc_data_forward (struct parport *p)
{
__parport_pc_frob_control (p, 0x20, 0x00);
}
extern __inline__ void parport_pc_write_control (struct parport *p,
static __inline__ void parport_pc_write_control (struct parport *p,
unsigned char d)
{
const unsigned char wm = (PARPORT_CONTROL_STROBE |
......@@ -152,7 +152,7 @@ extern __inline__ void parport_pc_write_control (struct parport *p,
__parport_pc_frob_control (p, wm, d & wm);
}
extern __inline__ unsigned char parport_pc_read_control(struct parport *p)
static __inline__ unsigned char parport_pc_read_control(struct parport *p)
{
const unsigned char rm = (PARPORT_CONTROL_STROBE |
PARPORT_CONTROL_AUTOFD |
......@@ -162,7 +162,7 @@ extern __inline__ unsigned char parport_pc_read_control(struct parport *p)
return priv->ctr & rm; /* Use soft copy */
}
extern __inline__ unsigned char parport_pc_frob_control (struct parport *p,
static __inline__ unsigned char parport_pc_frob_control (struct parport *p,
unsigned char mask,
unsigned char val)
{
......@@ -189,18 +189,18 @@ extern __inline__ unsigned char parport_pc_frob_control (struct parport *p,
return __parport_pc_frob_control (p, mask, val);
}
extern __inline__ unsigned char parport_pc_read_status(struct parport *p)
static __inline__ unsigned char parport_pc_read_status(struct parport *p)
{
return inb(STATUS(p));
}
extern __inline__ void parport_pc_disable_irq(struct parport *p)
static __inline__ void parport_pc_disable_irq(struct parport *p)
{
__parport_pc_frob_control (p, 0x10, 0x00);
}
extern __inline__ void parport_pc_enable_irq(struct parport *p)
static __inline__ void parport_pc_enable_irq(struct parport *p)
{
__parport_pc_frob_control (p, 0x10, 0x10);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment