On Wed, Jun 27, 2018 at 4:23 AM, Jesper Dangaard Brouer
<bro...@redhat.com> wrote:
> On Tue, 26 Jun 2018 16:53:15 -0700
> Song Liu <liu.song....@gmail.com> wrote:
>
>> > +static char* options2str(enum cfg_options_flags flag)
>> > +{
>> > +       if (flag == NO_TOUCH)
>> > +               return "no_touch";
>> > +       if (flag & READ_MEM)
>> > +               return "read";
>> > +       fprintf(stderr, "ERR: Unknown config option flags");
>> > +       exit(EXIT_FAIL);
>> > +}
>> > +
>>
>> enum cfg_options_flags is used as a bitmap in other parts of the sample.
>> So this function is a little weird (with more flags added).
>
> Sure, and do I handle this correctly in the next patch.
>
> I'm uncertain what you want me to change?
> Do you want me to drop the enum, and use #define instead?

I think  it is good  as-is for sample code.

Acked-by: Song Liu <songliubrav...@fb.com>

Reply via email to