Skip to contentSkip to conversation

SH: drop const from io port variiable

PATCH In review Andi Kleen 7 participants 13 messages Jun 7, 2011 – Jun 9, 2011

Subsystems (4)
lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/5 SH: drop const from io port variiable

From: Andi Kleen <[email protected]>

The variable is modified elsewhere, so it should not be const. If it was really const it would need to be __read_mostly_const.

---
 arch/sh/kernel/ioport.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/sh/kernel/ioport.c +1 -1
index e3ad610..cca14ba 100644
@@ -11,7 +11,7 @@
 #include <linux/module.h>
 #include <linux/io.h>
 
-const unsigned long sh_io_port_base __read_mostly = -1;
+unsigned long sh_io_port_base __read_mostly = -1;
 EXPORT_SYMBOL(sh_io_port_base);
 
 void __iomem *__ioport_map(unsigned long addr, unsigned int size)
Signature · 1 line
1.7.4.4
author
#1 lore raw

PATCH 2/5 Fix mismatched variable in rcutree_trace.c

From: Andi Kleen <[email protected]>

rcutree.c defines rcu_cpu_kthread_cpu as int, not unsigned int, so the extern has to follow that.

---
 kernel/rcutree_trace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/rcutree_trace.c +1 -1
index 9678cc3..91c56e5 100644
@@ -47,7 +47,7 @@
 #include "rcutree.h"
 
 DECLARE_PER_CPU(unsigned int, rcu_cpu_kthread_status);
-DECLARE_PER_CPU(unsigned int, rcu_cpu_kthread_cpu);
+DECLARE_PER_CPU(int, rcu_cpu_kthread_cpu);
 DECLARE_PER_CPU(unsigned int, rcu_cpu_kthread_loops);
 DECLARE_PER_CPU(char, rcu_cpu_has_work);
 
Signature · 1 line
1.7.4.4
#2 lore raw

Re: [PATCH 2/5] Fix mismatched variable in rcutree_trace.c

Quoted 16 lines · Andi Kleen

From: Andi Kleen <[email protected]>

rcutree.c defines rcu_cpu_kthread_cpu as int, not unsigned int, so the extern has to follow that.

---
 kernel/rcutree_trace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/rcutree_trace.c +0 -0
index 9678cc3..91c56e5 100644

kernel/rcutree_trace.c line 50

Quoted 5 lines
kernel/rcutree_trace.c +1 -1
@@ -47,7 +47,7 @@
 #include "rcutree.h"
 
 DECLARE_PER_CPU(unsigned int, rcu_cpu_kthread_status);
-DECLARE_PER_CPU(unsigned int, rcu_cpu_kthread_cpu);
+DECLARE_PER_CPU(int, rcu_cpu_kthread_cpu);

Can we rather fix the DEFINE to use unsigned int. Signed cpu numbers are pointless in that context, right ?

Quoted 12 lines
kernel/rcutree_trace.c +0 -0
 DECLARE_PER_CPU(unsigned int, rcu_cpu_kthread_loops);
 DECLARE_PER_CPU(char, rcu_cpu_has_work);
 
Signature · 7 lines
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#3 lore raw

Re: [PATCH 2/5] Fix mismatched variable in rcutree_trace.c

Quoted 22 lines · Thomas Gleixner
Quoted 18 lines · Andi Kleen

From: Andi Kleen <[email protected]>

rcutree.c defines rcu_cpu_kthread_cpu as int, not unsigned int, so the extern has to follow that.

---
 kernel/rcutree_trace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/rcutree_trace.c +0 -0
index 9678cc3..91c56e5 100644
@@ -47,7 +47,7 @@
 #include "rcutree.h"
 
Quoted 6 lines

kernel/rcutree_trace.c line 50

Quoted 3 lines
kernel/rcutree_trace.c +1 -1
 DECLARE_PER_CPU(unsigned int, rcu_cpu_kthread_status);
-DECLARE_PER_CPU(unsigned int, rcu_cpu_kthread_cpu);
+DECLARE_PER_CPU(int, rcu_cpu_kthread_cpu);

Can we rather fix the DEFINE to use unsigned int. Signed cpu numbers are pointless in that context, right ?

Hmmm... Some arches have signed CPU numbers while others have unsigned CPU numbers. I do use "-1" to mean "no CPU" in some cases (for example, in rcu_node_kthread_setaffinity()), so I guess for consistency I should be using "int" everywhere.

So, any plans for systems with 2,147,483,648 CPUs? ;-)

Thanx, Paul

Quoted 12 lines
Quoted 12 lines
kernel/rcutree_trace.c +0 -0
 DECLARE_PER_CPU(unsigned int, rcu_cpu_kthread_loops);
 DECLARE_PER_CPU(char, rcu_cpu_has_work);
 
Signature · 7 lines
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
author
#4 lore raw

