Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1823677pxb; Mon, 8 Mar 2021 07:15:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPZv2sCMmjPAzrgC6cxsLpyYXR379QMQ9iFcVigqe1GWhDLf65P0+RWXvgojk+gXCfW32N X-Received: by 2002:a17:906:4117:: with SMTP id j23mr15899363ejk.10.1615216525673; Mon, 08 Mar 2021 07:15:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615216525; cv=none; d=google.com; s=arc-20160816; b=t9AMV0rBty8iDN+hvuNer/8X97GsrOr3tUGXWOgMGhqJ3ZYiE7Q+MgzHwDjk89XHls gBY6mHbAnN18Qa132dA5nJxSGSB4rS9Gz/2WwCDeuYMmjG7cJWLT1zs/3pLjzYjit+KF rdRRUus8zVuCpdIgOcI981AEsoTfvYekI43wBuel9IiHTg5/wHM/dmHU0TBP17rEscJg iD3IrBgkra2Hz0BQJJkd2dZ93Qywp5HEjfIDnuCkDkV4oSwZf+jkkakOTaUx5Y/WX05v 3l3LiixVANjbRh8FOAOgpFt/MjsfJAoYaaua/dAn0UDPZ/WT35wqNiLbNPXMxGZwnTdx L9LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UxI0+0pA6hdqL66mFw/aL7E3tqFzlN/0V87Y8dO+dYE=; b=E7jZrrr9YppFUNRvMIJkKTwtIum6k5ukgfmPmk3PDRDypxArijsGCv6ep0CXZUEHlU hqHERMG3t7p+xalsekUkHYzzKQQ4qeP/ol6ZWCMS6j7uy+P+eLp6h6ai03YMiTxcY7ds YlGSfbadXNjMnnnmEpbHoF1k/XXqLXFHN29YD8Lz1FYX2Qh8+mF70JI7Tlz5Caf3CP65 NHQeUUrKvoBRhCN6DphAo6H5ZWlmCBQwHQYtgmy+KAEO2qMzQmbp8jhUeVRZtpwYbFVC Z6moCiwi8sUT/DaNe6wrL+9cdO9MF94eP23heuPbzw8lXawEqhsXzwUs438/0fqWAFBo yqVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=UpPJMT5Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 40si6742989edq.26.2021.03.08.07.15.02; Mon, 08 Mar 2021 07:15:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=UpPJMT5Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229904AbhCHPOH (ORCPT + 99 others); Mon, 8 Mar 2021 10:14:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230502AbhCHPNq (ORCPT ); Mon, 8 Mar 2021 10:13:46 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B008AC061760 for ; Mon, 8 Mar 2021 07:13:45 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id l12so15272595edt.3 for ; Mon, 08 Mar 2021 07:13:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UxI0+0pA6hdqL66mFw/aL7E3tqFzlN/0V87Y8dO+dYE=; b=UpPJMT5ZopEuCtzpzVsg/vaiXVkVA5Htpk52k7Vwu3CSSQCqZrcL02bNcaomKYSUII bcCbiES60T2QEUofBw6HJexKJ6J+AIceLXgf2p7Ze76J3beMSb7EyZWvhLWMX3IpP2pa zlkhibYGqRRagI+x6LLN4f7Wqx0XicPIHan9r5blJqteY2ms4B4QAoQzMYqm+SdXMznn 8CI7gdC6LTMJXYzCHVimCKIBow4G1EZSijPl8MvDpnEXK94+fUGfXU6phJBKM14ElpbN yVo5ZDkU8ofWXUfN67LGTYiKyTlTDY768vIoYa/hi5XN7r1yNlvqPzaFy4G9+C5wdVhG aEaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UxI0+0pA6hdqL66mFw/aL7E3tqFzlN/0V87Y8dO+dYE=; b=O9o9xMuZyIHfrvR7yECWEOHpZi0vbYCvO43Of50QgShh9D3xPilyjKnUlWiS4Iwxyw MIuutPHDm3OTtyB/lpXms+riUr4dK+HWryNYLbJF9IqAmvcqXPzZtOdROTPqCcyarEBF 5LsB6NRwpu0Xldw/XAvm9w/a+F2EKjO8DdKhjpwY0tHR7xsePaoxZ4NaJDVjzo4yqQ3S K37FeLAUCPNrnoQbetRDooyhhPcMdcsHtP6BAIz83TcfHKDBuLk1rmsgQigD+xNYSIR3 Jq8GuZ6wCSDyJl0a+Yp9mZc2gRYUu2WfTjg5e5OeDqVL7bHOZPzIHuNa6EVyCz2AZeMg t5sw== X-Gm-Message-State: AOAM530Q9hH4j/23d1KSZ120MUNY5/ohj58qa2Cqa+Mk3JWIe5fTrXyP 7yRn/nZ21W/pwEaO4gtOtrqZaieI4eJKn60v/tcvpqPis58= X-Received: by 2002:a05:6402:17d6:: with SMTP id s22mr22398572edy.232.1615216424076; Mon, 08 Mar 2021 07:13:44 -0800 (PST) MIME-Version: 1.0 References: <20210304102452.21726-1-brgl@bgdev.pl> <20210304102452.21726-10-brgl@bgdev.pl> In-Reply-To: From: Bartosz Golaszewski Date: Mon, 8 Mar 2021 16:13:33 +0100 Message-ID: Subject: Re: [PATCH v2 09/12] gpio: sim: new testing module To: Andy Shevchenko Cc: Bartosz Golaszewski , Joel Becker , Christoph Hellwig , Shuah Khan , Linus Walleij , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Geert Uytterhoeven , Kent Gibson , Jonathan Corbet , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , linux-doc Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 8, 2021 at 4:05 PM Andy Shevchenko wrote: > > On Mon, Mar 08, 2021 at 03:23:31PM +0100, Bartosz Golaszewski wrote: > > On Fri, Mar 5, 2021 at 11:15 AM Andy Shevchenko > > wrote: > > > On Thu, Mar 04, 2021 at 09:15:29PM +0100, Bartosz Golaszewski wrote: > > > > On Thu, Mar 4, 2021 at 2:15 PM Andy Shevchenko > > > > wrote: > > > > > On Thu, Mar 04, 2021 at 11:24:49AM +0100, Bartosz Golaszewski wrote: > > > > > > From: Bartosz Golaszewski > > > > > > > + > > > > > > + /* > > > > > > + * FIXME If anyone knows a better way to parse that - please let me > > > > > > + * know. > > > > > > + */ > > > > > > > > > > If comma can be replaced with ' ' (space) then why not to use next_arg() from > > > > > cmdline.c? I.o.w. do you have strong opinion why should we use comma here? > > > > > > > > > > > > > My opinion is not very strong but I wanted to make the list of names > > > > resemble what we pass to the gpio-line-names property in device tree. > > > > Doesn't next_arg() react differently to string of the form: "foo=bar"? > > > > > > It's ambiguous here. > > > > > > So, the strings '"foo=bar"' and 'foo=bar' (w/o single quotes!) are indeed > > > parsed differently, i.e. > > > '"foo=bar"' -> 'foo=bar', > > > while > > > "foo=bar" -> 'foo' + 'bar'. > > > > > > > IMO '"foo", "bar", "", "foobar"' looks better than '"foo" "bar" "" > > "foobar"' and I'm also not sure next_arg will understand an empty > > quote? > > I guess it understands it. But I agree that comma-separated it would look > better. > > > If you're not objecting strongly, then I would prefer my version. > > I have strong opinion not to open code "yet another parser". > > So, grepping on 'strsep(.*, ",")' shows a lot of code that wants something like > this. Interesting are the net/9p cases. This in particular pointed out to > lib/parser.c which in turn shows promising match_strlcpy() / match_strdup(). I > haven't looked deeply though. > > That said, I agree that next_arg() is not the best here. > > -- > With Best Regards, > Andy Shevchenko > > Shall we revisit this once it's upstream with a generalization for separating comma separated strings? Bart