Skip to contentSkip to conversation

bbc_i2c: fix section mismatch warning

PATCH Applied Sam Ravnborg 2 participants 2 messages Mar 30, 2013 – Mar 31, 2013 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 3/5 bbc_i2c: fix section mismatch warning

Fix following warning:

WARNING: drivers/sbus/char/bbc.o(.text+0x674): Section mismatch in reference from the function bbc_i2c_probe() to the function .init.text:T.463() The function bbc_i2c_probe() references the function __init T.463().
This is often because bbc_i2c_probe lacks a __init
annotation or the annotation of T.463 is wrong.

bbc_i2c_probe() referenced the inlined attach_one_i2c(). As probe may be called after init drop __init annotations on all functions used by bbc_i2c_probe()

The warning was seen with a sparc64 defconfig build

---
 drivers/sbus/char/bbc_i2c.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/sbus/char/bbc_i2c.c +2 -2
index 1a9d1e3..c1441ed 100644
@@ -282,7 +282,7 @@ static irqreturn_t bbc_i2c_interrupt(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static void __init reset_one_i2c(struct bbc_i2c_bus *bp)
+static void reset_one_i2c(struct bbc_i2c_bus *bp)
 {
 	writeb(I2C_PCF_PIN, bp->i2c_control_regs + 0x0);
 	writeb(bp->own, bp->i2c_control_regs + 0x1);
@@ -291,7 +291,7 @@ static void __init reset_one_i2c(struct bbc_i2c_bus *bp)
 	writeb(I2C_PCF_IDLE, bp->i2c_control_regs + 0x0);
 }
 
-static struct bbc_i2c_bus * __init attach_one_i2c(struct platform_device *op, int index)
+static struct bbc_i2c_bus * attach_one_i2c(struct platform_device *op, int index)
 {
 	struct bbc_i2c_bus *bp;
 	struct device_node *dp;
Signature · 1 line
1.6.0.6
maintainer Applied
#1 lore raw

From: Sam Ravnborg <[email protected]>
Date: Sat, 30 Mar 2013 22:44:24 +0100

Quoted 7 lines

Fix following warning:

WARNING: drivers/sbus/char/bbc.o(.text+0x674): Section mismatch in reference from the function bbc_i2c_probe() to the function .init.text:T.463() The function bbc_i2c_probe() references the function __init T.463().
This is often because bbc_i2c_probe lacks a __init
annotation or the annotation of T.463 is wrong.

Quoted 7 lines

bbc_i2c_probe() referenced the inlined attach_one_i2c(). As probe may be called after init drop __init annotations on all functions used by bbc_i2c_probe()

The warning was seen with a sparc64 defconfig build

Applied.