Skip to contentSkip to conversation

isdn: fix section mismatch warnings in isdn

PATCH In review Sam Ravnborg 4 participants 13 messages Feb 1, 2008 – Feb 8, 2008

lore
Share & tools
lore
#0 lore raw

cover isdn: fix section mismatch warnings in isdn

drivers/isdn resulted in 34 section mismatch warnings - so I decided to give them a try.
This resulted in 5 simple patches.

I know Jeff Garzik has some ISDN clean-up patches pending but rather than waiting forever to have them acked I deciced to fix the warnings in the current kernel.

This for no other reason than to get the noise level down.

Andrew - I expect you to pick them up in -mm and forward to Linus.

Sam

#1 lore raw

PATCH 1/1 isdn: fix section mismatch warning in enpci_card_msg

Fix following warnings:
WARNING: drivers/isdn/hisax/built-in.o(.text+0x3cf50): Section mismatch in reference from the function enpci_card_msg() to the function .devinit.text:Amd7930_init()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x3cf85): Section mismatch in reference from the function enpci_card_msg() to the function .devinit.text:Amd7930_init()

enpci_card_msg() can be called outside __devinit context referenced function should not be annotated __devinit.

Remove annotation of Amd7930_init to fix this.

Cc Karsten Keil <[email protected]>
Cc Jeff Garzik <[email protected]>
---
 drivers/isdn/hisax/amd7930_fn.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/isdn/hisax/amd7930_fn.c +1 -2
index c0d7036..341faf5 100644
@@ -744,8 +744,7 @@ dbusy_timer_handler(struct IsdnCardState *cs)
 
 
 
-void __devinit
-Amd7930_init(struct IsdnCardState *cs)
+void Amd7930_init(struct IsdnCardState *cs)
 {
     WORD *ptr;
     BYTE cmd, cnt;
Signature · 1 line
1.5.4.rc3.14.g44397
Applied
#2 lore raw

Re: [PATCH] isdn: fix section mismatch warning in enpci_card_msg

From: Sam Ravnborg <[email protected]>
Date: Fri, 1 Feb 2008 14:42:42 +0100

Quoted 10 lines

Fix following warnings:
WARNING: drivers/isdn/hisax/built-in.o(.text+0x3cf50): Section mismatch in reference from the function enpci_card_msg() to the function .devinit.text:Amd7930_init()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x3cf85): Section mismatch in reference from the function enpci_card_msg() to the function .devinit.text:Amd7930_init()

enpci_card_msg() can be called outside __devinit context referenced function should not be annotated __devinit.

Remove annotation of Amd7930_init to fix this.

Applied, thanks.

#3 lore raw

Re: [PATCH] isdn: fix section mismatch warning in enpci_card_msg

Quoted 7 lines · David Miller

From: Sam Ravnborg <[email protected]>
Date: Fri, 1 Feb 2008 14:42:42 +0100

Quoted 4 lines

Fix following warnings:
WARNING: drivers/isdn/hisax/built-in.o(.text+0x3cf50): Section mismatch in reference from the function enpci_card_msg() to the function .devinit.text:Amd7930_init()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x3cf85): Section mismatch in reference from the function enpci_card_msg() to the function .devinit.text:Amd7930_init()

Quoted 8 lines
Quoted 6 lines

enpci_card_msg() can be called outside __devinit context referenced function should not be annotated __devinit.

Remove annotation of Amd7930_init to fix this.

Applied, thanks.

Hi David - did you apply only this
or all 5 patches?
I can resend if you prefer with Karsten's ack included.

PS. Do you usual take isdn patches?

Sam

#4 lore raw

Re: [PATCH] isdn: fix section mismatch warning in enpci_card_msg

From: Sam Ravnborg <[email protected]>
Date: Fri, 8 Feb 2008 06:58:33 +0100

Quoted 3 lines

Hi David - did you apply only this
or all 5 patches?
I can resend if you prefer with Karsten's ack included.

Only this one, I don't have the others so feel free to send thos.

Quoted 1 line

PS. Do you usual take isdn patches?

Lately that has been the case.

#5 lore raw

Re: [PATCH] isdn: fix section mismatch warning in enpci_card_msg

Quoted 7 lines · David Miller

From: Sam Ravnborg <[email protected]>
Date: Fri, 8 Feb 2008 06:58:33 +0100

Quoted 3 lines

Hi David - did you apply only this
or all 5 patches?
I can resend if you prefer with Karsten's ack included.

Quoted 6 lines

Only this one, I don't have the others so feel free to send thos.

Quoted 1 line

PS. Do you usual take isdn patches?

Lately that has been the case.

Fine - I just sent you the other four patches I had queued. With these isdn is now free of section mismatches.

Sam

#6 lore raw

