Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: qedf: Remove a whole host of unused variables

Fixes the following W=1 kernel build warning(s):

drivers/scsi/qedf/qedf_io.c: In function ‘qedf_cmd_timeout’:
drivers/scsi/qedf/qedf_io.c:25:5: warning: variable ‘op’ set but not used [-Wunused-but-set-variable]
25 | u8 op = 0;
| ^~
drivers/scsi/qedf/qedf_io.c: In function ‘qedf_map_sg’:
drivers/scsi/qedf/qedf_io.c:490:12: warning: variable ‘end_addr’ set but not used [-Wunused-but-set-variable]
490 | u64 addr, end_addr;
| ^~~~~~~~
drivers/scsi/qedf/qedf_io.c: In function ‘qedf_post_io_req’:
drivers/scsi/qedf/qedf_io.c:863:22: warning: variable ‘req_type’ set but not used [-Wunused-but-set-variable]
863 | enum fcoe_task_type req_type = 0;
| ^~~~~~~~
drivers/scsi/qedf/qedf_io.c: In function ‘qedf_scsi_completion’:
drivers/scsi/qedf/qedf_io.c:1134:31: warning: variable ‘task_ctx’ set but not used [-Wunused-but-set-variable]
1134 | struct e4_fcoe_task_context *task_ctx;
| ^~~~~~~~
drivers/scsi/qedf/qedf_io.c: In function ‘qedf_scsi_done’:
drivers/scsi/qedf/qedf_io.c:1345:6: warning: variable ‘xid’ set but not used [-Wunused-but-set-variable]
1345 | u16 xid;
| ^~~
drivers/scsi/qedf/qedf_io.c: In function ‘qedf_initiate_abts’:
drivers/scsi/qedf/qedf_io.c:1866:6: warning: variable ‘r_a_tov’ set but not used [-Wunused-but-set-variable]
1866 | u32 r_a_tov = 0;
| ^~~~~~~
drivers/scsi/qedf/qedf_io.c: In function ‘qedf_process_abts_compl’:
drivers/scsi/qedf/qedf_io.c:1967:11: warning: variable ‘xid’ set but not used [-Wunused-but-set-variable]
1967 | uint16_t xid;
| ^~~
drivers/scsi/qedf/qedf_io.c: In function ‘qedf_initiate_cleanup’:
drivers/scsi/qedf/qedf_io.c:2163:31: warning: variable ‘task’ set but not used [-Wunused-but-set-variable]
2163 | struct e4_fcoe_task_context *task;
| ^~~~
drivers/scsi/qedf/qedf_io.c: In function ‘qedf_process_unsol_compl’:
drivers/scsi/qedf/qedf_io.c:2534:11: warning: variable ‘tmp’ set but not used [-Wunused-but-set-variable]
2534 | uint16_t tmp;
| ^~~

Link: https://lore.kernel.org/r/20200713074645.126138-17-lee.jones@linaro.org
Cc: QLogic-Storage-Upstream@cavium.com
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Lee Jones and committed by
Martin K. Petersen
50efc51c 18bc435e

