From mboxrd@z Thu Jan 1 00:00:00 1970 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 0E456C77B7C for ; Tue, 9 May 2023 15:42:37 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E6CB785B96; Tue, 9 May 2023 17:42:35 +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="QkmIeE+Q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DC4C385BBE; Tue, 9 May 2023 17:42:34 +0200 (CEST) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (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 7E65F85814 for ; Tue, 9 May 2023 17:42: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-qk1-x72a.google.com with SMTP id af79cd13be357-757756e2eefso142691485a.3 for ; Tue, 09 May 2023 08:42:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683646951; x=1686238951; 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=lsUXvH7i4eTKWVSjAmEDfHYESsYmmN7YptmdIcwL5Ic=; b=QkmIeE+QiI0klS/cjGmRb3YRUzPN5lVojNPb2zkMQz+LazCoK5JPcM1tq1zwkKr8HH aimfnfyqT3dbZIaeRQ/PGiMx5v8VeZTQfc9lfoiijd7ivOwMSGHEONBmHT/QwnWpe9cp Jw/yTZkB4S5r1gn1e8YvzjPBPr+Oc/lsdKWcBkQbytQpjsONHOr96upLFFPV/oRiTJhG jtIkQVmUfU45MJjm3RAERGRefH8e0l6MGlFwD9YfhC471G26p2WxXh6Kzbn0AydFOB1T MKTLHM+NSZMYrPmpggVcohL+dzDTROrHt1ko3K8KJ2aZxAtdzABNo8kPh4j4+BlNP+AG nhVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683646951; x=1686238951; 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=lsUXvH7i4eTKWVSjAmEDfHYESsYmmN7YptmdIcwL5Ic=; b=IHFQL763OnSsOJwQYX8jE/NjZ4JaTQK6inCo406vfpU2HdYHpa8jW9F892Xd4SHdzy V+VCt6Jt2dWg7sjt8UscrA+JXCRizH6TSxhl2gsl/8Hn4l1D8i4N+bTZ3QMGYNA130gw Txffwe6NL3U+7SDIHC/s4LwL1TLiDMCA2QTKw5SuxfskfpDoKa99nYZksRt/Rk2XKsJD j60IE4AYSk4RZhLE/3XM/kBeEoWM6vQBMol1e11Jfs8fbd7MCbjKUEV4GgQJgeO4sB+M ibNAK2+DQZBpYl/D3lXnuBXUQthaPR9QuFwYpCGEsOd213JPSVWcz2Mrqe9SOtoIFRFy gcXA== X-Gm-Message-State: AC+VfDzipNP9h9VukRtv12OptwpdFxyVC5WaD8Ows3I9TDymtmnJdBZr Eyij3bL4scxjIuJNbS9CJPqhQg== X-Google-Smtp-Source: ACHHUZ48hdu1rt4kdKW6FDELec2JUR/hEUPXFGRpe3eaq6X6Tk+Xl4fALlVIMLOxxgA2zZijDxY9IA== X-Received: by 2002:a05:622a:1486:b0:3ef:300f:a4e8 with SMTP id t6-20020a05622a148600b003ef300fa4e8mr23219496qtx.46.1683646951275; Tue, 09 May 2023 08:42:31 -0700 (PDT) Received: from localhost (rfs.netwinder.org. [206.248.184.2]) by smtp.gmail.com with ESMTPSA id y7-20020a37e307000000b0074df7857e72sm3319831qki.34.2023.05.09.08.42.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 May 2023 08:42:31 -0700 (PDT) Date: Tue, 9 May 2023 11:42:30 -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: <20230509154230.GC3431193@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: 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 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... Ralph