Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1895761pxb; Fri, 5 Mar 2021 02:17:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNVUUl/5Cbe+i7xGnDANSc9njOqR2W8e414U7o3hz3S39g3Y6Td+RCzffqiqbavDx1o4iF X-Received: by 2002:aa7:c843:: with SMTP id g3mr8586173edt.228.1614939455801; Fri, 05 Mar 2021 02:17:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614939455; cv=none; d=google.com; s=arc-20160816; b=BaEuLizegeTIcCL6yCq4T/t9uR8nijRiGYiiOaHIiXpUSe8mBXTRlobKGjFm5P2maV ZKWMnXM3BKfyvLPP2bkiXd0Z3hmkT0FakLEFwiPaZZzhiichHJx0Hvo+ZcgWeSodT1Gh t6wDJvJ8iacRFIQTsXZlthFH7j0Bce/d5hSzChdpo8rWyOaLkj+ptuE+5xnTe0iGgYrd nb9XN/qfX1oqzfRwjNAocICHTRoX4G/Mg/y+XymOEey2cjY6TMuuS/ScUpzZceTd+dXE 7jYXxWdcNbcAEsd0RAxs+mgeSezrB+yQz++CXshB1WY/b4mdlepnlGBFtj6meDS1Nfe7 HWxg== 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=aurhbmJkwSYY7LKagvCBIxCbnF89oeMY8IwpujKwroI=; b=PbxaAADDCt1nhfwRfFkizbtuwixvTjKvJzNjEkLyBym02oh8FqCjBEXA9tPFmuM2/x 7kBAYgyZs1otbFh3hN9MwYCVn4KMZ06brvuR0vWarVzOEw3mvpL4MahvDsqmRtvKVwLd mOHu7ftLgTbtXv+zkDotJRDRudtUd7pevQBoUx6CVg8c05t/ZxlzhKhNrXBSOl2dnlAb BEkK2GAz1gQZsnEp0fhZFH0rR+QpogOv2/GBraPCigKNbAJBBcICohRUJ8Nkf6BctUx5 CeIpD1FZuTsTQKOKJMr8y2XF/kb6yAn5rtrZNMecSjo7P6uQkKKIqMeBwP+5bqJuR6jP 96hQ== 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 eb13si1364928edb.315.2021.03.05.02.17.13; Fri, 05 Mar 2021 02:17:35 -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 S229737AbhCEKQU (ORCPT + 99 others); Fri, 5 Mar 2021 05:16:20 -0500 Received: from mga01.intel.com ([192.55.52.88]:34292 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbhCEKP5 (ORCPT ); Fri, 5 Mar 2021 05:15:57 -0500 IronPort-SDR: 3wj5ckNR7w0tAJBPEmy+8wJegF72IaIq2ivtptDDGBQ20blAQ0DvkwvCGZ1J3oZHUUTctWLiG9 WkFvibN6QCpA== X-IronPort-AV: E=McAfee;i="6000,8403,9913"; a="207350999" X-IronPort-AV: E=Sophos;i="5.81,224,1610438400"; d="scan'208";a="207350999" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Mar 2021 02:15:56 -0800 IronPort-SDR: 4JQ/n/U/IuvIlsol9GHIdnLW+MU3AqyT50k04T0YmbnTz7bzKYz/1OY7k13ZYYhBatUaWMLnzv hNQkMM9zcm/Q== X-IronPort-AV: E=Sophos;i="5.81,224,1610438400"; d="scan'208";a="507950970" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Mar 2021 02:15:54 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lI7Us-00A5yl-N6; Fri, 05 Mar 2021 12:15:50 +0200 Date: Fri, 5 Mar 2021 12:15:50 +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 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'. ... > > > + 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. -- With Best Regards, Andy Shevchenko