Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1785549pxb; Mon, 8 Mar 2021 06:25:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXL2p00gVw+FqmCo+rFSjr+hVKEuSuSdzLeRVS2A3ADPdC27q5TZIN796v5vDgS3RhWxXy X-Received: by 2002:a17:906:7c48:: with SMTP id g8mr15498606ejp.138.1615213514608; Mon, 08 Mar 2021 06:25:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615213514; cv=none; d=google.com; s=arc-20160816; b=E+lNXts0ZHMra8upmTT1bVHFQVvItGmlCbfe2MAKvPN4wePFCNapC8FrHMxTEOL3se 8ohFUo7alKGndKPm1DDqtQcaVjXUBMjP77VNcJ+K2AbZsrzmkvaYy5bYsaemgXI3iup9 cAlUuSxGUESa/ER/P5xbHfi/HrslYjBuj1m9KZ8Uq6U4UHPTtfpyjVj/uyGfqsaVlfEc vm3cpWX9cwyVUo+Nt/G9sbT+AOkKvjn7GPYNHSsjDCgY6jyCjplWD5eazncWqBVsVDG8 Erzp2VDfqkpwLR4Jy46OLskwFSaINd/jBM3Nczo7DEi7NQXa3khY8wCPZ25CdE0WH258 epXQ== 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=kkxtPSP0Xi4lX5Wx+/32tPbjIn3SdpQg5a9ZAGNqcyg=; b=Ht+TRcH14/yw+NqKY9r5DJdgENeHsMkSOE6MG2j0RzzQrIrDIuMS0FlCgMa75Ej4Sl B2VxsdiRKFzS+QXV/vzqO9H249JFLNvM5+JGh7LXGKHuf11KQnmJcxbnjiNZEZzNP3c9 GVb6f1/4knYte/XT5G59EyxPQBmfmkbrknPwqD80LvWsQTWyt4yPfRDF4K6ki4zj9EXO XtKltzwTRYTSqiJjDwBalK8LEtci8rd/kUZ78CDPeZJknT8Zf/HqZaR29TbRjHpAVc3m /WNP8weU95RI3sFCQLEQ8MksbXoiZbMDH+Q1xUZ7HmCO58AR08q7mUVEl92edF+114Ut mcsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=hYVpWVrI; 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 df24si7017704edb.407.2021.03.08.06.24.52; Mon, 08 Mar 2021 06:25:14 -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=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=hYVpWVrI; 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 S229701AbhCHOXt (ORCPT + 99 others); Mon, 8 Mar 2021 09:23:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbhCHOXn (ORCPT ); Mon, 8 Mar 2021 09:23:43 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F407CC06174A for ; Mon, 8 Mar 2021 06:23:42 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id dm26so14933424edb.12 for ; Mon, 08 Mar 2021 06:23:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kkxtPSP0Xi4lX5Wx+/32tPbjIn3SdpQg5a9ZAGNqcyg=; b=hYVpWVrIwf5fngjt5ImHdSEt8Qlz5tu/Fg3V+OqirMtF96qmwL5uNlEYCt4X1qjaZs Ia64wAB8nNSfK9lkk5ioEzHpyGUkfUaMup2sKVCPja2oHGQdvbXXUIg82G9N0D3gcfz1 P3W2YXR5baN/N63WfysYcZ6m0Te7yNKUNZzga5T/xB3epK+A3HKvnOTq4vqH9F3OUzS0 S+nwJDc6t0GnIRXY0LoKZVp4TE6XldTLzQ4lGrWOHGVmRr2VKFWreBIVmZzCnOzYBKRX 3G1OyWwejQEO8cc5aWGlTHlGx5CxBR4O0v4SxWU74Rd22eTXEsfe5van6md1HZTT0UVx 1zYQ== 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=kkxtPSP0Xi4lX5Wx+/32tPbjIn3SdpQg5a9ZAGNqcyg=; b=RIQG8cGEkiwIXplBc3FkblULOKGL9v68EflNpmnRO88cCUgRj0DaIvdvEFnXzoRRUK dWp9wv78NP3rY/EOHfhpxFk5b7EuHv05hBynpfsL2Q8WPnHXnydfVALZLhBHeQFULN5d jwBenGFSDJJZtK0mb1JYfdGn8AyNwxE1hT2fYJ/D+JaaQteAlljSuC9WdtwwFoH/xZde eDxYcsaMbCY2Ig+XKi37hZVjyzxIk8kppBWMc+ZOW0c3YP37I/GmpqzGnXTv8Ni5Wrkt jq7pSDV+gDZ/Gwl9cFlcSQjDzG6ZicN2Swc0aqWNR8/M/Vlg+17hMvQtb41d4vpcnrMZ Xqgw== X-Gm-Message-State: AOAM532CwQMhYcPx5ZBRB11uY/OmloPJg5Iybrq/C4R/ObDxdWLnMT3J Ja5khGqeVUzNFy86YmtnB4D7GMWAIgRgxv3yzBZH7Q== X-Received: by 2002:a50:ee05:: with SMTP id g5mr22313526eds.164.1615213421770; Mon, 08 Mar 2021 06:23:41 -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 15:23:31 +0100 Message-ID: Subject: Re: [PATCH v2 09/12] gpio: sim: new testing module To: Andy Shevchenko Cc: 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 , Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? If you're not objecting strongly, then I would prefer my version. > ... > > > > > + ida_free(&gpio_sim_ida, id); > > > > > > Isn't it atomic per se? I mean that IDA won't give the same ID until you free > > > it. I.o.w. why is it under the mutex? > > > > > > > You're right but if we rapidly create and destroy chips we'll be left > > with holes in the numbering (because new devices would be created > > before the IDA numbers are freed, so the driver would take a larger > > number that's currently free). It doesn't hurt but it would look worse > > IMO. Do you have a strong opinion on this? > > It's not strong per se, but I would rather follow the 2nd rule of locking: > don't protect something which doesn't need it. > OK, makes sense. > -- > With Best Regards, > Andy Shevchenko > >