From patchwork Thu Nov 9 09:16:14 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: 118411 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp6344374qgn; Thu, 9 Nov 2017 01:15:14 -0800 (PST) X-Google-Smtp-Source: ABhQp+QCFLcWV5SuRGrqycGD5oH4XfxHq94NCCtWbv3ns8Pxd51o2v/WLXXcjiTKtWjJvX92ccp9 X-Received: by 10.98.148.9 with SMTP id m9mr3456823pfe.111.1510218914824; Thu, 09 Nov 2017 01:15:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510218914; cv=none; d=google.com; s=arc-20160816; b=PsdERu7PROkwx+QwS5Yc41r95ey5wm7kjFBO4MjaG28LsRmwFMQGIvom0Aj2COixQ/ L38M11mSV8iCE81zz3KJoxLe8Lpe4UKipl6pqOOuiCO9CnI6IYJO6QrPSXR5PJuvqD1j fI0Z+d00GEjUFQOuUPIeLhJi1aSU7xIqpArkfn2Mu4kqcZMJxU3W6VxOCLUvBIFgOZrL 9nFyGG7YWz6mdp57JYXNQyFhzUCt7CotRocVFlrRjPOBC49rL1ZoXGMkfNdm7Pz4r9nN 0PrsdHsBjeK3T91ysGU4erxr3JrYuPErNAVurpBbvPmYlmBbNyqGVl5dzm2s9GVo5Rv6 zGCg== 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=GTB4uaVilaXQ8BJ0gvLqJkMxmPlJ5KsuzDOPJMo3NCA=; b=MdUB3w6o1WiV7TJ/CWsw1SVZrxBWBFMqOmWp1AWWZVYUvtZU/137HuCJdkwXP+AuK8 Jxonwf7ODYYs05Zd7xZ88FMNpReas06qCBmSFs+/hxoptK4qhdLJKB6y0rcs3hnE66QZ 7N6FXxIfKNPDtaBEm2IsRw/2RKmAP87OQAkLbmBfRLdhcaq7azswnVoVvB2/K5NF2Y0U 88p+9qeYlQsOf+N0Jr9/LbwgQ7VfeiEi4C+bTLfoUDwZLuMQM/vuL0Ch0g/mPCMSAPkS HIz4hh7p0R1EKeev8mHMZwXGf0rPQXXs6RDdl4L/bPaZagptRKk05DZH/zBf2wBbI3m9 o2eQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 p189si4410212pfp.296.2017.11.09.01.15.14; Thu, 09 Nov 2017 01:15:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753816AbdKIJPL (ORCPT + 1 other); Thu, 9 Nov 2017 04:15:11 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:43636 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753977AbdKIJL3 (ORCPT ); Thu, 9 Nov 2017 04:11:29 -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 E9F9C1596; Thu, 9 Nov 2017 01:11:28 -0800 (PST) Received: from sugar.kfn.arm.com (unknown [10.45.48.162]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3A66F3F246; Thu, 9 Nov 2017 01:11:27 -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 v2 06/10] staging: ccree: simplify pm manager using local var Date: Thu, 9 Nov 2017 09:16:14 +0000 Message-Id: <1510218980-3549-7-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510218980-3549-1-git-send-email-gilad@benyossef.com> References: <1510218980-3549-1-git-send-email-gilad@benyossef.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Make the code more readable by using a local variable. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_pm.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/drivers/staging/ccree/ssi_pm.c b/drivers/staging/ccree/ssi_pm.c index e1bc4c5..d60143c 100644 --- a/drivers/staging/ccree/ssi_pm.c +++ b/drivers/staging/ccree/ssi_pm.c @@ -90,20 +90,24 @@ int cc_pm_resume(struct device *dev) int cc_pm_get(struct device *dev) { int rc = 0; + struct ssi_drvdata *drvdata = + (struct ssi_drvdata *)dev_get_drvdata(dev); - if (cc_req_queue_suspended((struct ssi_drvdata *)dev_get_drvdata(dev))) { + if (cc_req_queue_suspended(drvdata)) rc = pm_runtime_get_sync(dev); - } else { + else pm_runtime_get_noresume(dev); - } + return rc; } int cc_pm_put_suspend(struct device *dev) { int rc = 0; + struct ssi_drvdata *drvdata = + (struct ssi_drvdata *)dev_get_drvdata(dev); - if (!cc_req_queue_suspended((struct ssi_drvdata *)dev_get_drvdata(dev))) { + if (!cc_req_queue_suspended(drvdata)) { pm_runtime_mark_last_busy(dev); rc = pm_runtime_put_autosuspend(dev); } else {