Skip to contentSkip to conversation

mm: Drop useless local parameters of __register_one_node()

PATCH Applied Dou Liyang 3 participants 6 messages Jun 21, 2017 – Jul 25, 2017

Subsystems (2)
lore
Share & tools
lore

Dou Liyang

author
#0 lore raw

PATCH v2 1/1 mm: Drop useless local parameters of __register_one_node()

... initializes local parameters "p_node" & "parent" for register_node().

But, register_node() does not use them.

Remove the related code of "parent" node, cleanup __register_one_node() and register_node().

---
V1 --> V2:
Rebase it on
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm

 drivers/base/node.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/base/node.c +2 -7
index 73d39bc..d8dc830 100644
@@ -288,7 +288,7 @@ static void node_device_release(struct device *dev)
  *
  * Initialize and register the node device.
  */
-static int register_node(struct node *node, int num, struct node *parent)
+static int register_node(struct node *node, int num)
 {
 	int error;
 
@@ -567,19 +567,14 @@ static void init_node_hugetlb_work(int nid) { }
 
 int __register_one_node(int nid)
 {
-	int p_node = parent_node(nid);
-	struct node *parent = NULL;
 	int error;
 	int cpu;
 
-	if (p_node != nid)
-		parent = node_devices[p_node];
-
 	node_devices[nid] = kzalloc(sizeof(struct node), GFP_KERNEL);
 	if (!node_devices[nid])
 		return -ENOMEM;
 
-	error = register_node(node_devices[nid], nid, parent);
+	error = register_node(node_devices[nid], nid);
 
 	/* link cpu under this node */
 	for_each_present_cpu(cpu) {
Signature · 9 lines
2.5.5



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Acked-by on v2 1/1
#1 lore raw
Quoted 8 lines · Dou Liyang

... initializes local parameters "p_node" & "parent" for register_node().

But, register_node() does not use them.

Remove the related code of "parent" node, cleanup __register_one_node() and register_node().

Quoted 6 lines

I am sorry, this slipped through cracks.

Quoted 52 lines

---
V1 --> V2:
Rebase it on
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm

 drivers/base/node.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/base/node.c +2 -7
index 73d39bc..d8dc830 100644
@@ -288,7 +288,7 @@ static void node_device_release(struct device *dev)
  *
  * Initialize and register the node device.
  */
-static int register_node(struct node *node, int num, struct node *parent)
+static int register_node(struct node *node, int num)
 {
 	int error;
 
@@ -567,19 +567,14 @@ static void init_node_hugetlb_work(int nid) { }
 
 int __register_one_node(int nid)
 {
-	int p_node = parent_node(nid);
-	struct node *parent = NULL;
 	int error;
 	int cpu;
 
-	if (p_node != nid)
-		parent = node_devices[p_node];
-
 	node_devices[nid] = kzalloc(sizeof(struct node), GFP_KERNEL);
 	if (!node_devices[nid])
 		return -ENOMEM;
 
-	error = register_node(node_devices[nid], nid, parent);
+	error = register_node(node_devices[nid], nid);
 
 	/* link cpu under this node */
 	for_each_present_cpu(cpu) {
Signature · 9 lines
2.5.5



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Signature · 8 lines
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
author
#2 lore raw

Hi Michal,

Quoted 16 lines · Michal Hocko
Quoted 8 lines · Dou Liyang

... initializes local parameters "p_node" & "parent" for register_node().

But, register_node() does not use them.

Remove the related code of "parent" node, cleanup __register_one_node() and register_node().

Quoted 6 lines
Quoted 2 lines

I am sorry, this slipped through cracks.

Thanks for your Acked-by, but this patch has been added to the -mm tree.
Its filename is
mm-drop-useless-local-parameters-of-__register_one_node.patch

This patch should soon appear at

http://ozlabs.org/~akpm/mmots/broken-out/mm-drop-useless-local-parameters-of-__register_one_node.patch
and later at

http://ozlabs.org/~akpm/mmotm/broken-out/mm-drop-useless-local-parameters-of-__register_one_node.patch

I don't know what should I do next ? :)

Thanks,
dou.

Quoted 48 lines
Quoted 48 lines

---
V1 --> V2:
Rebase it on
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm

 drivers/base/node.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/base/node.c +2 -8
index 73d39bc..d8dc830 100644
@@ -288,7 +288,7 @@ static void node_device_release(struct device *dev)
  *
  * Initialize and register the node device.
  */
-static int register_node(struct node *node, int num, struct node *parent)
+static int register_node(struct node *node, int num)
 {
 	int error;
 
@@ -567,19 +567,14 @@ static void init_node_hugetlb_work(int nid) { }
 
 int __register_one_node(int nid)
 {
-	int p_node = parent_node(nid);
-	struct node *parent = NULL;
 	int error;
 	int cpu;
 
-	if (p_node != nid)
-		parent = node_devices[p_node];
-
 	node_devices[nid] = kzalloc(sizeof(struct node), GFP_KERNEL);
 	if (!node_devices[nid])
 		return -ENOMEM;
 
-	error = register_node(node_devices[nid], nid, parent);
+	error = register_node(node_devices[nid], nid);
 
 	/* link cpu under this node */
 	for_each_present_cpu(cpu) {
--

2.5.5

Quoted 6 lines
Quoted 5 lines

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#3 lore raw
Quoted 19 lines · Dou Liyang

Hi Michal,

Quoted 16 lines · Michal Hocko
Quoted 14 lines · Dou Liyang

... initializes local parameters "p_node" & "parent" for register_node().

But, register_node() does not use them.

Remove the related code of "parent" node, cleanup __register_one_node() and register_node().

Quoted 6 lines
Quoted 2 lines

I am sorry, this slipped through cracks.

Thanks for your Acked-by, but this patch has been added to the -mm tree. Its filename is
mm-drop-useless-local-parameters-of-__register_one_node.patch

Yeah, don't worry. Andrew will add the acked-by in his tree.

Quoted 8 lines

This patch should soon appear at

http://ozlabs.org/~akpm/mmots/broken-out/mm-drop-useless-local-parameters-of-__register_one_node.patch
and later at

http://ozlabs.org/~akpm/mmotm/broken-out/mm-drop-useless-local-parameters-of-__register_one_node.patch

I don't know what should I do next ? :)

Wait for Andrew to send this to Linus during the next merge window.

Signature · 8 lines
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#4 lore raw
In reply to Dou Liyang
Quoted 14 lines · Dou Liyang

... initializes local parameters "p_node" & "parent" for register_node().

But, register_node() does not use them.

Remove the related code of "parent" node, cleanup __register_one_node() and register_node().

Quoted 7 lines

---
V1 --> V2:
Rebase it on
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm

 drivers/base/node.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

That appears to be the last user of parent_node().

Can we start removing it from the topology.h headers for each arch?

cheers

author
#5 lore raw

Hi Michael,

Quoted 21 lines · Michael Ellerman
Quoted 19 lines · Dou Liyang

... initializes local parameters "p_node" & "parent" for register_node().

But, register_node() does not use them.

Remove the related code of "parent" node, cleanup __register_one_node() and register_node().

---
V1 --> V2:
Rebase it on
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm

Quoted 4 lines
Quoted 2 lines
 drivers/base/node.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

That appears to be the last user of parent_node().

Oops, yes, it is the last one.

Quoted 3 lines

Can we start removing it from the topology.h headers for each arch?

Yes, I think so.

Thanks,
dou.

Quoted 4 lines

cheers

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>