path: root/drivers/of/unittest.c
diff options
authorGrant Likely <grant.likely@linaro.org>2014-11-14 15:33:07 +0000
committerMark Brown <broonie@kernel.org>2015-02-20 23:41:28 +0900
commit8e13f7dacf243610e4478d82479f85b97d5c923f (patch)
tree31ce487cfadd4e97a5b729f9cfc62fc0613fe5cb /drivers/of/unittest.c
parent94b62a841aac10919826afaf3cdee118dbdabef2 (diff)
of: Use vargs in __of_node_alloc
The overlay code needs to construct a new full_name from the parent name and the node name, but the current method has to allocate and then free an temporary string which is wasteful. Fix this problem by using vargs to pass in a format and arguments into __of_node_alloc(). At the same time remove the allocflags argument to __of_node_alloc(). The only users all use GFP_KERNEL, so there is no need to provide it as an option. If there is ever a need later it can be added back. Signed-off-by: Grant Likely <grant.likely@linaro.org> (cherry picked from commit ef8bbd73a76197cf8362a2b43aaadc5717bd0746) Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/of/unittest.c')
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 1207b6d0c122..d1bb1975a738 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -403,11 +403,11 @@ static void __init of_selftest_changeset(void)
struct of_changeset chgset;
- n1 = __of_node_alloc("/testcase-data/changeset/n1", GFP_KERNEL);
+ n1 = __of_node_alloc("/testcase-data/changeset/n1");
selftest(n1, "testcase setup failure\n");
- n2 = __of_node_alloc("/testcase-data/changeset/n2", GFP_KERNEL);
+ n2 = __of_node_alloc("/testcase-data/changeset/n2");
selftest(n2, "testcase setup failure\n");
- n21 = __of_node_alloc("/testcase-data/changeset/n2/n21", GFP_KERNEL);
+ n21 = __of_node_alloc("/testcase-data/changeset/n2/n21");
selftest(n21, "testcase setup failure %p\n", n21);
nremove = of_find_node_by_path("/testcase-data/changeset/node-remove");
selftest(nremove, "testcase setup failure\n");