From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id 4BCA33850409 for ; Thu, 19 Nov 2020 11:24:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4BCA33850409 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mark@klomp.org Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 5C1BE30291AB; Thu, 19 Nov 2020 12:24:26 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 4659E40061A5; Thu, 19 Nov 2020 12:24:26 +0100 (CET) Message-ID: Subject: Re: [PATCH 04/14] segment_report_module: Remove nested release_buffer() function From: Mark Wielaard To: Timm =?ISO-8859-1?Q?B=E4der?= , elfutils-devel@sourceware.org Date: Thu, 19 Nov 2020 12:24:26 +0100 In-Reply-To: <20201112150412.2137981-5-tbaeder@redhat.com> References: <20201112150412.2137981-1-tbaeder@redhat.com> <20201112150412.2137981-5-tbaeder@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-10.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Nov 2020 11:24:28 -0000 Hi Timm, On Thu, 2020-11-12 at 16:04 +0100, Timm B=C3=A4der via Elfutils-devel wrote= : > diff --git a/libdwfl/dwfl_segment_report_module.c > b/libdwfl/dwfl_segment_report_module.c > index d06d0ba0..ba11b60a 100644 > --- a/libdwfl/dwfl_segment_report_module.c > +++ b/libdwfl/dwfl_segment_report_module.c > @@ -267,13 +267,6 @@ dwfl_segment_report_module (Dwfl *dwfl, int ndx, con= st char *name, > =20 > GElf_Addr start =3D dwfl->lookup_addr[segment]; > =20 > - inline void release_buffer (void **buffer, size_t *buffer_available) > - { > - if (*buffer !=3D NULL) > - (void) segment_read (dwfl, memory_callback, memory_callback_arg, > - -1, buffer, buffer_available, 0, 0); > - } This depends on [PATCH 02/14] segment_report_module: Pull segment_read into file scope. For which I rather see us use a direct call to (*memory_callback). And release_buffer is basically segment_read (with a *buffer !=3D NULL check), which is basically a (*memory_callback) call. So if possible I rather see us use something like: if (*buffer !=3D NULL) (*memory_callback) (...) directly. Thanks, Mark