Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1447227
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] cxl: Delete an unnecessary check before the function call "of_node_put" |
| Date | 2016-07-20 15:30 +0200 |
| Message-ID | <rWZJv-1YB-11@gated-at.bofh.it> (permalink) |
| References | (12 earlier) <mSsDN-4wa-59@gated-at.bofh.it> <mSsDN-4wa-61@gated-at.bofh.it> <mSsDN-4wa-63@gated-at.bofh.it> <mSsDN-4wa-65@gated-at.bofh.it> <mSsDN-4wa-33@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Wed, 20 Jul 2016 15:10:32 +0200 The of_node_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/misc/cxl/of.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/cxl/of.c b/drivers/misc/cxl/of.c index edc4583..333256a 100644 --- a/drivers/misc/cxl/of.c +++ b/drivers/misc/cxl/of.c @@ -490,8 +490,7 @@ int cxl_of_probe(struct platform_device *pdev) adapter->slices = 0; } - if (afu_np) - of_node_put(afu_np); + of_node_put(afu_np); return 0; } -- 2.9.2
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] cxl: Delete an unnecessary check before the function call "of_node_put" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-07-20 15:30 +0200 Re: [PATCH] cxl: Delete an unnecessary check before the function call "of_node_put" Julia Lawall <julia.lawall@lip6.fr> - 2016-07-20 15:40 +0200
csiph-web