diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2019-05-02 08:45:35 -0400 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2019-05-02 17:38:59 -0400 |
commit | 2a656cb5a4a3473c5fc6bf4fddc3560ceed53220 (patch) | |
tree | 923947b1be1542735854452b36762a54399896fe /drivers/of/unittest.c | |
parent | 6f7dc9a37f2b325fc870d1e1ada6169185f8852c (diff) |
of: unittest: Remove error printing on OOM
There is no need to print a backtrace or other error message if
kzalloc(), kmemdup(), or devm_kzalloc() fails, as the memory allocation
core already takes care of that.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/unittest.c')
-rw-r--r-- | drivers/of/unittest.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index cccde756b510..3832a5de4602 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c | |||
@@ -344,7 +344,7 @@ static void __init of_unittest_check_phandles(void) | |||
344 | } | 344 | } |
345 | 345 | ||
346 | nh = kzalloc(sizeof(*nh), GFP_KERNEL); | 346 | nh = kzalloc(sizeof(*nh), GFP_KERNEL); |
347 | if (WARN_ON(!nh)) | 347 | if (!nh) |
348 | return; | 348 | return; |
349 | 349 | ||
350 | nh->np = np; | 350 | nh->np = np; |
@@ -1199,12 +1199,9 @@ static int __init unittest_data_add(void) | |||
1199 | 1199 | ||
1200 | /* creating copy */ | 1200 | /* creating copy */ |
1201 | unittest_data = kmemdup(__dtb_testcases_begin, size, GFP_KERNEL); | 1201 | unittest_data = kmemdup(__dtb_testcases_begin, size, GFP_KERNEL); |
1202 | 1202 | if (!unittest_data) | |
1203 | if (!unittest_data) { | ||
1204 | pr_warn("%s: Failed to allocate memory for unittest_data; " | ||
1205 | "not running tests\n", __func__); | ||
1206 | return -ENOMEM; | 1203 | return -ENOMEM; |
1207 | } | 1204 | |
1208 | of_fdt_unflatten_tree(unittest_data, NULL, &unittest_data_node); | 1205 | of_fdt_unflatten_tree(unittest_data, NULL, &unittest_data_node); |
1209 | if (!unittest_data_node) { | 1206 | if (!unittest_data_node) { |
1210 | pr_warn("%s: No tree to attach; not running tests\n", __func__); | 1207 | pr_warn("%s: No tree to attach; not running tests\n", __func__); |
@@ -1845,10 +1842,8 @@ static int unittest_i2c_bus_probe(struct platform_device *pdev) | |||
1845 | dev_dbg(dev, "%s for node @%pOF\n", __func__, np); | 1842 | dev_dbg(dev, "%s for node @%pOF\n", __func__, np); |
1846 | 1843 | ||
1847 | std = devm_kzalloc(dev, sizeof(*std), GFP_KERNEL); | 1844 | std = devm_kzalloc(dev, sizeof(*std), GFP_KERNEL); |
1848 | if (!std) { | 1845 | if (!std) |
1849 | dev_err(dev, "Failed to allocate unittest i2c data\n"); | ||
1850 | return -ENOMEM; | 1846 | return -ENOMEM; |
1851 | } | ||
1852 | 1847 | ||
1853 | /* link them together */ | 1848 | /* link them together */ |
1854 | std->pdev = pdev; | 1849 | std->pdev = pdev; |