Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2610815pxb; Mon, 11 Jan 2021 14:36:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJx40q1blwX92s5/+03su2aWO/h2MxM60SZZhCcJ7zR1bzKOZ3VzVlf5eF+Su+f99DsciG6E X-Received: by 2002:a17:906:3c04:: with SMTP id h4mr1066688ejg.220.1610404602961; Mon, 11 Jan 2021 14:36:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610404602; cv=none; d=google.com; s=arc-20160816; b=o0cR0JwEvWoHXq/lEjrI4PTHkA/W8fLmmnl2duEPXLPudvRVDa2ASl9Cocy9PKDagB QWQcQahaMmDM/QavakipBPb32bvESCR/MzKy62MH1tqdoAgzHLBOJbFqF/r0cf7ZGvI8 PScztPVTyhv7GUHg5i10wokrZo7e8KohRolj2/sk2vf6b6fD3bhLqR5XaEWC5HyzUSna war3r1pHeFgUAKlJUD9cxS+uXn5T+Cg21WOMHLG2H5qQsgq9hp3RIc5Q1tt4A6/mq2p7 bp7PxDjPZOygCLR8H7c9D7YevOYQTO6pDt6IqmofOcb5pJVpz3C2XKPFBD3DzH1bQukf ZQyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=TuL8hgFVL4I8OOHJFG5/ip2YEave37hlRfmsC8L9xeQ=; b=Lz+2Mga+4l4/xSlZmWnN1aT8n2T65X3I8y24hU7xScaKAPKC70xQiWB3mKMSufX8Op DRbUn6q7eeFU5GUK1skxEHTBDw3XiyZng3hAT/g3wu1PYSLDLtUPx3uG1pera97nL37d /euSaUdC5x2ffS3HB+27oYJjvg01/MORHgLwbMb0HBEgTU0Xl8bkn3pE+L9TWA8iz9Pi VACmD8vUrNEKfHdh5W972gWRAfSdfTkvqQ1ecMUvH+CQRdmZixB+a8B3yhyD3Tt9lbcf KaAoHuQEb2J+hmbxE0A0exSR4HZlt0MD+Bua0W3QksPpWdpCUEmhuOaaSgDg5m6DYzle hDhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ARZeQxO5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g4si409887edu.577.2021.01.11.14.36.18; Mon, 11 Jan 2021 14:36:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ARZeQxO5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390292AbhAKWc4 (ORCPT + 99 others); Mon, 11 Jan 2021 17:32:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390201AbhAKWcz (ORCPT ); Mon, 11 Jan 2021 17:32:55 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33913C061795; Mon, 11 Jan 2021 14:32:14 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id v26so130658eds.13; Mon, 11 Jan 2021 14:32:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TuL8hgFVL4I8OOHJFG5/ip2YEave37hlRfmsC8L9xeQ=; b=ARZeQxO585p6eFTlOJkem2p0CDAnMV89SwB9IH4vzv9uRq7tOWGzfRxCaQURTd6eUu iHp1Awnz8s2BXxwd72qvIq4CibjJ/e2SAypJKnXepuW7B1S9xaIrQ0G8frJNFB0/gE79 /ZylNLRXTJapElyVqBHLv2MrynfBvpn9YTZZAyhBi8iWWDL5Ct9zoGju6d7jCO96Ztir ShZBd7unpwLmAPlc8o1HeKUeIuX3MX3GMe/6DEUDb05blRgMZNvsKq33KFWsK7eJ7hHF oEtJs/a/4RkiqiMn0lSZ22Q1438MgiJfyXQdUqtDcc/E/d9it70kkijzcNh+mpTDxiRQ 7zQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TuL8hgFVL4I8OOHJFG5/ip2YEave37hlRfmsC8L9xeQ=; b=QOpcsQpztVOJH4r50fevlP90QFsNlxmLK62WMvPg6jHvN90gEH07QzXnGmtx15eT2D CWxEDXtCp0sFk+C1QXbKAnjpub7BLntjYhM2ene5RHNqghLzFeWT7mvfrZmgXeF9/ap0 cKGqOg5d12eDHQ+AGGzi0EhLjubCbeSdnnPpaK0sXIBo+SXOy6CY5C9UFmTDL3a9pC0b fQFIIqDcLJ2GGkudiR9wYho6h06Jg8TlWdOxgxpRi7Cp4a61IVbs45RC61aow3BMjODW 20s1f2ohUsgg3F5ldf41fySpPqDmAfrJRPgFNV+S+VIkPa0G+Fi7U6HHtL3gm/faAIng 2c5Q== X-Gm-Message-State: AOAM531LX+vwvLYMMmnhIn47JYveNwRHeCPfmPfV9EHrFC+HClwMDeJ3 AxnM4lNeRdRzltvuy1vxwDQ= X-Received: by 2002:a05:6402:2da:: with SMTP id b26mr1092722edx.350.1610404332915; Mon, 11 Jan 2021 14:32:12 -0800 (PST) Received: from localhost.localdomain (ip5f5bfcff.dynamic.kabel-deutschland.de. [95.91.252.255]) by smtp.gmail.com with ESMTPSA id r18sm550154edx.41.2021.01.11.14.32.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 14:32:12 -0800 (PST) From: Bean Huo To: alim.akhtar@samsung.com, avri.altman@wdc.com, john.garry@huawei.com, jejb@linux.ibm.com, martin.petersen@oracle.com, ebiggers@google.com, satyat@google.com, shipujin.t@gmail.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Bean Huo Subject: [PATCH 1/2] scsi: hisi_sas: Remove unnecessary devm_kfree Date: Mon, 11 Jan 2021 23:32:01 +0100 Message-Id: <20210111223202.26369-2-huobean@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210111223202.26369-1-huobean@gmail.com> References: <20210111223202.26369-1-huobean@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bean Huo The memory allocated with devm_kzalloc() is freed automatically no need to explicitly call devm_kfree. Signed-off-by: Bean Huo --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 91a7286e8102..9e590f5f1a6b 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -4172,30 +4172,6 @@ static void debugfs_work_handler_v3_hw(struct work_struct *work) hisi_hba->debugfs_dump_index++; } -static void debugfs_release_v3_hw(struct hisi_hba *hisi_hba, int dump_index) -{ - struct device *dev = hisi_hba->dev; - int i; - - devm_kfree(dev, hisi_hba->debugfs_iost_cache[dump_index].cache); - devm_kfree(dev, hisi_hba->debugfs_itct_cache[dump_index].cache); - devm_kfree(dev, hisi_hba->debugfs_iost[dump_index].iost); - devm_kfree(dev, hisi_hba->debugfs_itct[dump_index].itct); - - for (i = 0; i < hisi_hba->queue_count; i++) - devm_kfree(dev, hisi_hba->debugfs_dq[dump_index][i].hdr); - - for (i = 0; i < hisi_hba->queue_count; i++) - devm_kfree(dev, - hisi_hba->debugfs_cq[dump_index][i].complete_hdr); - - for (i = 0; i < DEBUGFS_REGS_NUM; i++) - devm_kfree(dev, hisi_hba->debugfs_regs[dump_index][i].data); - - for (i = 0; i < hisi_hba->n_phy; i++) - devm_kfree(dev, hisi_hba->debugfs_port_reg[dump_index][i].data); -} - static const struct hisi_sas_debugfs_reg *debugfs_reg_array_v3_hw[DEBUGFS_REGS_NUM] = { [DEBUGFS_GLOBAL] = &debugfs_global_reg, [DEBUGFS_AXI] = &debugfs_axi_reg, @@ -4286,8 +4262,6 @@ static int debugfs_alloc_v3_hw(struct hisi_hba *hisi_hba, int dump_index) return 0; fail: - for (i = 0; i < hisi_sas_debugfs_dump_count; i++) - debugfs_release_v3_hw(hisi_hba, i); return -ENOMEM; } -- 2.17.1