* [PATCH] soc/tegra: optimize soc_is_tegra()
@ 2018-11-22 16:42 Yangtao Li
0 siblings, 0 replies; only message in thread
From: Yangtao Li @ 2018-11-22 16:42 UTC (permalink / raw)
To: thierry.reding, jonathanh; +Cc: linux-tegra, linux-kernel, Yangtao Li
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@gmail.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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-11-22 16:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-22 16:42 [PATCH] soc/tegra: optimize soc_is_tegra() Yangtao Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).