netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [ATM] he: Fix __init/__devinit conflict
@ 2006-09-11 19:14 Roland Dreier
  2006-09-24  0:17 ` Roland Dreier
  0 siblings, 1 reply; 5+ messages in thread
From: Roland Dreier @ 2006-09-11 19:14 UTC (permalink / raw)
  To: Chas Williams; +Cc: linux-atm-general, netdev, davem

he_init_one() is declared __devinit, but calls lots of init functions
that are marked __init.  However, if CONFIG_HOTPLUG is enabled,
__devinit functions go into normal .text, which leads to

    WARNING: drivers/atm/he.o - Section mismatch: reference to .init.text: from .text between 'he_start' (at offset 0x2130) and 'he_service_tbrq'

Fix this by changing the __init functions to __devinit.

Signed-off-by: Roland Dreier <roland@digitalvampire.org>

---

diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index d369130..9e0383d 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -454,7 +454,7 @@ #define NONZERO (1 << 14)
 	return (NONZERO | (exp << 9) | (rate & 0x1ff));
 }
 
-static void __init
+static void __devinit
 he_init_rx_lbfp0(struct he_dev *he_dev)
 {
 	unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count;
@@ -485,7 +485,7 @@ he_init_rx_lbfp0(struct he_dev *he_dev)
 	he_writel(he_dev, he_dev->r0_numbuffs, RLBF0_C);
 }
 
-static void __init
+static void __devinit
 he_init_rx_lbfp1(struct he_dev *he_dev)
 {
 	unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count;
@@ -516,7 +516,7 @@ he_init_rx_lbfp1(struct he_dev *he_dev)
 	he_writel(he_dev, he_dev->r1_numbuffs, RLBF1_C);
 }
 
-static void __init
+static void __devinit
 he_init_tx_lbfp(struct he_dev *he_dev)
 {
 	unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count;
@@ -546,7 +546,7 @@ he_init_tx_lbfp(struct he_dev *he_dev)
 	he_writel(he_dev, lbufd_index - 1, TLBF_T);
 }
 
-static int __init
+static int __devinit
 he_init_tpdrq(struct he_dev *he_dev)
 {
 	he_dev->tpdrq_base = pci_alloc_consistent(he_dev->pci_dev,
@@ -568,7 +568,7 @@ he_init_tpdrq(struct he_dev *he_dev)
 	return 0;
 }
 
-static void __init
+static void __devinit
 he_init_cs_block(struct he_dev *he_dev)
 {
 	unsigned clock, rate, delta;
@@ -664,7 +664,7 @@ he_init_cs_block(struct he_dev *he_dev)
 
 }
 
-static int __init
+static int __devinit
 he_init_cs_block_rcm(struct he_dev *he_dev)
 {
 	unsigned (*rategrid)[16][16];
@@ -785,7 +785,7 @@ #define RTGTBL_OFFSET 0x400
 	return 0;
 }
 
-static int __init
+static int __devinit
 he_init_group(struct he_dev *he_dev, int group)
 {
 	int i;
@@ -955,7 +955,7 @@ #endif
 	return 0;
 }
 
-static int __init
+static int __devinit
 he_init_irq(struct he_dev *he_dev)
 {
 	int i;

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

* Re: [PATCH] [ATM] he: Fix __init/__devinit conflict
  2006-09-11 19:14 [PATCH] [ATM] he: Fix __init/__devinit conflict Roland Dreier
@ 2006-09-24  0:17 ` Roland Dreier
  2006-09-25  3:11   ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Roland Dreier @ 2006-09-24  0:17 UTC (permalink / raw)
  To: davem; +Cc: linux-atm-general, netdev, Chas Williams

he_init_one() is declared __devinit, but calls lots of init functions
that are marked __init.  However, if CONFIG_HOTPLUG is enabled,
__devinit functions go into normal .text, which leads to

    WARNING: drivers/atm/he.o - Section mismatch: reference to .init.text: from .text between 'he_start' (at offset 0x2130) and 'he_service_tbrq'

Fix this by changing the __init functions to __devinit.

Signed-off-by: Roland Dreier <roland@digitalvampire.org>

---

Dave, this was acked by Chas (and he even requested it go into 2.6.18)
but it seems to have gotten dropped somewhere -- it's not in Linus's
tree even after he pulled your net tree.

Please apply.

diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index d369130..9e0383d 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -454,7 +454,7 @@ #define NONZERO (1 << 14)
 	return (NONZERO | (exp << 9) | (rate & 0x1ff));
 }
 
-static void __init
+static void __devinit
 he_init_rx_lbfp0(struct he_dev *he_dev)
 {
 	unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count;
@@ -485,7 +485,7 @@ he_init_rx_lbfp0(struct he_dev *he_dev)
 	he_writel(he_dev, he_dev->r0_numbuffs, RLBF0_C);
 }
 
-static void __init
+static void __devinit
 he_init_rx_lbfp1(struct he_dev *he_dev)
 {
 	unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count;
@@ -516,7 +516,7 @@ he_init_rx_lbfp1(struct he_dev *he_dev)
 	he_writel(he_dev, he_dev->r1_numbuffs, RLBF1_C);
 }
 
