lkml.org 
[lkml]   [2018]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 3/3] misc/ibmasm: Adjust two function calls together with a variable assignment
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 8 Jan 2018 13:53:25 +0100

The script "checkpatch.pl" pointed information out like the following.

ERROR: do not use assignment in if condition

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/misc/ibmasm/module.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/ibmasm/module.c b/drivers/misc/ibmasm/module.c
index 894397b1ee51..f4742044e0d1 100644
--- a/drivers/misc/ibmasm/module.c
+++ b/drivers/misc/ibmasm/module.c
@@ -64,14 +64,16 @@ MODULE_PARM_DESC(ibmasm_debug, " Set debug mode on or off");

static int ibmasm_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
{
- int result;
struct service_processor *sp;
+ int result = pci_enable_device(pdev);

- if ((result = pci_enable_device(pdev))) {
+ if (result) {
dev_err(&pdev->dev, "Failed to enable PCI device\n");
return result;
}
- if ((result = pci_request_regions(pdev, DRIVER_NAME))) {
+
+ result = pci_request_regions(pdev, DRIVER_NAME);
+ if (result) {
dev_err(&pdev->dev, "Failed to allocate PCI resources\n");
goto error_resources;
}
--
2.15.1
\
 
 \ /
  Last update: 2018-01-14 23:17    [W:0.029 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site