From patchwork Tue Dec 12 14:53:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 121542 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4225148qgn; Tue, 12 Dec 2017 06:56:48 -0800 (PST) X-Google-Smtp-Source: ACJfBouiv6aZrNrWuy46rwh4+Hl9S8UUNhVLLSahqUTTHxmxoQZ7K7ytrOsMUjeg1eCBrQpG0mDf X-Received: by 10.98.80.208 with SMTP id g77mr2566701pfj.201.1513090608166; Tue, 12 Dec 2017 06:56:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513090608; cv=none; d=google.com; s=arc-20160816; b=foHeoqzUtqa1Pr9RhZHpXdAY6vZC2WjMIF3Z1nvqmzTbcCfEZZqvoDqMSQmR7ZnT9n 5sLHW3gHWlwGnR5jcPSMJyUrbID7SmFbpx3V4k2pIt8iCzoGbYrUjQ0G+3KgdkR7AGBS GGUzdQPSY6EtZRYlVZ1vxkm3Bl39Sokx/tJB3GXXrXEDq5jF5C3G8QzJu7NREx4MtNLa 56dvC1Sv9cgVIUUxoCt+GgCPsXzOmKtCRrcR/RVYc8MkXPmakqQtDDhSTmSh/wgLy37E kP2uMHskQYOq7QQhKDG+waSxx7dv738I5i55PKgBo2546YyKuwFc/GgvSDEBz+xVf2mG I2Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=MFyZdE3K7Ju4o1Bucl/9h5i8dTHt/jVRz80s7esjIdM=; b=uF7VPBFkVi9ZvNOHjQ8aAfiPxk+J/Ji68JAZqFT0zdsFGnknS2php3kI4HaSf2/txW gVj/isUuXZW7SzqRh2wpfiqsCDvQSBxigAtzhFFeTNpxvkxroOF4bzN3DAv1uQkSrbue bDGOYTCkkU/ANqHXQSNntx2bAD9Bj31p6WCvLW1RYOVk5Gvm0ptxsQ+BPZRBOKrK6xNH MXZpHDO2ZqWoXrhUgr7FprUZ60SaQn3y9KKeBdNspgGPXSiF5b7WB1m+k3/r41BRjmkD +MpItn3RK7ZOHsW6AWrORaBFJSeEwU9k+C7wmIIxov7pr9G/nBasnmwYFBIU4PsTndF9 NEew== 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 d3si11534267pgq.709.2017.12.12.06.56.47; Tue, 12 Dec 2017 06:56:48 -0800 (PST) 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 S1753128AbdLLO4o (ORCPT + 11 others); Tue, 12 Dec 2017 09:56:44 -0500 Received: from foss.arm.com ([217.140.101.70]:45258 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752306AbdLLO4l (ORCPT ); Tue, 12 Dec 2017 09:56:41 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C40E01529; Tue, 12 Dec 2017 06:56:40 -0800 (PST) Received: from sugar.kfn.arm.com (unknown [10.45.48.196]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1FA4A3F318; Tue, 12 Dec 2017 06:56:37 -0800 (PST) From: Gilad Ben-Yossef To: Greg Kroah-Hartman Cc: Ofir Drang , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 23/24] staging: ccree: simplify freeing SRAM memory address Date: Tue, 12 Dec 2017 14:53:09 +0000 Message-Id: <1513090395-7938-24-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513090395-7938-1-git-send-email-gilad@benyossef.com> References: <1513090395-7938-1-git-send-email-gilad@benyossef.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The code freeing the SRAM memory address was zeroing the address on release although there is nothing secret about it. Simplify the code by simply calling kfree directly. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_sram_mgr.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/staging/ccree/ssi_sram_mgr.c b/drivers/staging/ccree/ssi_sram_mgr.c index b664e9b..f72d64a 100644 --- a/drivers/staging/ccree/ssi_sram_mgr.c +++ b/drivers/staging/ccree/ssi_sram_mgr.c @@ -32,13 +32,8 @@ struct cc_sram_ctx { */ void cc_sram_mgr_fini(struct cc_drvdata *drvdata) { - struct cc_sram_ctx *smgr_ctx = drvdata->sram_mgr_handle; - /* Free "this" context */ - if (smgr_ctx) { - memset(smgr_ctx, 0, sizeof(struct cc_sram_ctx)); - kfree(smgr_ctx); - } + kfree(drvdata->sram_mgr_handle); } /**