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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23E5BC433F5 for ; Fri, 5 Nov 2021 11:21:06 +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 70BEC6126A for ; Fri, 5 Nov 2021 11:21:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 70BEC6126A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B527D83711; Fri, 5 Nov 2021 12:21:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.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=kernel.org header.i=@kernel.org header.b="ARSYgcNq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5D9448370A; Fri, 5 Nov 2021 12:21:00 +0100 (CET) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1EB8B8365C for ; Fri, 5 Nov 2021 12:20:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 058CF611C4; Fri, 5 Nov 2021 11:20:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636111254; bh=NhRHTKXHP0bkLZBWs8UCP1OL21+JSk9JveKHANLWX2o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ARSYgcNqELC/DtqF6NAcDmHKCJ9YzQv8Ch2ywA/bfAzAyVYtYBa4Ey0wDjYGG0OU6 wJD7yk+OtKrsQPTcuRQksjSz4L1kQlPDn2gOc3cCQ0g/MSQCI0Czq0jyCu9SANS3jI Mz33/kgNkKHgKEL/RvkJcWbsP0A1bLFpditisG2HdzoGmLrXiEDQeKm/VCyqNQ3p7+ ffKSAVLvtSH0eg02vbsOnrxkme0feOw0az9VbmWRXaDApnqYFMfuXCP9sb7JdG9VjN kk32PTSHUmXN0GsMDJdOKE8hOdPRiLxPsUptKL9l2aEVPFpG40al9VBwNxMG+sCWTz wbXVgg/pid1ug== Date: Fri, 5 Nov 2021 12:20:51 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: Simon Glass Cc: Pali =?UTF-8?B?Um9ow6Fy?= , u-boot@lists.denx.de, Marek =?UTF-8?B?QmVow7pu?= Subject: Re: [PATCH v2 06/12] sysinfo: Add get_str_list() method Message-ID: <20211105122051.28bd8797@thinkpad> In-Reply-To: References: <20211103232332.2737-1-kabel@kernel.org> <20211103232332.2737-7-kabel@kernel.org> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 Thu, 4 Nov 2021 20:02:27 -0600 Simon Glass wrote: > On Wed, 3 Nov 2021 at 17:23, Marek Beh=C3=BAn wrote: > > > > From: Marek Beh=C3=BAn > > > > Add get_str_list() method to sysinfo operations. > > > > The get_str_list() method is similar to get_str(), but receives one > > additional argument, @idx, and fills in the @idx-th string from a given > > list. > > > > Add sandbox implementation together with a unittest. > > > > Signed-off-by: Marek Beh=C3=BAn > > --- > > drivers/sysinfo/sandbox.c | 15 +++++++++++ > > drivers/sysinfo/sysinfo-uclass.c | 15 +++++++++++ > > include/sysinfo.h | 44 ++++++++++++++++++++++++++++++++ > > test/dm/sysinfo.c | 13 ++++++++++ > > 4 files changed, 87 insertions(+) > > =20 >=20 > Reviewed-by: Simon Glass >=20 > Except I think it should return -NOSPC if the buffer is too small. No because then you don't know how large buffer you actually need and have to guess (or grow by a factor of two until it fits). This way you can call with size=3D0, get the length, allocate buffer and call again. Marek