RE: [PATCH RFC net-next 08/14] bpf: add eBPF verifier

From: David Laight
Date: Wed Jul 02 2014 - 04:12:35 EST


From: Alexei Starovoitov
...
> >> +#define _(OP) ({ int ret = OP; if (ret < 0) return ret; })
...
> >> + _(get_map_info(env, map_id, &map));
> >
> > Nit: such macros should be removed, please.
>
> It may surely look unconventional, but alternative is to replace
> every usage of _ macro with:
> err =
> if (err)
> return err;
>
> and since this macro is used 38 times, it will add ~120 unnecessary
> lines that will only make code much harder to follow.
> I tried not using macro and results were not pleasing.

The problem is that they are hidden control flow.
As such they make flow analysis harder for the casual reader.

The extra lines really shouldn't matter.

David