[PATCH 3/3] misc/ibmasm: Adjust two function calls together with a variable assignment

From: SF Markus Elfring
Date: Mon Jan 08 2018 - 08:10:50 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxxxxxxx>
---
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