LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] [SIS190] Constify data marked as __devinitdata
@ 2008-01-30 10:53 Jonas Bonn
  2008-01-30 11:23 ` Jan Engelhardt
  0 siblings, 1 reply; 9+ messages in thread
From: Jonas Bonn @ 2008-01-30 10:53 UTC (permalink / raw)
  To: netdev, romieu, linux-kernel; +Cc: Jonas Bonn

This fixes build error as gcc complains about a "section type conflict"
due to the const __devinitdata in sis190_get_mac_addr_from_apc().
---
 drivers/net/sis190.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index b570402..e48e4ad 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -326,7 +326,7 @@ static const struct {
 	{ "SiS 191 PCI Gigabit Ethernet adapter" },
 };
 
-static struct pci_device_id sis190_pci_tbl[] __devinitdata = {
+static const struct pci_device_id sis190_pci_tbl[] __devinitdata = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0190), 0, 0, 0 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0191), 0, 0, 1 },
 	{ 0, },
-- 
1.5.3.8



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

* Re: [PATCH] [SIS190] Constify data marked as __devinitdata
  2008-01-30 10:53 [PATCH] [SIS190] Constify data marked as __devinitdata Jonas Bonn
@ 2008-01-30 11:23 ` Jan Engelhardt
  2008-01-30 11:25   ` Sam Ravnborg
  2008-01-30 11:41   ` [PATCH] [SIS190] Constify data marked as __devinitdata Jonas Bonn
  0 siblings, 2 replies; 9+ messages in thread
From: Jan Engelhardt @ 2008-01-30 11:23 UTC (permalink / raw)
  To: Jonas Bonn; +Cc: netdev, romieu, linux-kernel


On Jan 30 2008 11:53, Jonas Bonn wrote:
>
>This fixes build error as gcc complains about a "section type conflict"
>due to the const __devinitdata in sis190_get_mac_addr_from_apc().

>-static struct pci_device_id sis190_pci_tbl[] __devinitdata = {
>+static const struct pci_device_id sis190_pci_tbl[] __devinitdata = {
> 	{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0190), 0, 0, 0 },
> 	{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0191), 0, 0, 1 },
> 	{ 0, },

Eh? Did you mean to

-        static const u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 };
+        static u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 };

instead? Because AFAIK, const *and* __sectionmarker does not mix.

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

* Re: [PATCH] [SIS190] Constify data marked as __devinitdata
  2008-01-30 11:23 ` Jan Engelhardt
@ 2008-01-30 11:25   ` Sam Ravnborg
  2008-01-30 11:57     ` [PATCH] [SIS190] Use _devinitconst for const data Jonas Bonn
  2008-01-30 13:31     ` [PATCH] [SIS190] Constify data marked as __devinitdata Jan Engelhardt
  2008-01-30 11:41   ` [PATCH] [SIS190] Constify data marked as __devinitdata Jonas Bonn
  1 sibling, 2 replies; 9+ messages in thread
From: Sam Ravnborg @ 2008-01-30 11:25 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Jonas Bonn, netdev, romieu, linux-kernel

On Wed, Jan 30, 2008 at 12:23:23PM +0100, Jan Engelhardt wrote:
> 
> On Jan 30 2008 11:53, Jonas Bonn wrote:
> >
> >This fixes build error as gcc complains about a "section type conflict"
> >due to the const __devinitdata in sis190_get_mac_addr_from_apc().
> 
> >-static struct pci_device_id sis190_pci_tbl[] __devinitdata = {
> >+static const struct pci_device_id sis190_pci_tbl[] __devinitdata = {
> > 	{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0190), 0, 0, 0 },
> > 	{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0191), 0, 0, 1 },
> > 	{ 0, },
> 
> Eh? Did you mean to
> 
> -        static const u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 };
> +        static u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 };
> 
> instead? Because AFAIK, const *and* __sectionmarker does not mix.

We have just introduced __initconst, __cpuinitconst, __meminitconst
for const data.
So the patch is wrong.

	Sam

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

* Re: [PATCH] [SIS190] Constify data marked as __devinitdata
  2008-01-30 11:23 ` Jan Engelhardt
  2008-01-30 11:25   ` Sam Ravnborg
@ 2008-01-30 11:41   ` Jonas Bonn
  1 sibling, 0 replies; 9+ messages in thread