Re: [PATCH 2/5] Fix mismatched variable in rcutree_trace.c

Quoted 4 lines

Hmmm... Some arches have signed CPU numbers while others have unsigned CPU numbers. I do use "-1" to mean "no CPU" in some cases (for example, in rcu_node_kthread_setaffinity()), so I guess for consistency I should be using "int" everywhere.

Do I hear that "int" is ok for you? If yes I will not revise the patch and please merge it. If it needs changes please let me know.

-Andi

#5 lore raw

Re: [PATCH 2/5] Fix mismatched variable in rcutree_trace.c

Quoted 7 lines · Andi Kleen
Quoted 4 lines

Hmmm... Some arches have signed CPU numbers while others have unsigned CPU numbers. I do use "-1" to mean "no CPU" in some cases (for example, in rcu_node_kthread_setaffinity()), so I guess for consistency I should be using "int" everywhere.

Do I hear that "int" is ok for you? If yes I will not revise the patch and please merge it. If it needs changes please let me know.

Yep, "int" is OK. I queued your patch and am testing it now.

Thank you for catching this!

Thanx, Paul

author
#6 lore raw

PATCH 3/5 IRDA: Fix global type conflicts in net/irda/irsysctl.c

In reply to Andi Kleen

From: Andi Kleen <[email protected]>

The externs here didn't agree with the declarations in qos.c.

Better would be probably to move this into a header, but since it's common practice to have naked externs with sysctls I left it for now.

---
 net/irda/irsysctl.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
net/irda/irsysctl.c +3 -3
index d0b70da..be22ad2 100644
@@ -40,9 +40,9 @@ extern int  sysctl_slot_timeout;
 extern int  sysctl_fast_poll_increase;
 extern char sysctl_devname[];
 extern int  sysctl_max_baud_rate;
-extern int  sysctl_min_tx_turn_time;
-extern int  sysctl_max_tx_data_size;
-extern int  sysctl_max_tx_window;
+extern unsigned  sysctl_min_tx_turn_time;
+extern unsigned  sysctl_max_tx_data_size;
+extern unsigned  sysctl_max_tx_window;
 extern int  sysctl_max_noreply_time;
 extern int  sysctl_warn_noreply_time;
 extern int  sysctl_lap_keepalive_time;
Signature · 1 line
1.7.4.4
maintainer
#7 lore raw

Re: [PATCH 3/5] IRDA: Fix global type conflicts in net/irda/irsysctl.c

Networking patches need to be submitted to [email protected] otherwise they won't be properly tracked in patchwork and applied.

Thanks.

author
#8 lore raw

PATCH 4/5 ixgbe: Fix incorrect declaration of ixgbevf_mbx_ops

In reply to Andi Kleen

From: Andi Kleen <[email protected]>

The header extern type of ixgbevf_mbx_ops disagreed with the actual declaration. Fix this here.

This is rather scary. I haven't tested it. Did this ever work?

---
 drivers/net/ixgbevf/ixgbevf.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/ixgbevf/ixgbevf.h +1 -1
