On Fri, Nov 25, 2022 at 11:53:12PM +0800, Jinlong Chen wrote: > list_for_each_entry(e, &elv_list, list) { > - if (e == cur) { > + if (e == cur) > len += sprintf(name+len, "[%s] ", cur->elevator_name); > - continue; > - } > - if (elv_support_features(q, e)) > + else if (elv_support_features(q, e)) > len += sprintf(name+len, "%s ", e->elevator_name); Looks good. But to make this even more obvious I'd also switch to pinting e->elevator_name for the cur case instead of cur.