From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755103AbdEIRQL (ORCPT ); Tue, 9 May 2017 13:16:11 -0400 Received: from gateway36.websitewelcome.com ([50.116.126.2]:42168 "EHLO gateway36.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753322AbdEIRQK (ORCPT ); Tue, 9 May 2017 13:16:10 -0400 X-Greylist: delayed 1491 seconds by postgrey-1.27 at vger.kernel.org; Tue, 09 May 2017 13:16:10 EDT Date: Tue, 9 May 2017 11:51:15 -0500 From: "Gustavo A. R. Silva" To: qla2xxx-upstream@qlogic.com, "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] scsi: qla2xxx: remove dead code Message-ID: <20170509165114.GA14533@embeddedgus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.152.157.2 X-Exim-ID: 1d88Lz-000ASQ-Uf X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.152.157.2]:54108 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 6 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Local variable page_mode is assigned to a constant value and it is never updated again. Remove this variable and the dead code it guards. Addresses-Coverity-ID: 200420 Signed-off-by: Gustavo A. R. Silva --- drivers/scsi/qla2xxx/qla_nx.c | 48 ------------------------------------------- 1 file changed, 48 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index 0a1723c..bff63b2 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c @@ -2676,26 +2676,9 @@ qla82xx_write_flash_data(struct scsi_qla_host *vha, uint32_t *dwptr, int ret; uint32_t liter; uint32_t rest_addr; - dma_addr_t optrom_dma; - void *optrom = NULL; - int page_mode = 0; struct qla_hw_data *ha = vha->hw; ret = -1; - - /* Prepare burst-capable write on supported ISPs. */ - if (page_mode && !(faddr & 0xfff) && - dwords > OPTROM_BURST_DWORDS) { - optrom = dma_alloc_coherent(&ha->pdev->dev, OPTROM_BURST_SIZE, - &optrom_dma, GFP_KERNEL); - if (!optrom) { - ql_log(ql_log_warn, vha, 0xb01b, - "Unable to allocate memory " - "for optrom burst write (%x KB).\n", - OPTROM_BURST_SIZE / 1024); - } - } - rest_addr = ha->fdt_block_size - 1; ret = qla82xx_unprotect_flash(ha); @@ -2718,34 +2701,6 @@ qla82xx_write_flash_data(struct scsi_qla_host *vha, uint32_t *dwptr, } } - /* Go with burst-write. */ - if (optrom && (liter + OPTROM_BURST_DWORDS) <= dwords) { - /* Copy data to DMA'ble buffer. */ - memcpy(optrom, dwptr, OPTROM_BURST_SIZE); - - ret = qla2x00_load_ram(vha, optrom_dma, - (ha->flash_data_off | faddr), - OPTROM_BURST_DWORDS); - if (ret != QLA_SUCCESS) { - ql_log(ql_log_warn, vha, 0xb01e, - "Unable to burst-write optrom segment " - "(%x/%x/%llx).\n", ret, - (ha->flash_data_off | faddr), - (unsigned long long)optrom_dma); - ql_log(ql_log_warn, vha, 0xb01f, - "Reverting to slow-write.\n"); - - dma_free_coherent(&ha->pdev->dev, - OPTROM_BURST_SIZE, optrom, optrom_dma); - optrom = NULL; - } else { - liter += OPTROM_BURST_DWORDS - 1; - faddr += OPTROM_BURST_DWORDS - 1; - dwptr += OPTROM_BURST_DWORDS - 1; - continue; - } - } - ret = qla82xx_write_flash_dword(ha, faddr, cpu_to_le32(*dwptr)); if (ret) { @@ -2761,9 +2716,6 @@ qla82xx_write_flash_data(struct scsi_qla_host *vha, uint32_t *dwptr, ql_log(ql_log_warn, vha, 0xb021, "Unable to protect flash after update.\n"); write_done: - if (optrom) - dma_free_coherent(&ha->pdev->dev, - OPTROM_BURST_SIZE, optrom, optrom_dma); return ret; } -- 2.5.0