index b703f60..a2bbbb3 100644
@@ -279,7 +279,7 @@ enum ixgbevf_boards {
 
 extern struct ixgbevf_info ixgbevf_82599_vf_info;
 extern struct ixgbevf_info ixgbevf_X540_vf_info;
-extern struct ixgbe_mac_operations ixgbevf_mbx_ops;
+extern struct ixgbe_mbx_operations ixgbevf_mbx_ops;
 
 /* needed by ethtool.c */
 extern char ixgbevf_driver_name[];
Signature · 1 line
1.7.4.4
#9 lore raw

RE: [PATCH 4/5] ixgbe: Fix incorrect declaration of ixgbevf_mbx_ops

Quoted 37 lines

-----Original Message-----
From: Andi Kleen [mailto:[email protected]]
Sent: Tuesday, June 07, 2011 3:27 PM
To: [email protected]
Cc: Andi Kleen; Kirsher, Jeffrey T; Brandeburg, Jesse; Rose, Gregory V
Subject: [PATCH 4/5] ixgbe: Fix incorrect declaration of ixgbevf_mbx_ops

From: Andi Kleen <[email protected]>

The header extern type of ixgbevf_mbx_ops disagreed with the actual declaration. Fix this here.

This is rather scary. I haven't tested it. Did this ever work?

---
 drivers/net/ixgbevf/ixgbevf.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/ixgbevf/ixgbevf.h +1 -2
index b703f60..a2bbbb3 100644
@@ -279,7 +279,7 @@ enum ixgbevf_boards {
 
 extern struct ixgbevf_info ixgbevf_82599_vf_info;
 extern struct ixgbevf_info ixgbevf_X540_vf_info;
-extern struct ixgbe_mac_operations ixgbevf_mbx_ops;
+extern struct ixgbe_mbx_operations ixgbevf_mbx_ops;
 
 /* needed by ethtool.c */
 extern char ixgbevf_driver_name[];
--
Quoted 1 line

1.7.4.4

[Greg Rose]
Huh.

Well, mbx ops is a table of 8 pointers and mac ops is a table of 11 pointers, so the copy would have over written 3 * pointer-size words of some other memory. But the 8 ops copied would have been correct so to the extent that we called them they worked.

Now that I look at it you missed a another spot where the copy is done that uses the ixgbe_mac_operations instead of the ixgbe_mbx_operations.

I'll fix that up.

Nice catch!

- Greg

#10 lore raw

Re: [PATCH 4/5] ixgbe: Fix incorrect declaration of ixgbevf_mbx_ops

Quoted 44 lines · Gregory V
Quoted 37 lines

-----Original Message-----
From: Andi Kleen [mailto:[email protected]]
Sent: Tuesday, June 07, 2011 3:27 PM
To: [email protected]
Cc: Andi Kleen; Kirsher, Jeffrey T; Brandeburg, Jesse; Rose, Gregory V
Subject: [PATCH 4/5] ixgbe: Fix incorrect declaration of ixgbevf_mbx_ops

From: Andi Kleen <[email protected]>

The header extern type of ixgbevf_mbx_ops disagreed with the actual declaration. Fix this here.

This is rather scary. I haven't tested it. Did this ever work?

---
 drivers/net/ixgbevf/ixgbevf.h |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/ixgbevf/ixgbevf.h +1 -2
index b703f60..a2bbbb3 100644
@@ -279,7 +279,7 @@ enum ixgbevf_boards {
 
  extern struct ixgbevf_info ixgbevf_82599_vf_info;
  extern struct ixgbevf_info ixgbevf_X540_vf_info;
-extern struct ixgbe_mac_operations ixgbevf_mbx_ops;
+extern struct ixgbe_mbx_operations ixgbevf_mbx_ops;
 
  /* needed by ethtool.c */
  extern char ixgbevf_driver_name[];
--
Quoted 1 line

1.7.4.4

[Greg Rose]
Huh.

Well, mbx ops is a table of 8 pointers and mac ops is a table of 11 pointers, so the copy would have over written 3 * pointer-size words of some other memory.  But the 8 ops copied would have been correct so to the extent that we called them they worked.

Quoted 8 lines

Now that I look at it you missed a another spot where the copy is done that uses the ixgbe_mac_operations instead of the ixgbe_mbx_operations.

I'll fix that up.

Nice catch!

- Greg
--

I have an updated patch by Greg in my queue, which I will be submitting through David Miller's networking tree. Thanks Andi and Greg!

Signature · 2 lines
Cheers,
Jeff
author
#11 lore raw

PATCH 5/5 Avoid section type conflict in dma/ioat/dma_v3.c

In reply to Andi Kleen

From: Andi Kleen <[email protected]>

const __read_mostly is not legal and causes section type conflicts. That's because the read.mostly section is not read only. Simply drop the const for the read mostly fields.

---
 drivers/dma/ioat/dma_v3.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/dma/ioat/dma_v3.c +4 -4
index d845dc4..e1e052a 100644
@@ -73,10 +73,10 @@
 /* provide a lookup table for setting the source address in the base or
  * extended descriptor of an xor or pq descriptor
  */
-static const u8 xor_idx_to_desc __read_mostly = 0xd0;
-static const u8 xor_idx_to_field[] __read_mostly = { 1, 4, 5, 6, 7, 0, 1, 2 };
-static const u8 pq_idx_to_desc __read_mostly = 0xf8;
-static const u8 pq_idx_to_field[] __read_mostly = { 1, 4, 5, 0, 1, 2, 4, 5 };
+static u8 xor_idx_to_desc __read_mostly = 0xd0;
+static u8 xor_idx_to_field[] __read_mostly = { 1, 4, 5, 6, 7, 0, 1, 2 };
+static u8 pq_idx_to_desc __read_mostly = 0xf8;
+static u8 pq_idx_to_field[] __read_mostly = { 1, 4, 5, 0, 1, 2, 4, 5 };
 
 static dma_addr_t xor_get_src(struct ioat_raw_descriptor *descs[2], int idx)
 {
Signature · 1 line
1.7.4.4
Acked-by on v1 5/5
#12 lore raw

Re: [PATCH 5/5] Avoid section type conflict in dma/ioat/dma_v3.c

Quoted 7 lines · Andi Kleen

From: Andi Kleen<[email protected]>

const __read_mostly is not legal and causes section type conflicts. That's because the read.mostly section is not read only. Simply drop the const for the read mostly fields.

I don't have any other ioatdma stuff pending so I'm happy for this to go in through another tree.

--
Dan