Received: by 10.223.185.116 with SMTP id b49csp497375wrg; Wed, 14 Feb 2018 02:21:16 -0800 (PST) X-Google-Smtp-Source: AH8x224YpeOOv++OaCd8HCsX+DQpEqrB10netS0sZf0eO/fpOApA9n88XMJzwPNvPapFynXq12Ix X-Received: by 10.99.111.138 with SMTP id k132mr3507956pgc.414.1518603675949; Wed, 14 Feb 2018 02:21:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518603675; cv=none; d=google.com; s=arc-20160816; b=P6DZwSxDr3vh3xrwtxWmaSxbLV5mn6xAMjebtmfjgyhK9FqqRZcGBK5LobtsFjROKq 1UmEA1g/h9CER7A5iznVryOfHO318Of0buRPy6UHHvaABTVdMEOWxFgra6J6vl0NBHEt Glj4SGopmqybiRlQAfR1CJ5m6nfUW22LtCtcTL2EgZO2pWU9Zb8avGo0asrDTakgdo2t Ed0bc/KF4BxApjLLhPpNOPiyhOwZBUroIKlFFrd4Hm0eB8zZ5GC9oRz5THbBgxXeb3Ka haXch+tyrDpDKaKsPCtGMG+5ZGwjTIjZnM0SJPv3gnzEVdiCMiueGR8RfbdjXjIWxFRN EczA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:arc-authentication-results; bh=4kmnuvWYqrvXa7RXOEAjN0QvMs8Wqvf996XqTzSK5bo=; b=oHl8mscts8Lu4Qnk+ORhAHKryToZ6BdqX1u+xNfK/Sfa0oMZzGdzN+eg7A2vTj8fex r2K+NBkNodNz/iyjTEibgSCzWzGlsS2cGwHhbYgOKHF7ThoqupHP+ZwPeCn/Plu+u4kU ocQ8o58ivSBGaxPkk/PMXxie2mYpNi30iWyuOYyFv5030Wa+YreWpIIUK+28pjEYd7Z1 UFOcrUeJj7s80u0hyjuBhkQCFEoBDWElGjxptlKKiJuFt/07UxMUDra1mrklMJagd5nI 0Pqe8YltLPBt3HMIBwCnXQjD25PS1RHpsjon3QoLtY488L6qRZfVAsyoV0u1N36YwMAy Qqqg== 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4-v6si988443pln.655.2018.02.14.02.21.01; Wed, 14 Feb 2018 02:21:15 -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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967164AbeBNKT5 (ORCPT + 99 others); Wed, 14 Feb 2018 05:19:57 -0500 Received: from mout.web.de ([217.72.192.78]:46845 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966996AbeBNKTz (ORCPT ); Wed, 14 Feb 2018 05:19:55 -0500 Received: from [192.168.1.2] ([78.48.82.239]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MeSKR-1f9u0N0Qb1-00QBK2; Wed, 14 Feb 2018 11:19:44 +0100 Subject: [PATCH 2/4] crypto: ux500: Adjust two condition checks in ux500_cryp_probe() From: SF Markus Elfring To: linux-crypto@vger.kernel.org, "David S. Miller" , Geliang Tang , Herbert Xu Cc: LKML , kernel-janitors@vger.kernel.org References: <20dcb583-5455-b5b9-94df-db9d1e21931f@users.sourceforge.net> Message-ID: Date: Wed, 14 Feb 2018 11:19:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20dcb583-5455-b5b9-94df-db9d1e21931f@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:X1i36V9/ySxeNqGrbAhUyvLOYcEFoFEcQxx9Pm2sZj1PIt11vqN Ef34y8z7bYiKMlRu88XZ+BS4gfdxbK4y38nvWI0n1Ina+X8+I8xU8gz7b6dKS7B7QB36pDl c+/VK74epHU29TrIUDr6NowPFWX/4/ngFpCC5gzswXJi7L1gnD1m0Wj+aKWW5BKU7zQwcdM Pnu5jT80vpKkXX1pne2Kw== X-UI-Out-Filterresults: notjunk:1;V01:K0:gbo1eNjzl7w=:qHl0Os8J54/BLXigrOMyWu ypqPRMeWnJGl6MB3Pwwb4s0ino/tBMTGgseri3FG62ZZcXsRTljggAr+wiiPh0p37sBQhnx4n +ZEb9fMOtW7nTSlpaDG92YvUrxpYHUm771YS+vctfkIIVYRG+6UKy+Z+4NdRbcZL4be8z2mqS MwOu+z5r7olV44Riq1zZscJCJODNTqvFStpHp/cAsZvUD7z52zunxy9ULo/+vgSAsCJ0quUDU 2puXo9bALuS/QqJ01VFSCfJNwRlHVfMqtQVM+T8Drs9gaZ6na1wKfDKfm1MIevMyAbaTtAh7Q SWHiNrlSn5XdopWHZruWzc1LyDHmVvJxvg16BY7INrRuQUDj8IxSqc950IJqfN7iQNBHsQCI2 XTTrps8KxRHeWeFPDApj+GAM8IAZMChGcoicRv3Hjh8JP6wT8MrdTIEpnPTuGYigqz2qpyWjW W9d2RsBiOGSufA0PqrdD6TJ7wzie2dJS4e+Hi9ZOSMwh604TdJ26jQZUsus+OgrvaKFb6ShYR scCww5BwTE3133BwohTiQH1T0SQPTfbpMtTA7BefQdSg0jHEByNPh2IzU3lkQnaYhLoR3FUC1 iwChCpaLuvrNcRZGc0kegrqtZ3FWaoQc72zzKKuR2tjss6s1cAJAjRP4e5FFnPnVMx9WQW5ed c1QCXe9bl7HBib9ehVRxj2V/EYGYafW/ThUKJ0kvblTD/6j3XDyC1JKqcOk8ia+yUXoxnsmy+ GEySWivISbcLqzgw+4l5wztSTjBZTw/lF2y509USU5e3DF9x6iIkTLadthb2OwBJ3Agsqa50E rIVPV+HH+LlbnjYay/wS/aO0JeW5RFY6B+6QhVpCTvNrwiDzAY= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Wed, 14 Feb 2018 10:38:44 +0100 The local variable "cryp_error" was used only for two condition checks. * Check the return values from these function calls directly instead. * Delete this variable which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- drivers/crypto/ux500/cryp/cryp_core.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c index 50bfc7b4c641..07cc92f88933 100644 --- a/drivers/crypto/ux500/cryp/cryp_core.c +++ b/drivers/crypto/ux500/cryp/cryp_core.c @@ -1404,7 +1404,6 @@ static void cryp_algs_unregister_all(void) static int ux500_cryp_probe(struct platform_device *pdev) { int ret; - int cryp_error = 0; struct resource *res = NULL; struct resource *res_irq = NULL; struct cryp_device_data *device_data; @@ -1478,15 +1477,13 @@ static int ux500_cryp_probe(struct platform_device *pdev) goto out_clk_unprepare; } - cryp_error = cryp_check(device_data); - if (cryp_error != 0) { + if (cryp_check(device_data)) { dev_err(dev, "[%s]: cryp_init() failed!", __func__); ret = -EINVAL; goto out_power; } - cryp_error = cryp_configure_protection(device_data, &prot); - if (cryp_error != 0) { + if (cryp_configure_protection(device_data, &prot)) { dev_err(dev, "[%s]: cryp_configure_protection() failed!", __func__); ret = -EINVAL; -- 2.16.1