PATCH 1/1 isdn: fix section mismatch warning for ISACVer

In reply to Sam Ravnborg

Fix following warnings:
WARNING: drivers/isdn/hisax/built-in.o(.text+0x19723): Section mismatch in reference from the function ISACVersion() to the variable .devinit.data:ISACVer
WARNING: drivers/isdn/hisax/built-in.o(.text+0x2005b): Section mismatch in reference from the function setup_avm_a1_pcmcia() to the function .devinit.text:setup_isac()

ISACVer were only used from function annotated __devinit so add same annotation to ISACVer.
One af the fererencing functions missed __devinit so add it and kill an additional warning.

Cc Karsten Keil <[email protected]>
Cc Jeff Garzik <[email protected]>
---
 drivers/isdn/hisax/avm_a1p.c |    3 +--
 drivers/isdn/hisax/isac.c    |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/isdn/hisax/avm_a1p.c +1 -2
index c87fa3f..3039c6d 100644
@@ -213,8 +213,7 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
 	return 0;
 }
 
-int
-setup_avm_a1_pcmcia(struct IsdnCard *card)
+int __devinit setup_avm_a1_pcmcia(struct IsdnCard *card)
 {
 	u_char model, vers;
 	struct IsdnCardState *cs = card->cs;
drivers/isdn/hisax/isac.c +1 -2
index 4e9f238..6ae9dde 100644
@@ -27,8 +27,7 @@ static char *ISACVer[] __devinitdata =
 {"2086/2186 V1.1", "2085 B1", "2085 B2",
  "2085 V2.3"};
 
-void
-ISACVersion(struct IsdnCardState *cs, char *s)
+void __devinit ISACVersion(struct IsdnCardState *cs, char *s)
 {
 	int val;
 
Signature · 1 line
1.5.4.rc3.14.g44397
#7 lore raw

PATCH 1/1 isdn: fix section mismatch warning in hfc_sx.c

In reply to Sam Ravnborg

Fix the following warning:
WARNING: drivers/isdn/hisax/built-in.o(.text+0x35818): Section mismatch in reference from the function hfcsx_card_msg() to the function .devinit.text:inithfcsx()

hfcsx_card_msg() may be called outside __devinit context. Following the program logic is looks like the CARD_INIT branch will only be taken under __devinit context but to be consistent remove the __devinit annotation of inithfcsx() so we do not mix non-__devinit and __devinit code.

Cc Karsten Keil <[email protected]>
Cc Jeff Garzik <[email protected]>
---
 drivers/isdn/hisax/hfc_sx.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/isdn/hisax/hfc_sx.c +1 -2
index 4fd09d2..05482d2 100644
@@ -1330,8 +1330,7 @@ hfcsx_bh(struct work_struct *work)
 /********************************/
 /* called for card init message */
 /********************************/
-static void __devinit
-inithfcsx(struct IsdnCardState *cs)
+static void inithfcsx(struct IsdnCardState *cs)
 {
 	cs->setstack_d = setstack_hfcsx;
 	cs->BC_Send_Data = &hfcsx_send_data;
Signature · 1 line
1.5.4.rc3.14.g44397
#8 lore raw

PATCH 1/1 isdn: fix section mismatch warnings in isac.c and isar.c

In reply to Sam Ravnborg

Fix the following warnings:
WARNING: drivers/isdn/hisax/built-in.o(.text+0x1b276): Section mismatch in reference from the function inithscxisac() to the function .devinit.text:clear_pending_isac_ints()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x1b286): Section mismatch in reference from the function inithscxisac() to the function .devinit.text:initisac()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x1fec7): Section mismatch in reference from the function AVM_card_msg() to the function .devinit.text:clear_pending_isac_ints()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x21669): Section mismatch in reference from the function AVM_card_msg() to the function .devinit.text:clear_pending_isac_ints()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x21671): Section mismatch in reference from the function AVM_card_msg() to the function .devinit.text:initisac()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x2991e): Section mismatch in reference from the function Sedl_card_msg() to the function .devinit.text:clear_pending_isac_ints()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x29936): Section mismatch in reference from the function Sedl_card_msg() to the function .devinit.text:initisac()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x2993e): Section mismatch in reference from the function Sedl_card_msg() to the function .devinit.text:initisar()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x2e026): Section mismatch in reference from the function NETjet_S_card_msg() to the function .devinit.text:clear_pending_isac_ints()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x2e02e): Section mismatch in reference from the function NETjet_S_card_msg() to the function .devinit.text:initisac()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x37813): Section mismatch in reference from the function BKM_card_msg() to the function .devinit.text:clear_pending_isac_ints()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x37823): Section mismatch in reference from the function BKM_card_msg() to the function .devinit.text:initisac()

