[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170829.180024.322953630308674415.davem@davemloft.net>
Date: Tue, 29 Aug 2017 18:00:24 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: tom@...ntonium.net
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH v2 net-next 3/6] flow_dissector: Add protocol specific
flow dissection offload
From: Tom Herbert <tom@...ntonium.net>
Date: Tue, 29 Aug 2017 16:27:08 -0700
> +#define GOTO_BY_RESULT(ret) do { \
> + switch (ret) { \
> + case FLOW_DISSECT_RET_OUT_GOOD: \
> + goto out_good; \
> + case FLOW_DISSECT_RET_PROTO_AGAIN: \
> + goto proto_again; \
> + case FLOW_DISSECT_RET_IPPROTO_AGAIN: \
> + goto ip_proto_again; \
> + case FLOW_DISSECT_RET_OUT_BAD: \
> + default: \
> + goto out_bad; \
> + } \
> +} while (0)
> +
> +#define GOTO_OR_CONT_BY_RESULT(ret) do { \
> + enum flow_dissect_ret __ret = (ret); \
> + \
> + if (__ret != FLOW_DISSECT_RET_CONTINUE) \
> + GOTO_BY_RESULT(__ret); \
> +} while (0)
Please don't hide major control flow changes inside of a macro. This
means returns and gotos.
It makes code impossible to audit.
Yes, this applies even if the macro has the word "GOTO" in it :-)
Powered by blists - more mailing lists