From: Jonas Bonn @ 2008-01-30 11:41 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: netdev, romieu, linux-kernel

> 
> instead? Because AFAIK, const *and* __sectionmarker does not mix.
 >

You're right... it's documented in linux/init.h that const and 
__sectionmarker do not mix.  The compile error is due to the use of 
const and __section marker in the function sis190_get_mac_addr_from_apc().


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

* [PATCH] [SIS190] Use _devinitconst for const data
  2008-01-30 11:25   ` Sam Ravnborg
@ 2008-01-30 11:57     ` Jonas Bonn
  2008-01-30 12:21       ` Sam Ravnborg
  2008-01-30 13:31     ` [PATCH] [SIS190] Constify data marked as __devinitdata Jan Engelhardt
  1 sibling, 1 reply; 9+ messages in thread
From: Jonas Bonn @ 2008-01-30 11:57 UTC (permalink / raw)
  To: netdev, romieu, linux-kernel; +Cc: Jonas Bonn

This fixes build error as gcc complains about a "section type conflict"
due to the mixing of const and non-const data in same section.
---
 drivers/net/sis190.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index b570402..f84c02e 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -326,7 +326,7 @@ static const struct {
 	{ "SiS 191 PCI Gigabit Ethernet adapter" },
 };
 
-static struct pci_device_id sis190_pci_tbl[] __devinitdata = {
+static struct pci_device_id sis190_pci_tbl[] __devinitconst = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0190), 0, 0, 0 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0191), 0, 0, 1 },
 	{ 0, },
@@ -1556,7 +1556,7 @@ static int __devinit sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev,
 static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
 						  struct net_device *dev)
 {
-	static const u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 };
+	static u16 __devinitconst ids[] = { 0x0965, 0x0966, 0x0968 };
 	struct sis190_private *tp = netdev_priv(dev);
 	struct pci_dev *isa_bridge;
 	u8 reg, tmp8;
-- 
1.5.3.8



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

* Re: [PATCH] [SIS190] Use _devinitconst for const data
  2008-01-30 11:57     ` [PATCH] [SIS190] Use _devinitconst for const data Jonas Bonn
@ 2008-01-30 12:21       ` Sam Ravnborg
  0 siblings, 0 replies; 9+ messages in thread
From: Sam Ravnborg @ 2008-01-30 12:21 UTC (permalink / raw)
  To: Jonas Bonn; +Cc: netdev, romieu, linux-kernel

On Wed, Jan 30, 2008 at 12:57:16PM +0100, Jonas Bonn wrote:
> This fixes build error as gcc complains about a "section type conflict"
> due to the mixing of const and non-const data in same section.
> ---
>  drivers/net/sis190.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
> index b570402..f84c02e 100644
> --- a/drivers/net/sis190.c
> +++ b/drivers/net/sis190.c
> @@ -326,7 +326,7 @@ static const struct {
>  	{ "SiS 191 PCI Gigabit Ethernet adapter" },
>  };
>  
> -static struct pci_device_id sis190_pci_tbl[] __devinitdata = {
> +static struct pci_device_id sis190_pci_tbl[] __devinitconst = {
>  	{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0190), 0, 0, 0 },
>  	{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0191), 0, 0, 1 },
>  	{ 0, },
sis190_pci_tbl is not const...


> @@ -1556,7 +1556,7 @@ static int __devinit sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev,
>  static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
>  						  struct net_device *dev)
>  {
> -	static const u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 };
> +	static u16 __devinitconst ids[] = { 0x0965, 0x0966, 0x0968 };
>  	struct sis190_private *tp = netdev_priv(dev);
>  	struct pci_dev *isa_bridge;
>  	u8 reg, tmp8;
> -- 
> 1.5.3.8
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH] [SIS190] Constify data marked as __devinitdata
  2008-01-30 11:25   ` Sam Ravnborg
  2008-01-30 11:57     ` [PATCH] [SIS190] Use _devinitconst for const data Jonas Bonn
