Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1816142pxb; Mon, 8 Mar 2021 07:06:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqz0gFMNxAmGkZoHslvUiKGeX9aZQDK0tYKRF//b6c6Dv8xEYzNcwpSpZu+p0gtFo2nvbb X-Received: by 2002:a05:600c:35c1:: with SMTP id r1mr22875068wmq.143.1615216006656; Mon, 08 Mar 2021 07:06:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615216006; cv=none; d=google.com; s=arc-20160816; b=l7f1Gxqw8GWSSEB1n5Lu2Npa/OHRG42Wk9LwBHSXmNBA61+MLZWODzbEL4RKG0jMuX 1pIKSZLR7QFB9bTPVRlHGfSIF187jQWGZLDO5p969c+KPrLOp7ZYVoZp3MGBcKrhiEwX cl57HDFTJYpSJqEyxfvZp2uQgnnTZtshd/GAl7BJ0eCAq6XM01/NXsiF6O/zgPtUvLd1 8Xb7sXE23NvOKR1bFulvmOFbr3NFngeB8nvU0e8MV301l+DmcIXsoU+ZZOf33EfM5dIg CgNdKmNKEv65Eps0HCb+cWHjAyM/XSZRODHtIOyOCNN3ZX0cKZ1xBX5CAkAcWDSzQbq1 /k8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=wvIvV0486sbWtY46xFbMneozCFoNCHtaXvSBhcM8jrI=; b=UIUmaC5veuwg0DKOPxMOQOqjsa/QFwMFuMqSAmhd5vK2j+F/9mtNVGQ+VxZRBzJBPR UtjWOBumdBz7GoBIcznfUJFDAsLdaxr5F1m3ohMLVgXB6pnW4GTFxwbSHygYwVC/mIxF A1c/mwuSV2aZ0vjHw71xwJQX6XSbZQr45IqE7n5N2mg7Im6BsTlJ9fekMr9d+02vF0su Ln10VTzQ1TvApX5EtzSPwT/fsQ4htbd0uxZHP04EnmPWB+zXyZfpkqEBUY+ARP1lTbru 5WcV0Mh8Wl6OsC/CIAYeOyldAwd5RQ8gaMjrDcZvxOPJ/3Hhg9qIUron+u/f77bt+S2g QHnQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d5si7243280ejt.487.2021.03.08.07.06.18; Mon, 08 Mar 2021 07:06:46 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbhCHPFA (ORCPT + 99 others); Mon, 8 Mar 2021 10:05:00 -0500 Received: from mga07.intel.com ([134.134.136.100]:15430 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230511AbhCHPEv (ORCPT ); Mon, 8 Mar 2021 10:04:51 -0500 IronPort-SDR: rZXrXVlEH8dOYTpNPu2rpQ1mXm9l2LUgSpqJq0Oy68NQxddSdKgYDGSugP07WmRUQEpLI3IoF8 mk6qoq20BDAw== X-IronPort-AV: E=McAfee;i="6000,8403,9917"; a="252070636" X-IronPort-AV: E=Sophos;i="5.81,232,1610438400"; d="scan'208";a="252070636" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2021 07:04:50 -0800 IronPort-SDR: J8GNzHfLKcDEkk426TkXPTJpLuMsSrSi0ZePPgzJPGYWw6fHHNIpqpY8ioVeonKngALCCJk50S Wxqg+2kLC99Q== X-IronPort-AV: E=Sophos;i="5.81,232,1610438400"; d="scan'208";a="519965026" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2021 07:04:47 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lJHR6-00AqJ3-6h; Mon, 08 Mar 2021 17:04:44 +0200 Date: Mon, 8 Mar 2021 17:04:44 +0200 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Joel Becker , Christoph Hellwig , Shuah Khan , Linus Walleij , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Geert Uytterhoeven , Kent Gibson , Jonathan Corbet , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , linux-doc , Bartosz Golaszewski Subject: Re: [PATCH v2 09/12] gpio: sim: new testing module Message-ID: References: <20210304102452.21726-1-brgl@bgdev.pl> <20210304102452.21726-10-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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