lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 22 Nov 2018 11:42:13 -0500
From:   Yangtao Li <tiny.windzz@...il.com>
To:     thierry.reding@...il.com, jonathanh@...dia.com
Cc:     linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org,
        Yangtao Li <tiny.windzz@...il.com>
Subject: [PATCH] soc/tegra: optimize soc_is_tegra()

Use for() to rewrite the code.In addition,match->compatible[0]
is equal to *match->compatible,change it.

Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
---
 drivers/soc/tegra/common.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soc/tegra/common.c b/drivers/soc/tegra/common.c
index 54627ca957e8..521a201d9fff 100644
--- a/drivers/soc/tegra/common.c
+++ b/drivers/soc/tegra/common.c
@@ -24,11 +24,9 @@ bool soc_is_tegra(void)
 {
 	const struct of_device_id *match = tegra_machine_match;
 
-	while (match->compatible[0]) {
+	for (; *match->compatible; match++) {
 		if (of_machine_is_compatible(match->compatible))
 			return true;
-
-		match++;
 	}
 
 	return false;
-- 
2.17.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