@ 2008-01-30 13:31     ` Jan Engelhardt
  2008-01-30 13:37       ` Sam Ravnborg
  1 sibling, 1 reply; 9+ messages in thread
From: Jan Engelhardt @ 2008-01-30 13:31 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Jonas Bonn, netdev, romieu, linux-kernel


On Jan 30 2008 12:25, Sam Ravnborg wrote:
>
>We have just introduced __initconst, __cpuinitconst, __meminitconst
>for const data.
>So the patch is wrong.

Oh joy, more tags. Is it actually possible to combine const
with __devinitconst now?

static const uint16_t foo[] __devinitconst = { ... };

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

* Re: [PATCH] [SIS190] Constify data marked as __devinitdata
  2008-01-30 13:31     ` [PATCH] [SIS190] Constify data marked as __devinitdata Jan Engelhardt
@ 2008-01-30 13:37       ` Sam Ravnborg
  2008-01-30 13:41         ` [PATCH] [SIS190] Use __devinitconst for const devinit data Jonas Bonn
  0 siblings, 1 reply; 9+ messages in thread
From: Sam Ravnborg @ 2008-01-30 13:37 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Jonas Bonn, netdev, romieu, linux-kernel

On Wed, Jan 30, 2008 at 02:31:05PM +0100, Jan Engelhardt wrote:
> 
> On Jan 30 2008 12:25, Sam Ravnborg wrote:
> >
> >We have just introduced __initconst, __cpuinitconst, __meminitconst
> >for const data.
> >So the patch is wrong.
> 
> Oh joy, more tags. Is it actually possible to combine const
> with __devinitconst now?
> 
> static const uint16_t foo[] __devinitconst = { ... };

Yes, try it.

	Sam

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

* [PATCH] [SIS190] Use __devinitconst for const devinit data
  2008-01-30 13:37       ` Sam Ravnborg
@ 2008-01-30 13:41         ` Jonas Bonn
  0 siblings, 0 replies; 9+ messages in thread
From: Jonas Bonn @ 2008-01-30 13:41 UTC (permalink / raw)
  To: netdev, romieu, linux-kernel; +Cc: Jonas Bonn

Mixing const and __section was previously not allowed.  New __devinitconst tag
allows this.

This fixes a gcc "section type mismatch" build error.
---
 drivers/net/sis190.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index b570402..d3126a9 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -326,7 +326,7 @@ static const struct {
 	{ "SiS 191 PCI Gigabit Ethernet adapter" },
 };
 
-static struct pci_device_id sis190_pci_tbl[] __devinitdata = {
+static const struct pci_device_id sis190_pci_tbl[] __devinitconst = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0190), 0, 0, 0 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0191), 0, 0, 1 },
 	{ 0, },
@@ -1556,7 +1556,7 @@ static int __devinit sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev,
 static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
 						  struct net_device *dev)
 {
-	static const u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 };
+	static const u16 __devinitconst ids[] = { 0x0965, 0x0966, 0x0968 };
 	struct sis190_private *tp = netdev_priv(dev);
 	struct pci_dev *isa_bridge;
 	u8 reg, tmp8;
-- 
1.5.3.8



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

end of thread, other threads:[~2008-01-30 13:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-30 10:53 [PATCH] [SIS190] Constify data marked as __devinitdata Jonas Bonn
2008-01-30 11:23 ` Jan Engelhardt
2008-01-30 11:25   ` Sam Ravnborg
2008-01-30 11:57     ` [PATCH] [SIS190] Use _devinitconst for const data Jonas Bonn
2008-01-30 12:21       ` Sam Ravnborg
2008-01-30 13:31     ` [PATCH] [SIS190] Constify data marked as __devinitdata Jan Engelhardt
2008-01-30 13:37       ` Sam Ravnborg
2008-01-30 13:41         ` [PATCH] [SIS190] Use __devinitconst for const devinit data Jonas Bonn
2008-01-30 11:41   ` [PATCH] [SIS190] Constify data marked as __devinitdata Jonas Bonn

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).