+4 -26
+4 -26
drivers/scsi/qedf/qedf_io.c
··· 22 22 container_of(work, struct qedf_ioreq, timeout_work.work); 23 23 struct qedf_ctx *qedf; 24 24 struct qedf_rport *fcport; 25 - u8 op = 0; 26 25 27 26 if (io_req == NULL) { 28 27 QEDF_INFO(NULL, QEDF_LOG_IO, "io_req is NULL.\n"); ··· 88 89 io_req->event = QEDF_IOREQ_EV_ELS_TMO; 89 90 /* Call callback function to complete command */ 90 91 if (io_req->cb_func && io_req->cb_arg) { 91 - op = io_req->cb_arg->op; 92 92 io_req->cb_func(io_req->cb_arg); 93 93 io_req->cb_arg = NULL; 94 94 } ··· 485 487 int sg_count = 0; 486 488 int bd_count = 0; 487 489 u32 sg_len; 488 - u64 addr, end_addr; 490 + u64 addr; 489 491 int i = 0; 490 492 491 493 sg_count = dma_map_sg(&qedf->pdev->dev, scsi_sglist(sc), ··· 500 502 scsi_for_each_sg(sc, sg, sg_count, i) { 501 503 sg_len = (u32)sg_dma_len(sg); 502 504 addr = (u64)sg_dma_address(sg); 503 - end_addr = (u64)(addr + sg_len); 504 505 505 506 /* 506 - * Intermediate s/g element so check if start and end address 507 + * Intermediate s/g element so check if start address 507 508 * is page aligned. Only required for writes and only if the 508 509 * number of scatter/gather elements is 8 or more. 509 510 */ ··· 857 860 struct qedf_ctx *qedf = lport_priv(lport); 858 861 struct e4_fcoe_task_context *task_ctx; 859 862 u16 xid; 860 - enum fcoe_task_type req_type = 0; 861 863 struct fcoe_wqe *sqe; 862 864 u16 sqe_idx; 863 865 ··· 869 873 io_req->cpu = smp_processor_id(); 870 874 871 875 if (sc_cmd->sc_data_direction == DMA_FROM_DEVICE) { 872 - req_type = FCOE_TASK_TYPE_READ_INITIATOR; 873 876 io_req->io_req_flags = QEDF_READ; 874 877 qedf->input_requests++; 875 878 } else if (sc_cmd->sc_data_direction == DMA_TO_DEVICE) { 876 - req_type = FCOE_TASK_TYPE_WRITE_INITIATOR; 877 879 io_req->io_req_flags = QEDF_WRITE; 878 880 qedf->output_requests++; 879 881 } else { ··· 1124 1130 void qedf_scsi_completion(struct qedf_ctx *qedf, struct fcoe_cqe *cqe, 1125 1131 struct qedf_ioreq *io_req) 1126 1132 { 1127 - u16 xid; 1128 - struct e4_fcoe_task_context *task_ctx; 1129 1133 struct scsi_cmnd *sc_cmd; 1130 1134 struct fcoe_cqe_rsp_info *fcp_rsp; 1131 1135 struct qedf_rport *fcport; ··· 1147 1155 return; 1148 1156 } 1149 1157 1150 - xid = io_req->xid; 1151 - task_ctx = qedf_get_task_mem(&qedf->tasks, xid); 1152 1158 sc_cmd = io_req->sc_cmd; 1153 1159 fcp_rsp = &cqe->cqe_info.rsp_info; 1154 1160 ··· 1332 1342 void qedf_scsi_done(struct qedf_ctx *qedf, struct qedf_ioreq *io_req, 1333 1343 int result) 1334 1344 { 1335 - u16 xid; 1336 1345 struct scsi_cmnd *sc_cmd; 1337 1346 int refcount; 1338 1347 ··· 1353 1364 */ 1354 1365 clear_bit(QEDF_CMD_OUTSTANDING, &io_req->flags); 1355 1366 1356 - xid = io_req->xid; 1357 1367 sc_cmd = io_req->sc_cmd; 1358 1368 1359 1369 if (!sc_cmd) { ··· 1851 1863 struct fc_rport_priv *rdata; 1852 1864 struct qedf_ctx *qedf; 1853 1865 u16 xid; 1854 - u32 r_a_tov = 0; 1855 1866 int rc = 0; 1856 1867 unsigned long flags; 1857 1868 struct fcoe_wqe *sqe; ··· 1873 1886 goto out; 1874 1887 } 1875 1888 1876 - r_a_tov = rdata->r_a_tov; 1877 1889 lport = qedf->lport; 1878 1890 1879 1891 if (lport->state != LPORT_ST_READY || !(lport->link_up)) { ··· 1950 1964 struct qedf_ioreq *io_req) 1951 1965 { 1952 1966 uint32_t r_ctl; 1953 - uint16_t xid; 1954 1967 int rc; 1955 1968 struct qedf_rport *fcport = io_req->fcport; 1956 1969 1957 1970 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_SCSI_TM, "Entered with xid = " 1958 1971 "0x%x cmd_type = %d\n", io_req->xid, io_req->cmd_type); 1959 1972 1960 - xid = io_req->xid; 1961 1973 r_ctl = cqe->cqe_info.abts_info.r_ctl; 1962 1974 1963 1975 /* This was added at a point when we were scheduling abts_compl & ··· 2143 2159 { 2144 2160 struct qedf_rport *fcport; 2145 2161 struct qedf_ctx *qedf; 2146 - uint16_t xid; 2147 - struct e4_fcoe_task_context *task; 2148 2162 int tmo = 0; 2149 2163 int rc = SUCCESS; 2150 2164 unsigned long flags; ··· 2202 2220 refcount, fcport, fcport->rdata->ids.port_id); 2203 2221 2204 2222 /* Cleanup cmds re-use the same TID as the original I/O */ 2205 - xid = io_req->xid; 2206 2223 io_req->cmd_type = QEDF_CLEANUP; 2207 2224 io_req->return_scsi_cmd_on_abts = return_scsi_cmd_on_abts; 2208 - 2209 - task = qedf_get_task_mem(&qedf->tasks, xid); 2210 2225 2211 2226 init_completion(&io_req->cleanup_done); 2212 2227 ··· 2510 2531 struct fcoe_cqe *cqe) 2511 2532 { 2512 2533 unsigned long flags; 2513 - uint16_t tmp; 2514 2534 uint16_t pktlen = cqe->cqe_info.unsolic_info.pkt_len; 2515 2535 u32 payload_len, crc; 2516 2536 struct fc_frame_header *fh; ··· 2607 2629 qedf->bdq_prod_idx = 0; 2608 2630 2609 2631 writew(qedf->bdq_prod_idx, qedf->bdq_primary_prod); 2610 - tmp = readw(qedf->bdq_primary_prod); 2632 + readw(qedf->bdq_primary_prod); 2611 2633 writew(qedf->bdq_prod_idx, qedf->bdq_secondary_prod); 2612 - tmp = readw(qedf->bdq_secondary_prod); 2634 + readw(qedf->bdq_secondary_prod); 2613 2635 2614 2636 spin_unlock_irqrestore(&qedf->hba_lock, flags); 2615 2637 }