diff mbox series

[resend,04/12] soc: qcom: smem: small refactor in qcom_smem_enumerate_partitions()

Message ID 20180626005856.14174-5-elder@linaro.org
State Accepted
Commit eb68cf09092233716b31fad42cf2a4dad3959e3c
Headers show
Series [resend,01/12] soc: qcom: smem: rename variable in qcom_smem_get_global() | expand

Commit Message

Alex Elder June 26, 2018, 12:58 a.m. UTC
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 <elder@linaro.org>

---
 drivers/soc/qcom/smem.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

-- 
2.17.1
diff mbox series

Patch

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,