From patchwork Tue Jun 26 00:58:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 139904 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4616999lji; Mon, 25 Jun 2018 18:00:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJWFD4sFrS4sBnMiVUv/DzEdNGylH+Zm1bC5nYRnxzUs2IaxDbdXQTnDFzCD9tC0cgeVYgE X-Received: by 2002:a63:2c9:: with SMTP id 192-v6mr12741741pgc.354.1529974854588; Mon, 25 Jun 2018 18:00:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529974854; cv=none; d=google.com; s=arc-20160816; b=QT+2L3GlH2u2aYgSEXeRBqXIXtzP3xWdaeDagfZkE9mzKOnynfUEVsRrYS6ICObP2D 95oDy6nZg1m6VAfNjLCCr4tyxSamtgrfXQodw3q2M6piFGKfgSIwIWhZuaiYlCYSTLIX JklQmPw3UjJ/J5XI+fWoqbJ1qrBwkfJt+hEeANgFxEXNy8f7GgDHmmrvoCXaILnik178 nqSz5Pd0l+oQMPepNL+m6eAJOCqv8n4hqFfsltpv2RQzHhkVKXJeCAU2bmor0K51cPtT mPwATayR+Mu01zKWGBWXbSpg1HbC7LnXu6shc9xHSB+741x8vqtaxPPF879KC5/klFDv wsiw== 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:dkim-signature:arc-authentication-results; bh=xNjMY2VoPRCAGDy/phZ/JtqeH0mk6bVlwd6yiC6mUcw=; b=gbas4d6IgAcTWL7azqrwSCyN2hrz7WvRgPnan0W9+Wj/7jGk7osTXBrMvDs+3KaQHN arIDE8r4PhROCZ/y7pe816rK80K0EA6mQ4dizDFKgrb7T28SqvOnS3U3JopEIPKepGI9 KohIoy07jO7CPeE2DhpGEP5NLoBpb/yeB4HAkNTSUlbm19v9AlFL/3h3exzpfuJAfvCL A882DgSrLrqRhs5r2N1CqOHK1chjG8OxuNB4ZaArLu/sa58YtJJHzmKGHiUiVFh2DBDI vEI2AAo8oZON336EpNMN1RUxI3UxurOmGtCDWlm2YfoWrk2C2ELdMYTwHfFl3aOhRGDL ubkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X2Nc5gN0; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g17-v6si310563plo.355.2018.06.25.18.00.54; Mon, 25 Jun 2018 18:00:54 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=X2Nc5gN0; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935231AbeFZBAw (ORCPT + 31 others); Mon, 25 Jun 2018 21:00:52 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:39458 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755801AbeFZA7G (ORCPT ); Mon, 25 Jun 2018 20:59:06 -0400 Received: by mail-it0-f68.google.com with SMTP id p185-v6so15059873itp.4 for ; Mon, 25 Jun 2018 17:59:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xNjMY2VoPRCAGDy/phZ/JtqeH0mk6bVlwd6yiC6mUcw=; b=X2Nc5gN0Ie6Lz6LS2EKGw2QKVyjqLyVqFUvlAB4YdQnr+cFTwwMM/U6wN/LX4rjovU 9RseU3tIKf2Y8J1zmA3oXW92xMKq9n0zof9KJuLlDcO3TXETdTc0uSzNaB1T4A8znDRT H6Goj/98dlxq5YH1piwJ9kEZ5smGfYww/1xe4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xNjMY2VoPRCAGDy/phZ/JtqeH0mk6bVlwd6yiC6mUcw=; b=BcIBsf0GjhhfTALxmpo9Okd0jBwlg7fff2H01BVQKMVjPaIEE4NRhy41Ma1xmcT6Co LYX0w+9/LNph7pFJ5qP7bSn4g87UJ81vI8w5PYffhku/CMWdUu1g7vOrE+ZowfnL+e8v 8446Dv4v4lIqgtzyGw6JnnMIkSRQ9kDdqgdz/JLHHK2U6vFMOXEoLd1veLCPCTlxeDmZ oqs7xwTWoxAzHxr8BZ+xQs8h8VGLMf8rEGSt2wH7V0i1aqh3CAakeG4wvrbeqYS+DHCZ tFgNrHK7g3TCkth3e3ubzD/V/EJjAnFilK75i9twBpgOYM55MVRzc29usY7IkFs6ltoh P2zg== X-Gm-Message-State: APt69E1RswXRN0pgpiWs/GxqlQg6l7Ttmi7uY1fRAI5Cdy+7NrPUt8qM gZWIjXE2JonvNdIqNqR2vtBrdg== X-Received: by 2002:a24:c054:: with SMTP id u81-v6mr2664109itf.94.1529974745230; Mon, 25 Jun 2018 17:59:05 -0700 (PDT) Received: from localhost.localdomain (c-71-195-29-92.hsd1.mn.comcast.net. [71.195.29.92]) by smtp.gmail.com with ESMTPSA id f193-v6sm372556itf.9.2018.06.25.17.59.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 17:59:04 -0700 (PDT) From: Alex Elder To: andy.gross@linaro.org Cc: clew@codeaurora.org, aneela@codeaurora.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH resend 04/12] soc: qcom: smem: small refactor in qcom_smem_enumerate_partitions() Date: Mon, 25 Jun 2018 19:58:48 -0500 Message-Id: <20180626005856.14174-5-elder@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180626005856.14174-1-elder@linaro.org> References: <20180626005856.14174-1-elder@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Combine the code that checks whether a partition table entry is associated with the local host with the assignment of the remote host id value. Signed-off-by: Alex Elder --- drivers/soc/qcom/smem.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c index 83ba549cfea0..5d3ed510e54b 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -815,13 +815,12 @@ static int qcom_smem_enumerate_partitions(struct qcom_smem *smem, host0 = le16_to_cpu(entry->host0); host1 = le16_to_cpu(entry->host1); - if (host0 != local_host && host1 != local_host) - continue; - if (host0 == local_host) remote_host = host1; - else + else if (host1 == local_host) remote_host = host0; + else + continue; if (remote_host >= SMEM_HOST_COUNT) { dev_err(smem->dev,