initisar(), initisac() and clear_pending_isac_ints() were all used via a cardmsg fnction - which may be called ouside __devinit context.
So remove the bogus __devinit annotation of the above three functions to fix the warnings.

Cc Karsten Keil <[email protected]>
Cc Jeff Garzik <[email protected]>
---
 drivers/isdn/hisax/isac.c |    6 ++----
 drivers/isdn/hisax/isar.c |    3 +--
 2 files changed, 3 insertions(+), 6 deletions(-)
drivers/isdn/hisax/isac.c +2 -4
index 6ae9dde..07b1673 100644
@@ -615,8 +615,7 @@ dbusy_timer_handler(struct IsdnCardState *cs)
 	}
 }
 
-void __devinit
-initisac(struct IsdnCardState *cs)
+void initisac(struct IsdnCardState *cs)
 {
 	cs->setstack_d = setstack_isac;
 	cs->DC_Close = DC_Close_isac;
@@ -647,8 +646,7 @@ initisac(struct IsdnCardState *cs)
 	cs->writeisac(cs, ISAC_MASK, 0x0);
 }
 
-void __devinit
-clear_pending_isac_ints(struct IsdnCardState *cs)
+void clear_pending_isac_ints(struct IsdnCardState *cs)
 {
 	int val, eval;
 
drivers/isdn/hisax/isar.c +1 -2
index c547a66..bfeb9b6 100644
@@ -1894,8 +1894,7 @@ isar_auxcmd(struct IsdnCardState *cs, isdn_ctrl *ic) {
 	return(0);
 }
 
-void __devinit
-initisar(struct IsdnCardState *cs)
+void initisar(struct IsdnCardState *cs)
 {
 	cs->bcs[0].BC_SetStack = setstack_isar;
 	cs->bcs[1].BC_SetStack = setstack_isar;
Signature · 1 line
1.5.4.rc3.14.g44397
#9 lore raw

PATCH 1/1 isdn: fix section mismatch warnings from hisax_cs_setup_card

In reply to Sam Ravnborg

Fix the following warnings:
WARNING: drivers/isdn/hisax/built-in.o(.text+0x722): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_teles3()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x72c): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_s0box()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x736): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_telespci()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x747): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_avm_pcipnp()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x74e): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_elsa()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x755): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_diva()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x75c): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_sedlbauer()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x763): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_netjet_s()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x76a): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_hfcpci()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x771): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_hfcsx()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x778): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_niccy()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x77f): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_bkm_a4t()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x786): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_sct_quadro()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x78d): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_gazel()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x794): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_w6692()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x79b): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_netjet_u()
WARNING: drivers/isdn/hisax/built-in.o(.text+0x7a2): Section mismatch in reference from the function hisax_cs_setup_card() to the function .devinit.text:setup_enternow_pci()

checkcard() are the only user of hisax_cs_setup_card(). And checkcard is only used during init or when hot plugging ISDN devices. So annotate hisax_cs_setup_card() with __devinit. checkcard() is used by exported functions so it cannot be annotated __devinit. Annotate it with __ref so modpost ignore references to _devinit section.

Cc Karsten Keil <[email protected]>
Cc Jeff Garzik <[email protected]>

---

---
 drivers/isdn/hisax/config.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
drivers/isdn/hisax/config.c +5 -2
index 97097ef..a0ee43c 100644
@@ -847,7 +847,7 @@ static int init_card(struct IsdnCardState *cs)
 	return 3;
 }
 
-static int hisax_cs_setup_card(struct IsdnCard *card)
+static int __devinit hisax_cs_setup_card(struct IsdnCard *card)
 {
 	int ret;
 
@@ -1166,7 +1166,10 @@ outf_cs:
 	return 0;
 }
 
