[PATCH 2/5] fsl_hypervisor: Delete an error message for a failed memory allocation in fsl_hv_open()

From: SF Markus Elfring
Date: Sat May 20 2017 - 15:13:24 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 20 May 2017 19:57:52 +0200

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
drivers/virt/fsl_hypervisor.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/virt/fsl_hypervisor.c b/drivers/virt/fsl_hypervisor.c
index d1df6c6740f1..40c5eb64f39b 100644
--- a/drivers/virt/fsl_hypervisor.c
+++ b/drivers/virt/fsl_hypervisor.c
@@ -663,7 +663,5 @@ static int fsl_hv_open(struct inode *inode, struct file *filp)
- if (!dbq) {
- pr_err("fsl-hv: out of memory\n");
+ if (!dbq)
return -ENOMEM;
- }

spin_lock_init(&dbq->lock);
init_waitqueue_head(&dbq->wait);
--
2.13.0