Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4B476C77B7F for ; Fri, 12 May 2023 20:14:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7D453862E2; Fri, 12 May 2023 22:14:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="x2HByhU4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DFEFF862F2; Fri, 12 May 2023 22:14:34 +0200 (CEST) Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8EF68862CD for ; Fri, 12 May 2023 22:14:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ralph.siemsen@linaro.org Received: by mail-il1-x12a.google.com with SMTP id e9e14a558f8ab-33131e965a2so21386935ab.1 for ; Fri, 12 May 2023 13:14:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683922471; x=1686514471; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mUevUmBhXhpO1lBtg4Tt5B7WDsie35SoM78R0AnGTI0=; b=x2HByhU44OXhmH7mSMB5rOCXgLGVeyJZjqG9cJP3anheLLdU+NFqDa8Q5Ba+ZXbceP pfo2WfCqG4BfNoCV8JVvqVzj+ner3on+LiC02Sovt/GLfwDQOKeOU6vsYoktTOhzIIzU 8s9H+wNiCj2N5YswWGWuolVxVvvk/9TXaKh6PPsc3tY9UXmICf8OqHoTD5K4mto+UX/i cqxu6vD9y5lBjfN5pjFEmp+B1A4ClvkqLrmbdE4DKHnqsVg4duElIZXEZ8efv1WAcjp3 HPbQz5TMM+2jnLHxVL+J8thcyd5u6nERX56h8JISNCNFJe/BJ2ecx1xFrZzhCJ6FJlDJ PjGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683922471; x=1686514471; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mUevUmBhXhpO1lBtg4Tt5B7WDsie35SoM78R0AnGTI0=; b=QNBNawxNsHCMo9oEip20BlPaFerx4XNPOfHLswv64gMv9cxJ0ZyYZoqKJmo4vwnMUB poe6uhrD0WDgsXg8wWdxxZEwr0SOhKMSbMUIP6GPLS1dVBxZ9LWR1abE7w05zVDmXvfA BibjuKmHGaSllqo69lkpiLUXXCtf2phQr941xkueD+pvNCCOWpO1sP4DHxdMQoA1EU9E /jJrgJCjhyHAYALslO655r+b1VH6m86jhpeOuG529+g3avouDmPEqmZeKhN5RNdjzl/O xBrHJBacpNz0nK7o7Qw3M5NUI+24VKkXItnHxsYG77seSpDmW1qPsXU6649RfL0XpqfM IJbw== X-Gm-Message-State: AC+VfDw0u537wHxg4XXsYCad3v9F4EWSufvLqx/QzFUkS7I2T4RzTLpb HnnER4FEcwdn7l7PcD18p9DX/YsuGjoi4euEoqPBwg== X-Google-Smtp-Source: ACHHUZ5Tm37eS6GVjzB2bCFJTehni2vXuK7JK+w/SMCQ+acp3fR9zT7STe9tGdTtwHB4BNbrFDNd/w== X-Received: by 2002:a92:d8c3:0:b0:335:38b:e734 with SMTP id l3-20020a92d8c3000000b00335038be734mr14089336ilo.28.1683922471286; Fri, 12 May 2023 13:14:31 -0700 (PDT) Received: from localhost (rfs.netwinder.org. [206.248.184.2]) by smtp.gmail.com with ESMTPSA id s17-20020a056638219100b0040bd8fcaa4bsm3931500jaj.63.2023.05.12.13.14.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 13:14:30 -0700 (PDT) Date: Fri, 12 May 2023 16:14:29 -0400 From: Ralph Siemsen To: Marek Vasut Cc: u-boot@lists.denx.de, Simon Glass , Heiko Thiery , Heinrich Schuchardt , Ilias Apalodimas , Marc Kleine-Budde , Massimo Pegorer , Mattijs Korpershoek , Max Krummenacher , Pali =?iso-8859-1?Q?Roh=E1r?= , Roman Kopytin , Safae Ouajih , Sean Anderson , Steven Lawrance , Sughosh Ganu , Weijie Gao Subject: Re: [PATCH v5 09/10] tools: spkgimage: add Renesas SPKG format Message-ID: <20230512201429.GB2295717@maple.netwinder.org> References: <20230424011515.1359255-1-ralph.siemsen@linaro.org> <20230424011515.1359255-10-ralph.siemsen@linaro.org> <97434886-26e1-d607-a7c1-7de6280f7d5a@mailbox.org> <20230508175001.GA3380022@maple.netwinder.org> <80767553-7b0a-8ec4-f6c4-3b72cda767c5@mailbox.org> <20230509130716.GA3431193@maple.netwinder.org> <20230509154230.GC3431193@maple.netwinder.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20230509154230.GC3431193@maple.netwinder.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On Tue, May 09, 2023 at 11:42:30AM -0400, Ralph Siemsen wrote: >On Tue, May 09, 2023 at 04:52:45PM +0200, Marek Vasut wrote: >> >>Do we have some sort of global (?) state structure which exists >>during the whole work cycle of the tool ? If so, add a link list >>into there. > >There is struct image_tool_params which is passed to the callbacks and >holds most of the state. And in fact it is a global, but declared >static in mkimage.c, without any accessor function. > >If we really want to worry about the lifecycle of these dynamic >allocations, then we'd probably need to add some kind of "cleanup" >method to the API, and call it right before exiting from main(). > >I can do an example implementation, but there are 9 other image >formats already in the tree, which also do dynamic allocation. I don't >want to start touching each one of those, or I'll never get this RZ/N1 >in... I'll keep the current logic (which leaks) and send a separate RFC patch to discuss a strategy for fixing this in all the tools/*image.c drivers. Ralph