Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751911AbaGBIMa (ORCPT ); Wed, 2 Jul 2014 04:12:30 -0400 Received: from mx0.aculab.com ([213.249.233.131]:37758 "HELO mx0.aculab.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751111AbaGBIM2 (ORCPT ); Wed, 2 Jul 2014 04:12:28 -0400 From: David Laight To: "'Alexei Starovoitov'" , Daniel Borkmann CC: "David S. Miller" , Ingo Molnar , Linus Torvalds , Steven Rostedt , Chema Gonzalez , Eric Dumazet , Peter Zijlstra , "Arnaldo Carvalho de Melo" , Jiri Olsa , "Thomas Gleixner" , "H. Peter Anvin" , "Andrew Morton" , Kees Cook , "Linux API" , Network Development , LKML Subject: RE: [PATCH RFC net-next 08/14] bpf: add eBPF verifier Thread-Topic: [PATCH RFC net-next 08/14] bpf: add eBPF verifier Thread-Index: AQHPlWebjjkyXHF39E2brFC82m+gmpuMbZvw Date: Wed, 2 Jul 2014 08:11:20 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1726B207@AcuExch.aculab.com> References: <1403913966-4927-1-git-send-email-ast@plumgrid.com> <1403913966-4927-9-git-send-email-ast@plumgrid.com> <53B26BB0.90209@redhat.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id s628CaN0028710 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 ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?