Skip to content

Commit

Permalink
mm: drop useless local parameters of __register_one_node()
Browse files Browse the repository at this point in the history
__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().

Link: http://lkml.kernel.org/r/1498013846-20149-1-git-send-email-douly.fnst@cn.fujitsu.com
Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Dou Liyang authored and Linus Torvalds committed Jul 10, 2017
1 parent 727c080 commit a7be6e5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/base/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit a7be6e5

Please sign in to comment.