[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e7773ecc-f6ef-add7-b265-c95cd5089b13@gmail.com>
Date: Sun, 6 Sep 2020 01:54:43 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: Michał Mirosław <mirq-linux@...e.qmqm.pl>
Cc: Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Laxman Dewangan <ldewangan@...dia.com>,
Wolfram Sang <wsa@...-dreams.de>,
Andy Shevchenko <andy.shevchenko@...il.com>,
linux-i2c@...r.kernel.org, linux-tegra@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 16/31] i2c: tegra: Remove "dma" variable from
tegra_i2c_xfer_msg()
06.09.2020 01:49, Michał Mirosław пишет:
> On Sun, Sep 06, 2020 at 01:36:20AM +0300, Dmitry Osipenko wrote:
>> 06.09.2020 01:23, Michał Mirosław пишет:
>>> On Sat, Sep 05, 2020 at 11:41:36PM +0300, Dmitry Osipenko wrote:
>>>> The "dma" variable of tegra_i2c_xfer_msg() function doesn't bring much in
>>>> regards to readability and generation of the code, hence let's remove it
>>>> to clean up code a tad.
>>> [...]
>>>> --- a/drivers/i2c/busses/i2c-tegra.c
>>>> +++ b/drivers/i2c/busses/i2c-tegra.c
>>> [...]
>>>> + if (i2c_dev->is_curr_dma_xfer) {
>>> [...]
>>>
>>> In this case I like the previous code better: just because there are
>>> less letters to read. :-)
>>
>> Besides readability, I also don't like much that the is_curr_dma_xfer is
>> initialized in tegra_i2c_xfer_msg() and then could be overridden by
>> tegra_i2c_config_fifo_trig(). In a result the "dma" variable confuses me
>> since it's not instantly obvious why it's set after
>> tegra_i2c_config_fifo_trig().
>>
>> Looking at the final result, I think it's better to have the variable
>> removed. It makes code more consistent, IMO.
>
> If it could be changed in some callee, then indeed it is better. In this
> case I would include this information in the commit msg.
That's a good suggestion, thanks.
Powered by blists - more mailing lists