Skip to contentSkip to conversation

soc/tegra: optimize soc_is_tegra()

PATCH New Yangtao Li 1 participant 1 message Nov 22, 2018 Tegra architecture support

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 soc/tegra: optimize soc_is_tegra()

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

---
 drivers/soc/tegra/common.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/soc/tegra/common.c +1 -3
index 54627ca957e8..521a201d9fff 100644
@@ -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;
Signature · 1 line
2.17.0