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 D52F4C433FE for ; Tue, 29 Nov 2022 07:14:27 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E3960852DA; Tue, 29 Nov 2022 08:14:25 +0100 (CET) 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="YIrv1x4W"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5BE0E8530C; Tue, 29 Nov 2022 08:14:24 +0100 (CET) Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (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 496298513D for ; Tue, 29 Nov 2022 08:14:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ed1-x52d.google.com with SMTP id l11so18551591edb.4 for ; Mon, 28 Nov 2022 23:14:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=+C6rP2TSsjZe/mcPMmcbEvIs8yL71o+xT32aTqWrW9k=; b=YIrv1x4W9klKf0RKfxNdQbyHqG3JcmaClaN32MMQE3sHe4T9VpzvlR1IXg0Cn6WD2b aINERXt/fBjZEz0l6T+naERGhDu3ei97STPc0fNteHpcgnMnI3Co/S3VGhC1dfYOTCMI 0pXnoL8VJgkjU/kUKfubLp30mZTfCe9KrJZV9Z3EvTRXnO08wW64mle/BiNE++E51Vki wgZXtDaZ7ydykwbShZpTCNhUvRfg2/oFDcSBhtVB0RYEIrA/cqe2QMkkXC2oIT6ybdST /qE8iWAbvYwZZZm2IdtRpGGkd+pTrbe6sHMHkOeljtqnqIdn2ZvOEcSnObniLgycJvIT Pe9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=+C6rP2TSsjZe/mcPMmcbEvIs8yL71o+xT32aTqWrW9k=; b=QWr+UlMEzcN+oLkwuVYduLLkGq+2DNEJqZOovuZE80DLF4yqSVA5//drXg+2vWxsDp 13lG1kY6X1ONqUQnKEF2F2E9wf+fXEUtSdM263pu27nw8KAJsQ+1HOq97Juej0fhRY4J /pQWkh+2PnkuQJ4Z9hsYl1vymvAorVp/GQKxivXIPFVik/wdSjWAaV7aJp51YmUwnoaE Kpk/Mdr4A/ALPVGaWwO4pkfOqK/cmfS4O9L8KfV+cbf7jhoqH/U6oVIe7vBKc65pO4Js FlwCec2dOCb7LWl4hfQEZ1k+iVVdVz2A1r66YUggwsuUrTY43OLHUjxdoUg/LQ2XbShO Jf3g== X-Gm-Message-State: ANoB5pmfipglMwELolKoMmEoax887/RWwcNQ8B+hQlqYshxMHldLNdg8 mE56b+TUl1w8xAKc1GrBNh9tsw== X-Google-Smtp-Source: AA0mqf6olNfg9rAHAyiVX8yxAJOOwgaQ+iPEa/TiM47OPAfYU06hInOA5n43UvjSKQIbGkwIG/UtRA== X-Received: by 2002:aa7:cc14:0:b0:468:58d4:a10e with SMTP id q20-20020aa7cc14000000b0046858d4a10emr51645115edt.222.1669706061842; Mon, 28 Nov 2022 23:14:21 -0800 (PST) Received: from hera (ppp078087234022.access.hol.gr. [78.87.234.22]) by smtp.gmail.com with ESMTPSA id fe9-20020a1709072a4900b007ae0fde7a9asm5811995ejc.201.2022.11.28.23.14.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 23:14:21 -0800 (PST) Date: Tue, 29 Nov 2022 09:14:19 +0200 From: Ilias Apalodimas To: Masahisa Kojima Cc: u-boot@lists.denx.de, Heinrich Schuchardt , Jerome Forissier Subject: Re: [PATCH v2 2/5] eficonfig: use u16_strsize() to get u16 string buffer size Message-ID: References: <20221128124509.6939-1-masahisa.kojima@linaro.org> <20221128124509.6939-3-masahisa.kojima@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221128124509.6939-3-masahisa.kojima@linaro.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.6 at phobos.denx.de X-Virus-Status: Clean On Mon, Nov 28, 2022 at 09:45:06PM +0900, Masahisa Kojima wrote: > Use u16_strsize() to simplify the u16 string buffer > size calculation. > > Signed-off-by: Masahisa Kojima > Reviewed-by: Heinrich Schuchardt > --- > No update since v1. > > cmd/eficonfig.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c > index 5529edc85e..88d507d04c 100644 > --- a/cmd/eficonfig.c > +++ b/cmd/eficonfig.c > @@ -452,8 +452,7 @@ struct efi_device_path *eficonfig_create_device_path(struct efi_device_path *dp_ > struct efi_device_path *dp; > struct efi_device_path_file_path *fp; > > - fp_size = sizeof(struct efi_device_path) + > - ((u16_strlen(current_path) + 1) * sizeof(u16)); > + fp_size = sizeof(struct efi_device_path) + u16_strsize(current_path); > buf = calloc(1, fp_size + sizeof(END)); > if (!buf) > return NULL; > -- > 2.17.1 > Reviewed-by: Ilias Apalodimas