On Tue, Jun 26, 2018 at 8:15 AM, Qi, Fuli <[email protected]> wrote: > Hi Dan, > Thanks for your comments. > [..] >> > + if (strcmp(buf, "bus") == 0) { >> > + set_config((const char **)¶m.bus, value); >> >> The cast is unnecessary, and I think we can clean this up further by having >> the helper >> do the strcmp() and return the value. Something >> like: >> >> param.bus = parse_config("bus", value); >> > Could you please tell me more about the helper which do the strcmp() and > return the value? > I think the helper should return a flag, because we need to use continue > statement to > cause a jump in the while loop. >
Why is the continue statement needed? Imagine the configuration file had "xyz = abc". All the statements would fail and the loop would naturally continue to the next iteration. _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
