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 X-Spam-Level: X-Spam-Status: No, score=-4.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E11EC11F68 for ; Fri, 2 Jul 2021 13:38:36 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 93F57613E6 for ; Fri, 2 Jul 2021 13:38:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93F57613E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7C3D081ED0; Fri, 2 Jul 2021 15:38:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="qAe3mpWy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6617E81E14; Fri, 2 Jul 2021 15:38:31 +0200 (CEST) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (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 5A62281E14 for ; Fri, 2 Jul 2021 15:38:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qk1-x730.google.com with SMTP id c3so8369153qkc.3 for ; Fri, 02 Jul 2021 06:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=UinPoKiOXqP4/L1Qfp3u15B+vPQauY3CjUGEgLTKIE0=; b=qAe3mpWyZdVKt/pnQOJotE+i1fozlIpYkzHwmiBqTcFZ+JiqyNYy+1nDLlBsBUSRMR +BoFExWGVfl/qHpMJrtnBxoXqFhMzm75wFyc0kuNpxVfPlujwRio2nsFjvHpwDaV1LYV VGdrQpunTQuonNDHv/z1f0MHroKgfrgYYVJCGlC6NgcM0/2B36nZPOzohGtlbvepVzVr skQCK/wHxiRv61UFORsYy4n8aRMlkTnDvwNnaT3PU6dzif9l090PxkC6zHgKC++1/CsR T4M9aKD3GJ8nV3nPpS4HiKhkpQmn37uVGvVI02uHIgyjQL4hu5bm9Gr7XGByx8dKKR1w Mrdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UinPoKiOXqP4/L1Qfp3u15B+vPQauY3CjUGEgLTKIE0=; b=s/1BKG8erx8vUmLAJgEM3PuHpXrmtXcDFP3mUva/YDUhfPCKXpBxm6aNAzOa/aLMMZ oN3B9PSLhW+5aUOHjeoXCrrQOFTo24FBge/A6p+efEkICQKYjPoMhT6xOFtzG3DwKfGu eZTu+O07AUDK13s+Hkc/mGIRhM2uYV6D+sSY9bqoYN28/Zvknx42XOdEyC3PsDAxKbTe us06l0T2cGwRTVAHESdWRy3F2FXErHj/osHJOaSijRFUU/zSfK6vNWs4qwe13LIy2lsl KYxI5R9/KHmDuiB2i0XO9lxaL23vI193LyjXl1md8SmKGFGoWFKlCnHQdvkZnh7mbK5E izwg== X-Gm-Message-State: AOAM5317J4Y19uqvYQZaWvr2NPLAfykOe483mpbjFCuIi+yk6Ax5FQi2 aFRsCH3KsGjJcJgPEs+Hj9M= X-Google-Smtp-Source: ABdhPJy/aYMqtMOABOSvZF+DWT49jnVb9Ss69HfdGN22ky+U9Ke4atzZPwRN4Uy94ZLhcxOHC/JyHQ== X-Received: by 2002:a37:5cc6:: with SMTP id q189mr5585930qkb.305.1625233107192; Fri, 02 Jul 2021 06:38:27 -0700 (PDT) Received: from [192.168.1.201] (pool-74-96-87-9.washdc.fios.verizon.net. [74.96.87.9]) by smtp.googlemail.com with ESMTPSA id e6sm1377508qkg.12.2021.07.02.06.38.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Jul 2021 06:38:26 -0700 (PDT) From: Sean Anderson Subject: Re: [RFC PATCH 03/28] cli: lil: Replace strclone with strdup To: Rasmus Villemoes , u-boot@lists.denx.de, Tom Rini Cc: =?UTF-8?Q?Marek_Beh=c3=ban?= , Wolfgang Denk , Simon Glass , Roland Gaudig , Heinrich Schuchardt , Kostas Michalopoulos References: <20210701061611.957918-1-seanga2@gmail.com> <20210701061611.957918-4-seanga2@gmail.com> Message-ID: Date: Fri, 2 Jul 2021 09:38:26 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean On 7/2/21 4:36 AM, Rasmus Villemoes wrote: > On 01/07/2021 08.15, Sean Anderson wrote: >> Apparently strdup is not portable, so LIL used its own. Use strdup. > > You could reduce the churn by just making strclone "#define strclone(x) > strdup(x)", but I suppose you end up modifying the upstream code so much > that there's not really anything gained by that. > > But that begs the question: What is the long-term plan for this? While > it does seem to be an improvement compared to hush, will we ever be able > to incorporate fixes&features from upstream, or will this code end up in > the same situation as hush? Well, since Hush was never updated, I don't believe LIL will be either. I think reducing the amount of ifdefs makes the code substantially easier to maintain. My intention is to just use LIL as a starting point which can be modified as needed to better suit U-Boot. The other half of this is that LIL is not particularly actively developed. I believe the author sees his work as essentially feature-complete, so I expect no major features which we might like to backport. > > Have you been in contact with upstream about this project? Perhaps some > of the things you do could go upstream - e.g. the conversion from an > array of wrongly-typed callbacks to an "ops" struct seems to be an > obvious improvement [lil_callback would have to be kept, and changed to > use a switch() statement to update the right slot, but we wouldn't have > to care because ld will remove it anyway if we don't add any users of it]. I have not. I'm not sure what changes I've made are compatible with the vision he has for LIL. He's CC'd on this series, so perhaps he can comment. --Sean