-static void __init
+static void __devinit
 he_init_tx_lbfp(struct he_dev *he_dev)
 {
 	unsigned i, lbm_offset, lbufd_index, lbuf_addr, lbuf_count;
@@ -546,7 +546,7 @@ he_init_tx_lbfp(struct he_dev *he_dev)
 	he_writel(he_dev, lbufd_index - 1, TLBF_T);
 }
 
-static int __init
+static int __devinit
 he_init_tpdrq(struct he_dev *he_dev)
 {
 	he_dev->tpdrq_base = pci_alloc_consistent(he_dev->pci_dev,
@@ -568,7 +568,7 @@ he_init_tpdrq(struct he_dev *he_dev)
 	return 0;
 }
 
-static void __init
+static void __devinit
 he_init_cs_block(struct he_dev *he_dev)
 {
 	unsigned clock, rate, delta;
@@ -664,7 +664,7 @@ he_init_cs_block(struct he_dev *he_dev)
 
 }
 
-static int __init
+static int __devinit
 he_init_cs_block_rcm(struct he_dev *he_dev)
 {
 	unsigned (*rategrid)[16][16];
@@ -785,7 +785,7 @@ #define RTGTBL_OFFSET 0x400
 	return 0;
 }
 
-static int __init
+static int __devinit
 he_init_group(struct he_dev *he_dev, int group)
 {
 	int i;
@@ -955,7 +955,7 @@ #endif
 	return 0;
 }
 
-static int __init
+static int __devinit
 he_init_irq(struct he_dev *he_dev)
 {
 	int i;

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

* Re: [PATCH] [ATM] he: Fix __init/__devinit conflict
  2006-09-24  0:17 ` Roland Dreier
@ 2006-09-25  3:11   ` David Miller
  2006-09-25  3:37     ` Roland Dreier
  2006-09-25  9:56     ` chas williams - CONTRACTOR
  0 siblings, 2 replies; 5+ messages in thread
From: David Miller @ 2006-09-25  3:11 UTC (permalink / raw)
  To: roland; +Cc: linux-atm-general, netdev, chas

From: Roland Dreier <roland@digitalvampire.org>
Date: Sat, 23 Sep 2006 17:17:54 -0700

> Dave, this was acked by Chas (and he even requested it go into 2.6.18)
> but it seems to have gotten dropped somewhere -- it's not in Linus's
> tree even after he pulled your net tree.
> 
> Please apply.

Applied.

I was waiting for a resolution in the fact that the copy
Chas posted only had one of the transformations whereas
as you pointed out all of the ones in your original
patch were necessary.

Chas, as a subsystem maintainer, if you change a submitter's patch in
a significant and non-trivial way, you should at least mention a brief
reason why you did that.  In this case, why did you delete all of
Roland's __init/__devinit transformations except one when they all
were necessary to fix this bug?

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

* Re: [PATCH] [ATM] he: Fix __init/__devinit conflict
  2006-09-25  3:11   ` David Miller
@ 2006-09-25  3:37     ` Roland Dreier
  2006-09-25  9:56     ` chas williams - CONTRACTOR
  1 sibling, 0 replies; 5+ messages in thread
From: Roland Dreier @ 2006-09-25  3:37 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, chas

    David> I was waiting for a resolution in the fact that the copy
    David> Chas posted only had one of the transformations whereas as
    David> you pointed out all of the ones in your original patch were
    David> necessary.

Actually I think there was some confusion because akpm forwarded a
patch from someone else that just changed one __init -> __devinit
(which appeared to fix things at least on x86_64 because of the
effects of -funit-at-a-time).

I'm not positive but as far as I remember Chas sent my original patch.

Anyway, I think we've wasted enough time on a trivial warning patch.

 - R.

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

* Re: [PATCH] [ATM] he: Fix __init/__devinit conflict
  2006-09-25  3:11   ` David Miller
  2006-09-25  3:37     ` Roland Dreier
@ 2006-09-25  9:56     ` chas williams - CONTRACTOR
  1 sibling, 0 replies; 5+ messages in thread
From: chas williams - CONTRACTOR @ 2006-09-25  9:56 UTC (permalink / raw)
  To: David Miller; +Cc: roland, linux-atm-general, netdev

In message <20060924.201118.71090751.davem@davemloft.net>,David Miller writes:
>Chas, as a subsystem maintainer, if you change a submitter's patch in
>a significant and non-trivial way, you should at least mention a brief
>reason why you did that.  In this case, why did you delete all of
>Roland's __init/__devinit transformations except one when they all
>were necessary to fix this bug?

i submitted roland patch without modification and therefore
without comment.  i did change the author field of the patch
unintentionally (which wont happen in the future).

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

end of thread, other threads:[~2006-09-25  9:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-11 19:14 [PATCH] [ATM] he: Fix __init/__devinit conflict Roland Dreier
2006-09-24  0:17 ` Roland Dreier
2006-09-25  3:11   ` David Miller
2006-09-25  3:37     ` Roland Dreier
2006-09-25  9:56     ` chas williams - CONTRACTOR

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).