-static int checkcard(int cardnr, char *id, int *busy_flag, struct module *lockowner)
+/* Used from an exported function but calls __devinit functions.
+ * Tell modpost not to warn (__ref)
+ */
+static int __ref checkcard(int cardnr, char *id, int *busy_flag, struct module *lockowner)
 {
 	int ret;
 	struct IsdnCard *card = cards + cardnr;
Signature · 1 line
1.5.4.rc3.14.g44397
#10 lore raw
In reply to Sam Ravnborg

If anyone like to test it here is a cumulative patch.

Sam

drivers/isdn/hisax/amd7930_fn.c +1 -2
index c0d7036..341faf5 100644
@@ -744,8 +744,7 @@ dbusy_timer_handler(struct IsdnCardState *cs)
 
 
 
-void __devinit
-Amd7930_init(struct IsdnCardState *cs)
+void Amd7930_init(struct IsdnCardState *cs)
 {
     WORD *ptr;
     BYTE cmd, cnt;
drivers/isdn/hisax/avm_a1p.c +1 -2
index c87fa3f..3039c6d 100644
@@ -213,8 +213,7 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
 	return 0;
 }
 
-int
-setup_avm_a1_pcmcia(struct IsdnCard *card)
+int __devinit setup_avm_a1_pcmcia(struct IsdnCard *card)
 {
 	u_char model, vers;
 	struct IsdnCardState *cs = card->cs;
drivers/isdn/hisax/config.c +5 -2
index 97097ef..a0ee43c 100644
@@ -847,7 +847,7 @@ static int init_card(struct IsdnCardState *cs)
 	return 3;
 }
 
-static int hisax_cs_setup_card(struct IsdnCard *card)
+static int __devinit hisax_cs_setup_card(struct IsdnCard *card)
 {
 	int ret;
 
@@ -1166,7 +1166,10 @@ outf_cs:
 	return 0;
 }
 
-static int checkcard(int cardnr, char *id, int *busy_flag, struct module *lockowner)
+/* Used from an exported function but calls __devinit functions.
+ * Tell modpost not to warn (__ref)
+ */
+static int __ref checkcard(int cardnr, char *id, int *busy_flag, struct module *lockowner)
 {
 	int ret;
 	struct IsdnCard *card = cards + cardnr;
drivers/isdn/hisax/hfc_sx.c +1 -2
index 4fd09d2..05482d2 100644
@@ -1330,8 +1330,7 @@ hfcsx_bh(struct work_struct *work)
 /********************************/
 /* called for card init message */
 /********************************/
-static void __devinit
-inithfcsx(struct IsdnCardState *cs)
+static void inithfcsx(struct IsdnCardState *cs)
 {
 	cs->setstack_d = setstack_hfcsx;
 	cs->BC_Send_Data = &hfcsx_send_data;
drivers/isdn/hisax/isac.c +3 -6
index 4e9f238..07b1673 100644
@@ -27,8 +27,7 @@ static char *ISACVer[] __devinitdata =
 {"2086/2186 V1.1", "2085 B1", "2085 B2",
  "2085 V2.3"};
 
-void
-ISACVersion(struct IsdnCardState *cs, char *s)
+void __devinit ISACVersion(struct IsdnCardState *cs, char *s)
 {
 	int val;
 
@@ -616,8 +615,7 @@ dbusy_timer_handler(struct IsdnCardState *cs)
 	}
 }
 
-void __devinit
-initisac(struct IsdnCardState *cs)
+void initisac(struct IsdnCardState *cs)
 {
 	cs->setstack_d = setstack_isac;
 	cs->DC_Close = DC_Close_isac;
@@ -648,8 +646,7 @@ initisac(struct IsdnCardState *cs)
 	cs->writeisac(cs, ISAC_MASK, 0x0);
 }
 
-void __devinit
-clear_pending_isac_ints(struct IsdnCardState *cs)
+void clear_pending_isac_ints(struct IsdnCardState *cs)
 {
 	int val, eval;
 
drivers/isdn/hisax/isar.c +1 -2
index c547a66..bfeb9b6 100644
@@ -1894,8 +1894,7 @@ isar_auxcmd(struct IsdnCardState *cs, isdn_ctrl *ic) {
 	return(0);
 }
 
-void __devinit
-initisar(struct IsdnCardState *cs)
+void initisar(struct IsdnCardState *cs)
 {
 	cs->bcs[0].BC_SetStack = setstack_isar;
 	cs->bcs[1].BC_SetStack = setstack_isar;
#11 lore raw
In reply to Sam Ravnborg
Quoted 3 lines · Sam Ravnborg

I know Jeff Garzik has some ISDN clean-up patches pending but rather than waiting forever to have them acked I deciced to fix the warnings in the current kernel.

Please do...

Those patches are not going to be submitted for the current merge window, as I had higher priorities. The PCI hotplug conversion is complete, but a few "rough edges" remain to be cleaned up -- then we must test, since none of this work is tested at all yet.

For anyone else curious about the ISDN PCI hotplug API conversion, it is available on the 'isdn-pci' branch of
git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/misc-2.6.git

Jeff

#12 lore raw
In reply to Sam Ravnborg
Quoted 4 lines · Sam Ravnborg

drivers/isdn resulted in 34 section mismatch warnings - so I decided to give them a try.
This resulted in 5 simple patches.

Quoted 8 lines

I know Jeff Garzik has some ISDN clean-up patches pending but rather than waiting forever to have them acked I deciced to fix the warnings in the current kernel.

This for no other reason than to get the noise level down.

Andrew - I expect you to pick them up in -mm and forward to Linus.

Yes these fixes should go in, Acked.

Signature · 4 lines
Karsten Keil
SuSE Labs
ISDN and VOIP development
SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg)