lkml.org 
[lkml]   [2019]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 05/22] thunderbolt: Add helper macros to iterate over switch ports
From
Date
Am Dienstag, den 01.10.2019, 14:38 +0300 schrieb Mika Westerberg:
> @@ -1975,10 +1972,8 @@ void tb_switch_suspend(struct tb_switch *sw)
> if (err)
> return;
>
> - for (i = 1; i <= sw->config.max_port_number; i++) {
> - if (tb_port_has_remote(&sw->ports[i]))
> - tb_switch_suspend(sw->ports[i].remote->sw);
> - }
> + tb_switch_for_each_remote_port(sw, i)
> + tb_switch_suspend(sw->ports[i].remote->sw);

This macro looks a bit prone to misunderstanding.
I guess the function would be better if the test could be seen.

Regards
Oliver

\
 
 \ /
  Last update: 2019-10-02 16:18    [W:0.272 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site