aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qedf/qedf_io.c
diff options
context:
space:
mode:
authorDupuis, Chad <chad.dupuis@cavium.com>2017-02-23 10:01:03 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2017-02-23 16:59:04 -0500
commit1afca6b5f31616d330fb64a0c87060640a75ff6a (patch)
treeb40d33285049af3c137c24851ca2fb9f6d8e0540 /drivers/scsi/qedf/qedf_io.c
parentfcbfffe2c5cbec0c1721b2261c316b961ad50208 (diff)
scsi: qedf: fixup compilation warning about atomic_t usage
Based on an original patch by Hannes Reinecke. The driver didn't follow the atomic_t vs refcount_t change, and anyway one should be using kref_read() instead of accessing the counter inside an kref. Fixes: 61d8658b4a435e ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.) Cc: Hannes Reinecke <hare@suse.de> Cc: Nilesh Javali <nilesh.javali@cavium.com> Signed-off-by: Dupuis, Chad <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qedf/qedf_io.c')
-rw-r--r--drivers/scsi/qedf/qedf_io.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c
index 486c045ac8bb..ee0dcf9d3aba 100644
--- a/drivers/scsi/qedf/qedf_io.c
+++ b/drivers/scsi/qedf/qedf_io.c
@@ -998,7 +998,7 @@ static void qedf_trace_io(struct qedf_rport *fcport, struct qedf_ioreq *io_req,
998 io_log->sg_count = scsi_sg_count(sc_cmd); 998 io_log->sg_count = scsi_sg_count(sc_cmd);
999 io_log->result = sc_cmd->result; 999 io_log->result = sc_cmd->result;
1000 io_log->jiffies = jiffies; 1000 io_log->jiffies = jiffies;
1001 io_log->refcount = atomic_read(&io_req->refcount.refcount); 1001 io_log->refcount = kref_read(&io_req->refcount);
1002 1002
1003 if (direction == QEDF_IO_TRACE_REQ) { 1003 if (direction == QEDF_IO_TRACE_REQ) {
1004 /* For requests we only care abot the submission CPU */ 1004 /* For requests we only care abot the submission CPU */
@@ -1340,7 +1340,7 @@ void qedf_scsi_completion(struct qedf_ctx *qedf, struct fcoe_cqe *cqe,
1340 /* Good I/O completion */ 1340 /* Good I/O completion */
1341 sc_cmd->result = DID_OK << 16; 1341 sc_cmd->result = DID_OK << 16;
1342 } else { 1342 } else {
1343 refcount = atomic_read(&io_req->refcount.refcount); 1343 refcount = kref_read(&io_req->refcount);
1344 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO, 1344 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO,
1345 "%d:0:%d:%d xid=0x%0x op=0x%02x " 1345 "%d:0:%d:%d xid=0x%0x op=0x%02x "
1346 "lba=%02x%02x%02x%02x cdb_status=%d " 1346 "lba=%02x%02x%02x%02x cdb_status=%d "
@@ -1425,7 +1425,7 @@ void qedf_scsi_done(struct qedf_ctx *qedf, struct qedf_ioreq *io_req,
1425 qedf_unmap_sg_list(qedf, io_req); 1425 qedf_unmap_sg_list(qedf, io_req);
1426 1426
1427 sc_cmd->result = result << 16; 1427 sc_cmd->result = result << 16;
1428 refcount = atomic_read(&io_req->refcount.refcount); 1428 refcount = kref_read(&io_req->refcount);
1429 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO, "%d:0:%d:%d: Completing " 1429 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO, "%d:0:%d:%d: Completing "
1430 "sc_cmd=%p result=0x%08x op=0x%02x lba=0x%02x%02x%02x%02x, " 1430 "sc_cmd=%p result=0x%08x op=0x%02x lba=0x%02x%02x%02x%02x, "
1431 "allowed=%d retries=%d refcount=%d.\n", 1431 "allowed=%d retries=%d refcount=%d.\n",
@@ -1556,7 +1556,7 @@ static void qedf_flush_els_req(struct qedf_ctx *qedf,
1556{ 1556{
1557 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO, 1557 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO,
1558 "Flushing ELS request xid=0x%x refcount=%d.\n", els_req->xid, 1558 "Flushing ELS request xid=0x%x refcount=%d.\n", els_req->xid,
1559 atomic_read(&els_req->refcount.refcount)); 1559 kref_read(&els_req->refcount));
1560 1560
1561 /* 1561 /*
1562 * Need to distinguish this from a timeout when calling the 1562 * Need to distinguish this from a timeout when calling the