From patchwork Mon Aug 5 13:48:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 170562 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp4322023ile; Mon, 5 Aug 2019 06:50:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3LgVN7OEeiqwt0LNkX7tWcEgfGbA/k+jNL3DUpVj5IkVS2my/mwFA7VUBVm3fN66Om70E X-Received: by 2002:a17:90a:ba93:: with SMTP id t19mr17873402pjr.139.1565013046065; Mon, 05 Aug 2019 06:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565013046; cv=none; d=google.com; s=arc-20160816; b=widK2Y2pioUaOtB5AqBmlyRtunyG27QomJEzy6IhSSXinH8pm+iUwbonCVZdDeVyfi tscGxcuCKcl4HbLzZHapZcPgx6tH7DSBAt+fSg/xCU015jdbfuRH66FexyEpPFkNTX+O 1mTZHIEhix82N4RsYk69wjGqmIerCLphgu/nDaRY2maNYvEGpOPAHZjhYchOMdrLyDtS /5/N8nTmADnSvtqcDyEpKcIWgSZ0FEzle7Lqd+DO4+pmZDtzVMxFB0FIyPfmgKMYndoA 0k64z7qK0ZHMxy4G2Di97hvJxjlKayRdnLGLt9ejFqnK4RARJwnisU+iKUx8AF/RRHnt C4MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=Mo2Moca2a+xjLm7uGS2qnxtUGBoZxjU8yfj6fsZRkq0=; b=hE0oyvFaguR6CGESOEyADmj4TAFWMU4FA4o7PG9OvE8ZTnqTEgJe5qrmjBZK0Ng9Cy lLgNcqDQpmRmBNpz5EliCXBEeh9fzQ8i6LD2nuqHgC60yzI0VsvQxymtwqNr5iH+YpSJ KDwqi07WkUpG5IiICQ/gnTfgroOeT1vU1kPxkdBTe1wBBkkd1wim6qcq0gBQyAHPshHb uhskyJum4rpttJhgaFZdc/1xPGBxpubhdk2mlkYpNWgo6kIzcho+yVjQ2nHg4mKRe2v3 jdZHWYjbLhba7WX3jSRZaQiRnlT/hBPFXOqlf6f27Ed97yqyKqkCxPb98nNtlfo8CDLC XscA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si44357502pfl.288.2019.08.05.06.50.45; Mon, 05 Aug 2019 06:50:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730422AbfHENuo (ORCPT + 29 others); Mon, 5 Aug 2019 09:50:44 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:44552 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729854AbfHENu2 (ORCPT ); Mon, 5 Aug 2019 09:50:28 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 24FF616D94FDECA0FE1E; Mon, 5 Aug 2019 21:50:24 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Mon, 5 Aug 2019 21:50:15 +0800 From: John Garry To: , CC: , , , Xiang Chen , "John Garry" Subject: [PATCH 13/15] scsi: hisi_sas: Remove some unnecessary code Date: Mon, 5 Aug 2019 21:48:10 +0800 Message-ID: <1565012892-75940-14-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1565012892-75940-1-git-send-email-john.garry@huawei.com> References: <1565012892-75940-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiang Chen Remove some unnecessary code, including: - Explicit zeroing of memory allocated for dmam_alloc_coherent() - Some duplicated code - Some redundant masking Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 5 ++--- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 5 +---- 2 files changed, 3 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index be15280343d1..e1c52811f4c7 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -2358,7 +2358,7 @@ int hisi_sas_alloc(struct hisi_hba *hisi_hba) s = HISI_SAS_MAX_ITCT_ENTRIES * sizeof(struct hisi_sas_itct); hisi_hba->itct = dmam_alloc_coherent(dev, s, &hisi_hba->itct_dma, - GFP_KERNEL | __GFP_ZERO); + GFP_KERNEL); if (!hisi_hba->itct) goto err_out; @@ -2385,7 +2385,7 @@ int hisi_sas_alloc(struct hisi_hba *hisi_hba) void *buf; buf = dmam_alloc_coherent(dev, s, &buf_dma, - GFP_KERNEL | __GFP_ZERO); + GFP_KERNEL); if (!buf) goto err_out; @@ -2434,7 +2434,6 @@ int hisi_sas_alloc(struct hisi_hba *hisi_hba) GFP_KERNEL); if (!hisi_hba->sata_breakpoint) goto err_out; - hisi_sas_init_mem(hisi_hba); hisi_sas_slot_index_init(hisi_hba); hisi_hba->last_slot_index = HISI_SAS_UNRESERVED_IPTT; diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 3cc53e5b92f2..db8c7e4b1954 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -1914,7 +1914,7 @@ static void fatal_ecc_int_v3_hw(struct hisi_hba *hisi_hba) u32 irq_value, irq_msk; irq_msk = hisi_sas_read32(hisi_hba, SAS_ECC_INTR_MSK); - hisi_sas_write32(hisi_hba, SAS_ECC_INTR_MSK, irq_msk | 0xffffffff); + hisi_sas_write32(hisi_hba, SAS_ECC_INTR_MSK, 0xffffffff); irq_value = hisi_sas_read32(hisi_hba, SAS_ECC_INTR); if (irq_value) @@ -3008,8 +3008,6 @@ hisi_sas_shost_alloc_pci(struct pci_dev *pdev) else hisi_hba->prot_mask = prot_mask; - timer_setup(&hisi_hba->timer, NULL, 0); - if (hisi_sas_get_fw_info(hisi_hba) < 0) goto err_out; @@ -3099,7 +3097,6 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) sha->lldd_module = THIS_MODULE; sha->sas_addr = &hisi_hba->sas_addr[0]; sha->num_phys = hisi_hba->n_phy; - sha->core.shost = hisi_hba->shost; for (i = 0; i < hisi_hba->n_phy; i++) { sha->sas_phy[i] = &hisi_hba->phy[i].sas_phy;