summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2018-02-06 18:39:48 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-06 21:32:46 -0500
commite1d66d042187f7f18a50fab83cbc9b21b183cc7c (patch)
treebdfec353c6ea7a10ce435eb74b678eb344dafe64
parent93dd49afc27b72cc621b3d9c2ff86052db9c8222 (diff)
rapidio: adjust five function calls together with a variable assignment
checkpatch pointed information out like the following. ERROR: do not use assignment in if condition Thus fix the affected source code places. Link: http://lkml.kernel.org/r/6f5631ed-ec3e-503d-850a-ab09b5736dbe@users.sourceforge.net Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Acked-by: Alexandre Bounine <alexandre.bounine@idt.com> Cc: Matt Porter <mporter@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/rapidio/rio.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index f89085564c2c..b9dc932ce19e 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -252,9 +252,9 @@ int rio_request_inb_mbox(struct rio_mport *mport,
252 rio_init_mbox_res(res, mbox, mbox); 252 rio_init_mbox_res(res, mbox, mbox);
253 253
254 /* Make sure this mailbox isn't in use */ 254 /* Make sure this mailbox isn't in use */
255 if ((rc = 255 rc = request_resource(&mport->riores[RIO_INB_MBOX_RESOURCE],
256 request_resource(&mport->riores[RIO_INB_MBOX_RESOURCE], 256 res);
257 res)) < 0) { 257 if (rc < 0) {
258 kfree(res); 258 kfree(res);
259 goto out; 259 goto out;
260 } 260 }
@@ -335,9 +335,9 @@ int rio_request_outb_mbox(struct rio_mport *mport,
335 rio_init_mbox_res(res, mbox, mbox); 335 rio_init_mbox_res(res, mbox, mbox);
336 336
337 /* Make sure this outbound mailbox isn't in use */ 337 /* Make sure this outbound mailbox isn't in use */
338 if ((rc = 338 rc = request_resource(&mport->riores[RIO_OUTB_MBOX_RESOURCE],
339 request_resource(&mport->riores[RIO_OUTB_MBOX_RESOURCE], 339 res);
340 res)) < 0) { 340 if (rc < 0) {
341 kfree(res); 341 kfree(res);
342 goto out; 342 goto out;
343 } 343 }
@@ -406,9 +406,9 @@ rio_setup_inb_dbell(struct rio_mport *mport, void *dev_id, struct resource *res,
406 u16 info)) 406 u16 info))
407{ 407{
408 int rc = 0; 408 int rc = 0;
409 struct rio_dbell *dbell; 409 struct rio_dbell *dbell = kmalloc(sizeof(*dbell), GFP_KERNEL);
410 410
411 if (!(dbell = kmalloc(sizeof(struct rio_dbell), GFP_KERNEL))) { 411 if (!dbell) {
412 rc = -ENOMEM; 412 rc = -ENOMEM;
413 goto out; 413 goto out;
414 } 414 }
@@ -452,9 +452,9 @@ int rio_request_inb_dbell(struct rio_mport *mport,
452 rio_init_dbell_res(res, start, end); 452 rio_init_dbell_res(res, start, end);
453 453
454 /* Make sure these doorbells aren't in use */ 454 /* Make sure these doorbells aren't in use */
455 if ((rc = 455 rc = request_resource(&mport->riores[RIO_DOORBELL_RESOURCE],
456 request_resource(&mport->riores[RIO_DOORBELL_RESOURCE], 456 res);
457 res)) < 0) { 457 if (rc < 0) {
458 kfree(res); 458 kfree(res);
459 goto out; 459 goto out;
460 } 460 }
@@ -1411,7 +1411,9 @@ rio_mport_get_feature(struct rio_mport * port, int local, u16 destid,
1411 ext_ftr_ptr, &ftr_header); 1411 ext_ftr_ptr, &ftr_header);
1412 if (RIO_GET_BLOCK_ID(ftr_header) == ftr) 1412 if (RIO_GET_BLOCK_ID(ftr_header) == ftr)
1413 return ext_ftr_ptr; 1413 return ext_ftr_ptr;
1414 if (!(ext_ftr_ptr = RIO_GET_BLOCK_PTR(ftr_header))) 1414
1415 ext_ftr_ptr = RIO_GET_BLOCK_PTR(ftr_header);
1416 if (!ext_ftr_ptr)
1415 break; 1417 break;
1416 } 1418 }
1417 1419