Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752814AbdL0XFR (ORCPT ); Wed, 27 Dec 2017 18:05:17 -0500 Received: from www62.your-server.de ([213.133.104.62]:40268 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752004AbdL0XFP (ORCPT ); Wed, 27 Dec 2017 18:05:15 -0500 Subject: Re: [PATCH 3/4] libbpf: break loop earlier To: Eric Leblond , Alexei Starovoitov Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20171227022730.y27gwva2u2ilyrul@ast-mbp> <20171227180229.1926-1-eric@regit.org> <20171227180229.1926-4-eric@regit.org> <20171227190042.hwxk6ccazdtnob77@ast-mbp> <1514406645.31134.29.camel@regit.org> From: Daniel Borkmann Message-ID: Date: Thu, 28 Dec 2017 00:05:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1514406645.31134.29.camel@regit.org> Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1125 Lines: 37 On 12/27/2017 09:30 PM, Eric Leblond wrote: > On Wed, 2017-12-27 at 11:00 -0800, Alexei Starovoitov wrote: >> On Wed, Dec 27, 2017 at 07:02:28PM +0100, Eric Leblond wrote: >>> Get out of the loop when we have a match. >>> >>> Signed-off-by: Eric Leblond >>> --- >>> tools/lib/bpf/libbpf.c | 1 + >>> 1 file changed, 1 insertion(+) >>> >>> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c >>> index 5fe8aaa2123e..d263748aa341 100644 >>> --- a/tools/lib/bpf/libbpf.c >>> +++ b/tools/lib/bpf/libbpf.c >>> @@ -412,6 +412,7 @@ bpf_object__init_prog_names(struct bpf_object >>> *obj) >>> prog->section_name); >>> return -LIBBPF_ERRNO__LIBELF; >>> } >>> + break; >> >> why this is needed? > > It was just cosmetic, no related bug. > >> The top of the loop is: >> for (si = 0; si < symbols->d_size / sizeof(GElf_Sym) && !name; >> >> so as soon as name is found the loop will exit. > > OK, I've missed that. Please disregard this patch. Ok, please respin the series one last time w/o this patch then. Please also keep the already given ACKs on the other patches. Thanks, Eric!