Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3474952pxk; Mon, 21 Sep 2020 14:57:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPRNF/qIP4z1QJt6QDXNex8H2iiFtM2rPnwY+uKxHRbd/djRQMpC/yO8al1MvOLp9jOT5R X-Received: by 2002:a17:906:8695:: with SMTP id g21mr1566550ejx.504.1600725425712; Mon, 21 Sep 2020 14:57:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600725425; cv=none; d=google.com; s=arc-20160816; b=NaoVOtElyX1vwU9Hbh4kEIWX+xb+b9cCtI2VeowJoNPcK3ce9Lm/WTaM++cJK1Dvtr e63H7vDGq+CKKI2k3xVW7VsPbUgWT1QZcSpD0Z86Rb5OrrQI4Ei7+8s4kiE1T9d6c+Pl 8OAL8zYjo8cRBpUjt0GwtISUTWSWuU1UGiRMLHHlSaVZc8ohajUEJP43F+SUmAvGN7/D f50fYzC85/OQEMY/eJM3y6PAtoBbK/RA/VyumNO9HL6KRKqOkUWnMOeq3BWF4jW1DvUv iS7aW8ihQpIfsHKy1pIZ0JS7m8Vqy/wR2jF4gVokvIwPgvzTf01tO0kyvMxy3qkJnOl8 DAyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=msyTyBuqg+S9lSfyJBnZ2ellRZt6dmdc0yChx+UPxKo=; b=vRAgiwQdELfDNlHifp0+LmEdes0BAOpfFSqL312Ola6Y2wRrZvZJDSuJUF1JgB7ciX id/vT5HHpiW6IRDV3Puh3idRONuqATG4OsngLPef6DPV91rrnDSML4Z3kA8HhQDyu05g BI/s+2W3/s8W2Sv4DP7pAwBLJS02gC5lXrBKkcA5eco+xj8vCwOMnUS6HzTaC20spB/6 b6IdjeAf4mQgTS7dV2uBUkV8Yb3+jC924qA1gl6O2Ak25djPuZYkJ0SKWGfEkaT/On+P WM01UqQRKJkpyOHqTEtIs0PZ7nGCpgmMgyQS81GeG43T7Qy7fxUdtU9wFYZa27JrDH+8 Tmuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HFH4glgr; 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 dn22si10836506edb.516.2020.09.21.14.56.42; Mon, 21 Sep 2020 14:57:05 -0700 (PDT) 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=HFH4glgr; 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 S1728389AbgIUVzS (ORCPT + 99 others); Mon, 21 Sep 2020 17:55:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726497AbgIUVzS (ORCPT ); Mon, 21 Sep 2020 17:55:18 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4610C061755; Mon, 21 Sep 2020 14:55:17 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id g4so14557127wrs.5; Mon, 21 Sep 2020 14:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=msyTyBuqg+S9lSfyJBnZ2ellRZt6dmdc0yChx+UPxKo=; b=HFH4glgr8zU1oXfraHmc2FYWvCMnmC+sxpTG200tp8l4hHLtC2gqfDvnKD0jX5zr2A U5PhRmCeevGoZN4iO/TYhjFAeVRVZuRkZV1ZzuWxTULU9tmZiWKYwonAESXP4h8Q2Qnl zSv+jP4GyUUOh5sVzYtwl310G0yLz95w1/stZ0caQqlsdpwhdOrFYK2FnIyKgjsozSg9 ydKfCEzapSddN3N1jjAv3t+5HuJww9ZdL6qHb7NwUSc2y7jGzORTBRWQZMxPnt+Gk7WK L3ToJvGi3Jf2Bt0UrBVMuEcv+M0SlE85eYBk0AcyppjmfhH31CfTvNiLCvi77k8ClwCT F6uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=msyTyBuqg+S9lSfyJBnZ2ellRZt6dmdc0yChx+UPxKo=; b=sykyjqugr1bLr3QaM2J2+MPHtWKPkuYH/O5F3CFvx6fsremOsBZOMP7VtU+xFGWfh7 3o6KIa7Nvn1esKS2lvbR34qzVezmCpWpwELYVKQkJ9acWRBwxMAnKPSPfHxhzSw8dnZQ Rur8NwNyMXVrrwX4U4G2ORdtxk7MXCLkhGQgNRyGQJqWSb5p2MddXFTgm7zRcv7MuwYA nv84Ur1xW0MLsFP6KeSjLdjwdXLravAFxTkiPM9U83AGtSrHqqqnyKdTQNKQeWsP26nM hqaLEtNfJTaAIC5re5F9vzXgxjRHeuUNc2QdneO4mAryvjWyNisw49gjKqPH4GlLMsd9 ibrQ== X-Gm-Message-State: AOAM533Va8De6QN4OWRZ6ksUCI8avm1tQhyBd5KXo0ZqRDxr52Iw3Hch hAtCirLorcnMMe1TZiKiiXQ= X-Received: by 2002:adf:e7c4:: with SMTP id e4mr1786175wrn.113.1600725316622; Mon, 21 Sep 2020 14:55:16 -0700 (PDT) Received: from localhost.localdomain (cpc83661-brig20-2-0-cust443.3-3.cable.virginm.net. [82.28.105.188]) by smtp.gmail.com with ESMTPSA id t124sm1282200wmg.31.2020.09.21.14.55.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2020 14:55:16 -0700 (PDT) From: Alex Dewar To: Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Alex Dewar , Dan Carpenter , Linus Walleij , Alan Cox , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND 3/5] staging: media: atomisp: Don't do unnecessary zeroing of memory Date: Mon, 21 Sep 2020 22:53:55 +0100 Message-Id: <20200921215359.45003-4-alex.dewar90@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921215359.45003-1-alex.dewar90@gmail.com> References: <20200921215359.45003-1-alex.dewar90@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In a few places in pci/sh_css_params.c, memset is used to zero memory immediately before it is freed. As none of these structs appear to contain sensitive information, just remove the calls to memset. Suggested-by: Dan Carpenter Signed-off-by: Alex Dewar --- drivers/staging/media/atomisp/pci/sh_css_params.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c b/drivers/staging/media/atomisp/pci/sh_css_params.c index 2c67c23b3700..24fc497bd491 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_params.c +++ b/drivers/staging/media/atomisp/pci/sh_css_params.c @@ -4378,7 +4378,6 @@ ia_css_3a_statistics_free(struct ia_css_3a_statistics *me) if (me) { kvfree(me->rgby_data); kvfree(me->data); - memset(me, 0, sizeof(struct ia_css_3a_statistics)); kvfree(me); } } @@ -4417,7 +4416,6 @@ ia_css_dvs_statistics_free(struct ia_css_dvs_statistics *me) if (me) { kvfree(me->hor_proj); kvfree(me->ver_proj); - memset(me, 0, sizeof(struct ia_css_dvs_statistics)); kvfree(me); } } @@ -4459,7 +4457,6 @@ ia_css_dvs_coefficients_free(struct ia_css_dvs_coefficients *me) if (me) { kvfree(me->hor_coefs); kvfree(me->ver_coefs); - memset(me, 0, sizeof(struct ia_css_dvs_coefficients)); kvfree(me); } } @@ -4551,7 +4548,6 @@ ia_css_dvs2_statistics_free(struct ia_css_dvs2_statistics *me) kvfree(me->ver_prod.odd_imag); kvfree(me->ver_prod.even_real); kvfree(me->ver_prod.even_imag); - memset(me, 0, sizeof(struct ia_css_dvs2_statistics)); kvfree(me); } } @@ -4635,7 +4631,6 @@ ia_css_dvs2_coefficients_free(struct ia_css_dvs2_coefficients *me) kvfree(me->ver_coefs.odd_imag); kvfree(me->ver_coefs.even_real); kvfree(me->ver_coefs.even_imag); - memset(me, 0, sizeof(struct ia_css_dvs2_coefficients)); kvfree(me); } } @@ -4710,7 +4705,6 @@ ia_css_dvs2_6axis_config_free(struct ia_css_dvs_6axis_config *dvs_6axis_config) kvfree(dvs_6axis_config->ycoords_y); kvfree(dvs_6axis_config->xcoords_uv); kvfree(dvs_6axis_config->ycoords_uv); - memset(dvs_6axis_config, 0, sizeof(struct ia_css_dvs_6axis_config)); kvfree(dvs_6axis_config); } } -- 2.28.0