Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4468049ybi; Mon, 15 Jul 2019 09:20:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxffumCrRH7ySSDr6lsVusetilBb9vfaulECPpgtL5DzDqvkf+iyEWp/mHKyr0sDpJdeVu2 X-Received: by 2002:a17:90a:2768:: with SMTP id o95mr30099287pje.37.1563207649697; Mon, 15 Jul 2019 09:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563207649; cv=none; d=google.com; s=arc-20160816; b=B380D0Wn9PlejtorOSW2oYMUzYN5QqcZy+D1+pUDwlFhQHiiGoGcCFbN+T3F7aKaV3 ohFr2UpqRywyya8QI7kqKzGgZORhAT1fXMFxhgUZIbBRXNOscE+7ZaClJbspcD4kiOag Qr9xOwpy9Wis7+d/M5VV6KEORkkRHxgmF7e742ql01JNvYgJE005fPk7URLg6I5pPZau XY0u6D5RGNmkWftI4vmgK4fAxe1Nc1c+Ox9/xJcLW1rsyP8wTPFefH9AidmxMaqTahdK /cKKLfkDL/hya/HDWY5EmAUHtRKWXB8joQns/beF/AiIr0uY7LpMC+8YnN+ONct9gOpX DnXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ynSIn8ZCqN1VPeaW/dGI1ybkuIDnGKn02iSRWw8L+LM=; b=lq6I8DKq21H+m+r35X5gws8rN5glXl3zUQwLCkfS8EvRJ2XrFaFTZIZT4utCoWIls+ jWDKWuEyFXIhKCK6SEl8YKvmmI5AZHVattSb/BTOWbMvUyUsBcd9cWxb1cFbp1zJB9fN aOPrpeNrETKBt5knh/htXCsDHIrr+Jvo+vIMKF5x8FdGQuNLYSV84aKIGiCs/UJzQQwr zcsp9KZANSmF1IbVHAc7aD9QAdEbdXIJ0h/gyz1RMOo1nwMyXEih5x0iG8vO8atDFDoM WWppKTgMDJFsYYQ2JLDcEBHRjU96ZzVhgFFiUPVQRG2Ndt1Vqwq4OlZfKaKjpHKXOCUw 4tOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=goSm3rbb; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h69si17240080pge.543.2019.07.15.09.20.32; Mon, 15 Jul 2019 09:20:49 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=goSm3rbb; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730503AbfGOQT6 (ORCPT + 99 others); Mon, 15 Jul 2019 12:19:58 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39774 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729533AbfGOQT5 (ORCPT ); Mon, 15 Jul 2019 12:19:57 -0400 Received: by mail-wr1-f67.google.com with SMTP id x4so17748424wrt.6 for ; Mon, 15 Jul 2019 09:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ynSIn8ZCqN1VPeaW/dGI1ybkuIDnGKn02iSRWw8L+LM=; b=goSm3rbbAg46n2BLSir9rsd3hIsrDJ2GPW58Q7tOSuINWkknY8W/hgybyA/eWMZh7t jmNoST5BX3A/vVV6NlGWWuKPJxQO7jAhuI5Ia/M+V/OzV0lF6Yb3LePSC+XIz0UCE4d1 k2vIEGj1cUwBsaNz0vbYbXQxiU+OEWmvGR79qECsINHgnNTYshRxdrtBs6ykIn0YW47E n5PxabZ6EmdiT85hpzPS8xdsgLDxAsBvhzsu+nKlL20uU/CYaY4Ezl2YtwgPFl+oj5r1 Y53xWN18Pq1kAWTk/ekSPNfq7yml/r3PkbCdTx0s59FM2VO+HStCvaTmmk/UrpcqgzPe 409A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ynSIn8ZCqN1VPeaW/dGI1ybkuIDnGKn02iSRWw8L+LM=; b=bk6DYBeWLfbP0zTpPNukR5sK1gxg9YAnFT352zQ64YzO6r/kCpaJCyNzp2yy1aPRv/ ZPcrkRen91YkYkZQu4XOFaK4t9IF3hAiwFM6t1KxSo4G/GfA6CdlRIO+TkzcR1dD0UMq iEC0W/+ZD/G4Gry6av7ENu/MxfiCVS4TZaeRe1lri8SkZ2Ko5JwECR0uBHa6wRhwy9xp WiEkj1jkJ95Z7qDxiN/Cxsq8fveN7aRuIuQtu6Ml1p3O0ueuCa3d9/+aH7sof3EGknkV GWNfOgMRsK5HbMPS+qnNPmxmNKiURAqZWVGu5GuAvMO5ObEVAQ7vgKFNl6KtlgaBwwHP CryA== X-Gm-Message-State: APjAAAVaVC77A+DIo2VXx0aYgn7SjQ+SEd7cMKArmR43txNa2eXhMetB BtOK0oQNaobePIFUh2n3MgB9RBITrXL8YS4UYn8= X-Received: by 2002:a5d:6ccd:: with SMTP id c13mr25204311wrc.4.1563207594882; Mon, 15 Jul 2019 09:19:54 -0700 (PDT) MIME-Version: 1.0 References: <20190715031731.6421-1-huangfq.daxian@gmail.com> In-Reply-To: <20190715031731.6421-1-huangfq.daxian@gmail.com> From: Alex Deucher Date: Mon, 15 Jul 2019 12:19:43 -0400 Message-ID: Subject: Re: [PATCH v3 05/24] drm/amdgpu: remove memset after kzalloc To: Fuqian Huang Cc: Leo Li , Rex Zhu , LKML , amd-gfx list , David Airlie , Maling list - DRI developers , Alex Deucher , Evan Quan , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 15, 2019 at 3:57 AM Fuqian Huang wrote: > > kzalloc has already zeroed the memory during the allocation. > So memset is unneeded. > > Signed-off-by: Fuqian Huang Applied. thanks! Alex > --- > Changes in v3: > - Fix subject prefix: gpu/drm -> drm/amdgpu > > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 2 -- > drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c | 2 -- > drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c | 2 -- > drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c | 2 -- > drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c | 2 -- > 5 files changed, 10 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c > index fd22b4474dbf..4e6da61d1a93 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c > @@ -279,8 +279,6 @@ void *amdgpu_dm_irq_register_interrupt(struct amdgpu_device *adev, > return DAL_INVALID_IRQ_HANDLER_IDX; > } > > - memset(handler_data, 0, sizeof(*handler_data)); > - > init_handler_common_data(handler_data, ih, handler_args, &adev->dm); > > irq_source = int_params->irq_source; > diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c > index 1cd5a8b5cdc1..b760f95e7fa7 100644 > --- a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c > +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c > @@ -1067,8 +1067,6 @@ static int pp_tables_v1_0_initialize(struct pp_hwmgr *hwmgr) > PP_ASSERT_WITH_CODE((NULL != hwmgr->pptable), > "Failed to allocate hwmgr->pptable!", return -ENOMEM); > > - memset(hwmgr->pptable, 0x00, sizeof(struct phm_ppt_v1_information)); > - > powerplay_table = get_powerplay_table(hwmgr); > > PP_ASSERT_WITH_CODE((NULL != powerplay_table), > diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c > index 669bd0c2a16c..d55e264c5df5 100644 > --- a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c > +++ b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c > @@ -2702,8 +2702,6 @@ static int ci_initialize_mc_reg_table(struct pp_hwmgr *hwmgr) > cgs_write_register(hwmgr->device, mmMC_SEQ_PMG_CMD_MRS2_LP, cgs_read_register(hwmgr->device, mmMC_PMG_CMD_MRS2)); > cgs_write_register(hwmgr->device, mmMC_SEQ_WR_CTL_2_LP, cgs_read_register(hwmgr->device, mmMC_SEQ_WR_CTL_2)); > > - memset(table, 0x00, sizeof(pp_atomctrl_mc_reg_table)); > - > result = atomctrl_initialize_mc_reg_table(hwmgr, module_index, table); > > if (0 == result) > diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c > index 375ccf6ff5f2..c123b4d9c621 100644 > --- a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c > +++ b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c > @@ -2631,8 +2631,6 @@ static int iceland_initialize_mc_reg_table(struct pp_hwmgr *hwmgr) > cgs_write_register(hwmgr->device, mmMC_SEQ_PMG_CMD_MRS2_LP, cgs_read_register(hwmgr->device, mmMC_PMG_CMD_MRS2)); > cgs_write_register(hwmgr->device, mmMC_SEQ_WR_CTL_2_LP, cgs_read_register(hwmgr->device, mmMC_SEQ_WR_CTL_2)); > > - memset(table, 0x00, sizeof(pp_atomctrl_mc_reg_table)); > - > result = atomctrl_initialize_mc_reg_table(hwmgr, module_index, table); > > if (0 == result) > diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c > index 3ed6c5f1e5cf..60462c7211e3 100644 > --- a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c > +++ b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c > @@ -3114,8 +3114,6 @@ static int tonga_initialize_mc_reg_table(struct pp_hwmgr *hwmgr) > cgs_write_register(hwmgr->device, mmMC_SEQ_WR_CTL_2_LP, > cgs_read_register(hwmgr->device, mmMC_SEQ_WR_CTL_2)); > > - memset(table, 0x00, sizeof(pp_atomctrl_mc_reg_table)); > - > result = atomctrl_initialize_mc_reg_table(hwmgr, module_index, table); > > if (!result) > -- > 2.11.0 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel