All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-kernel@vger.kernel.org, Peter Huewe <peterhuewe@gmx.de>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	Jason Gunthorpe <jgg@ziepe.ca>, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Gregory Fong <gregory.0xf0@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	bcm-kernel-feedback-list@broadcom.com,
	Sekhar Nori <nsekhar@ti.com>, Kevin Hilman <khilman@kernel.org>,
	Haavard Skinnemoen <hskinnemoen@gmail.com>,
	Kukjin Kim <kgene@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Orson Zhai <orsonzhai@gmail.com>,
	Baolin Wang <baolin.wang@linaro.org>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Laxman Dewangan <ldewangan@nvidia.com>,
	Thierry Reding <thierry.reding@gmail.com>
Subject: Re: [PATCH 01/11] i2c: add helpers for locking the I2C segment
Date: Mon, 18 Jun 2018 13:32:47 +0200	[thread overview]
Message-ID: <b860025e-3d4b-f333-80b4-3831dd969757@axentia.se> (raw)
In-Reply-To: <20180618110502.cb5s24srp4frahm6@ninjato>

On 2018-06-18 13:05, Wolfram Sang wrote:
> 
>> +static inline void
>> +i2c_lock_segment(struct i2c_adapter *adapter)
>> +{
>> +	i2c_lock_bus(adapter, I2C_LOCK_SEGMENT);
>> +}
>> +
>> +static inline int
>> +i2c_trylock_segment(struct i2c_adapter *adapter)
>> +{
>> +	return i2c_trylock_bus(adapter, I2C_LOCK_SEGMENT);
>> +}
>> +
>> +static inline void
>> +i2c_unlock_segment(struct i2c_adapter *adapter)
>> +{
>> +	i2c_unlock_bus(adapter, I2C_LOCK_SEGMENT);
>> +}
> 
> I wonder if i2c_lock_segment() and i2c_lock_root_adapter() are really
> more readable and convenient than i2c_lock_bus() with the flag. I think
> the flags have speaking names, too.
> 
> Is that an idea to remove these functions altogether and start using
> i2c_lock_bus()?

That would be fine with me. I don't have a strong opinion and agree that
both are readable enough...

It would make for a reduction of the number of lines so that's nice, but
the macro in drivers/i2c/busses/i2c-gpio.c (patch 11) would not fit in
the current \-width (or whatever you'd call that line of backslashes to
the right in a multi-line macro).

Does anyone have a strong opinion?

Cheers,
Peter

WARNING: multiple messages have this Message-ID (diff)
From: Peter Rosin <peda@axentia.se>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-kernel@vger.kernel.org, Peter Huewe <peterhuewe@gmx.de>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	Jason Gunthorpe <jgg@ziepe.ca>, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Gregory Fong <gregory.0xf0@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	bcm-kernel-feedback-list@broadcom.com,
	Sekhar Nori <nsekhar@ti.com>, Kevin Hilman <khilman@kernel.org>,
	Haavard Skinnemoen <hskinnemoen@gmail.com>,
	Kukjin Kim <kgene@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Orson Zhai <orsonzhai@gmail.com>,
	Baolin Wang <baolin.wang@linaro.org>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Laxman Dewangan <ldewangan@nvidia.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Guenter Roeck <linux@roeck-us.net>, Crt Mori <cmo@melexis.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Antti Palosaari <crope@iki.fi>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Michael Krufky <mkrufky@linuxtv.org>,
	Lee Jones <lee.jones@linaro.org>,
	linux-integrity@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-iio@vger.kernel.org, linux-input@vger.kernel.org,
	linux-media@vger.kernel.org
Subject: Re: [PATCH 01/11] i2c: add helpers for locking the I2C segment
Date: Mon, 18 Jun 2018 13:32:47 +0200	[thread overview]
Message-ID: <b860025e-3d4b-f333-80b4-3831dd969757@axentia.se> (raw)
In-Reply-To: <20180618110502.cb5s24srp4frahm6@ninjato>

On 2018-06-18 13:05, Wolfram Sang wrote:
> 
>> +static inline void
>> +i2c_lock_segment(struct i2c_adapter *adapter)
>> +{
>> +	i2c_lock_bus(adapter, I2C_LOCK_SEGMENT);
>> +}
>> +
>> +static inline int
>> +i2c_trylock_segment(struct i2c_adapter *adapter)
>> +{
>> +	return i2c_trylock_bus(adapter, I2C_LOCK_SEGMENT);
>> +}
>> +
>> +static inline void
>> +i2c_unlock_segment(struct i2c_adapter *adapter)
>> +{
>> +	i2c_unlock_bus(adapter, I2C_LOCK_SEGMENT);
>> +}
> 
> I wonder if i2c_lock_segment() and i2c_lock_root_adapter() are really
> more readable and convenient than i2c_lock_bus() with the flag. I think
> the flags have speaking names, too.
> 
> Is that an idea to remove these functions altogether and start using
> i2c_lock_bus()?

That would be fine with me. I don't have a strong opinion and agree that
both are readable enough...

It would make for a reduction of the number of lines so that's nice, but
the macro in drivers/i2c/busses/i2c-gpio.c (patch 11) would not fit in
the current \-width (or whatever you'd call that line of backslashes to
the right in a multi-line macro).

Does anyone have a strong opinion?

Cheers,
Peter

WARNING: multiple messages have this Message-ID (diff)
From: peda@axentia.se (Peter Rosin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/11] i2c: add helpers for locking the I2C segment
Date: Mon, 18 Jun 2018 13:32:47 +0200	[thread overview]
Message-ID: <b860025e-3d4b-f333-80b4-3831dd969757@axentia.se> (raw)
In-Reply-To: <20180618110502.cb5s24srp4frahm6@ninjato>

On 2018-06-18 13:05, Wolfram Sang wrote:
> 
>> +static inline void
>> +i2c_lock_segment(struct i2c_adapter *adapter)
>> +{
>> +	i2c_lock_bus(adapter, I2C_LOCK_SEGMENT);
>> +}
>> +
>> +static inline int
>> +i2c_trylock_segment(struct i2c_adapter *adapter)
>> +{
>> +	return i2c_trylock_bus(adapter, I2C_LOCK_SEGMENT);
>> +}
>> +
>> +static inline void
>> +i2c_unlock_segment(struct i2c_adapter *adapter)
>> +{
>> +	i2c_unlock_bus(adapter, I2C_LOCK_SEGMENT);
>> +}
> 
> I wonder if i2c_lock_segment() and i2c_lock_root_adapter() are really
> more readable and convenient than i2c_lock_bus() with the flag. I think
> the flags have speaking names, too.
> 
> Is that an idea to remove these functions altogether and start using
> i2c_lock_bus()?

That would be fine with me. I don't have a strong opinion and agree that
both are readable enough...

It would make for a reduction of the number of lines so that's nice, but
the macro in drivers/i2c/busses/i2c-gpio.c (patch 11) would not fit in
the current \-width (or whatever you'd call that line of backslashes to
the right in a multi-line macro).

Does anyone have a strong opinion?

Cheers,
Peter

  reply	other threads:[~2018-06-18 11:32 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-15 10:14 [PATCH 00/11] Split i2c_lock_adapter into i2c_lock_root and i2c_lock_segment Peter Rosin
2018-06-15 10:14 ` Peter Rosin
2018-06-15 10:14 ` Peter Rosin
2018-06-15 10:14 ` [PATCH 01/11] i2c: add helpers for locking the I2C segment Peter Rosin
2018-06-15 10:14   ` Peter Rosin
2018-06-15 10:14   ` Peter Rosin
2018-06-18 11:05   ` Wolfram Sang
2018-06-18 11:05     ` Wolfram Sang
2018-06-18 11:05     ` Wolfram Sang
2018-06-18 11:05     ` Wolfram Sang
2018-06-18 11:32     ` Peter Rosin [this message]
2018-06-18 11:32       ` Peter Rosin
2018-06-18 11:32       ` Peter Rosin
2018-06-18 11:54       ` Wolfram Sang
2018-06-18 11:54         ` Wolfram Sang
2018-06-18 11:54         ` Wolfram Sang
2018-06-18 11:54         ` Wolfram Sang
2018-06-19 21:29         ` Peter Rosin
2018-06-19 21:29           ` Peter Rosin
2018-06-19 21:29           ` Peter Rosin
2018-06-15 10:14 ` [PATCH 02/11] tpm/tpm_i2c_infineon: switch to i2c_lock_segment Peter Rosin
2018-06-15 10:14   ` Peter Rosin
2018-06-15 10:14   ` Peter Rosin
2018-06-19 12:56   ` Jarkko Sakkinen
2018-06-19 12:56     ` Jarkko Sakkinen
2018-06-19 12:56     ` Jarkko Sakkinen
2018-06-19 13:05     ` Peter Rosin
2018-06-19 13:05       ` Peter Rosin
2018-06-19 13:05       ` Peter Rosin
2018-06-15 10:14 ` [PATCH 03/11] i2c: mux: pca9541: " Peter Rosin
2018-06-15 10:14   ` Peter Rosin
2018-06-15 10:14   ` Peter Rosin
2018-06-15 10:14 ` [PATCH 04/11] input: rohm_bu21023: " Peter Rosin
2018-06-15 10:14   ` Peter Rosin
2018-06-15 10:14   ` Peter Rosin
2018-06-19 18:40   ` Dmitry Torokhov
2018-06-19 18:40     ` Dmitry Torokhov
2018-06-19 18:40     ` Dmitry Torokhov
2018-06-15 10:15 ` [PATCH 05/11] media: af9013: " Peter Rosin
2018-06-15 10:15   ` Peter Rosin
2018-06-15 10:15   ` Peter Rosin
2018-06-15 10:15 ` [PATCH 06/11] media: drxk_hard: " Peter Rosin
2018-06-15 10:15   ` Peter Rosin
2018-06-15 10:15   ` Peter Rosin
2018-06-15 10:15 ` [PATCH 07/11] media: rtl2830: " Peter Rosin
2018-06-15 10:15   ` Peter Rosin
2018-06-15 10:15   ` Peter Rosin
2018-06-15 10:15 ` [PATCH 08/11] media: tda1004x: " Peter Rosin
2018-06-15 10:15   ` Peter Rosin
2018-06-15 10:15   ` Peter Rosin
2018-06-15 10:15 ` [PATCH 09/11] media: tda18271: " Peter Rosin
2018-06-15 10:15   ` Peter Rosin
2018-06-15 10:15   ` Peter Rosin
2018-06-15 10:15 ` [PATCH 10/11] mfd: 88pm860x-i2c: " Peter Rosin
2018-06-15 10:15   ` Peter Rosin
2018-06-15 10:15   ` Peter Rosin
2018-06-15 10:15 ` [PATCH 11/11] i2c: rename i2c_lock_adapter to i2c_lock_root Peter Rosin
2018-06-15 10:15   ` Peter Rosin
2018-06-15 10:15   ` Peter Rosin
2018-06-18 11:06 ` [PATCH 00/11] Split i2c_lock_adapter into i2c_lock_root and i2c_lock_segment Wolfram Sang
2018-06-18 11:06   ` Wolfram Sang
2018-06-18 11:06   ` Wolfram Sang
2018-06-18 11:06   ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b860025e-3d4b-f333-80b4-3831dd969757@axentia.se \
    --to=peda@axentia.se \
    --cc=arnd@arndb.de \
    --cc=baolin.wang@linaro.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=computersforpeace@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gregory.0xf0@gmail.com \
    --cc=hskinnemoen@gmail.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jgg@ziepe.ca \
    --cc=kgene@kernel.org \
    --cc=khilman@kernel.org \
    --cc=krzk@kernel.org \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=orsonzhai@gmail.com \
    --cc=peterhuewe@gmx.de \
    --cc=thierry.reding@gmail.com \
    --cc=wsa@the-dreams.de \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.