lkml.org 
[lkml]   [2017]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] scsi: lpfc_els: use swap macro in lpfc_plogi_confirm_nport
Make use of the swap macro and remove unnecessary variable keep_nlp_flag.
This makes the code easier to read and maintain.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
drivers/scsi/lpfc/lpfc_els.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index b14f7c5..1b745fe 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -1525,7 +1525,7 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
struct fc_rport *rport;
struct serv_parm *sp;
uint8_t name[sizeof(struct lpfc_name)];
- uint32_t rc, keepDID = 0, keep_nlp_flag = 0;
+ uint32_t rc, keepDID = 0;
uint16_t keep_nlp_state;
struct lpfc_nvme_rport *keep_nrport = NULL;
int put_node;
@@ -1616,9 +1616,7 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
phba->cfg_rrq_xri_bitmap_sz);

spin_lock_irq(shost->host_lock);
- keep_nlp_flag = new_ndlp->nlp_flag;
- new_ndlp->nlp_flag = ndlp->nlp_flag;
- ndlp->nlp_flag = keep_nlp_flag;
+ swap(new_ndlp->nlp_flag, ndlp->nlp_flag);
spin_unlock_irq(shost->host_lock);

/* Set nlp_states accordingly */
--
2.7.4
\
 
 \ /
  Last update: 2017-11-03 17:43    [W:0.033 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site