From patchwork Tue Nov 7 09:40:02 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: 118131 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3757348qgn; Tue, 7 Nov 2017 01:40:53 -0800 (PST) X-Google-Smtp-Source: ABhQp+QbwdUgJ7KQWpUMcgLgpXqrYZrsovKNiKaBo9WA1McDa4jC9jNPhlof4KJ97X2GH10yQWYk X-Received: by 10.84.135.129 with SMTP id 1mr17932319plj.47.1510047653085; Tue, 07 Nov 2017 01:40:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510047653; cv=none; d=google.com; s=arc-20160816; b=Vf56Sqsgkwl53YjZo4aJpP+zGlzdavMRSpxtzNwNklnEcbwAw3owcvirdpDjI6zbHJ +XSNzGG76YnU49s+XWI7P2Eusa6DhfI143abCJqXMlxniEi9FFc2q3Xr0uUABe/lUNhK 5ClbUwbsZC+RRfo5XzGuXYrE6X+2dX/kFkmDYg7o2eYBTJ+vKqiN6PZD0MTpP5CNWGtc TepsmeuIBW4GL6PYh4pmMAcQmC/Rgwj7MoCyZ8am/N0WFYBwZLEcAcHyCXqwcHH6fbtJ bQhUihiCBvBEfz9bY4BLJRlDVs8NXox1K0BP3HSCMjF8ippn5G355xrEKa3LYGlj9BeU 68dA== 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=YItL5lA/4UlmIGPUCeUwJOAROqDY269Be/++Vu+EztjPCO0RDA1oxAt8uXBNRqJxLn LDgFJkTbXlIDVlaLC29Vf9GQhq7DxnhLXAVHlQ4tbHBJNE5egNnCou50/PuPGJG/a+t+ r7xg/w9SAzIHTYUPV8Ih+cLKRKsbTmRmdPsL8wtuUzSBmnDGASOpW5A+vVsgmRERdBVi t766dzStcBVjw/RxNlULybzIqfM2gp7msd6afznkhLNQmrBYSvpkRHJyKPDSlasf20JL VTj3dNWqaLAt8s/if6Nwzc079664ycGXC1dKIkRTAkaR5Dheh6LVEvHJ0jm3VTeh/u6X D5QA== 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 33si730228plk.555.2017.11.07.01.40.52; Tue, 07 Nov 2017 01:40:53 -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 S1756761AbdKGJks (ORCPT + 26 others); Tue, 7 Nov 2017 04:40:48 -0500 Received: from foss.arm.com ([217.140.101.70]:46396 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752717AbdKGJko (ORCPT ); Tue, 7 Nov 2017 04:40:44 -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 C60171435; Tue, 7 Nov 2017 01:40:43 -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 1B4343F220; Tue, 7 Nov 2017 01:40:41 -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 6/8] staging: ccree: simplify pm manager using local var Date: Tue, 7 Nov 2017 09:40:02 +0000 Message-Id: <1510047606-5589-7-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510047606-5589-1-git-send-email-gilad@benyossef.com> References: <1510047606-5589-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 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 {