[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c96a6a99-5638-76c6-358e-e355f0f6b114@linux.intel.com>
Date: Thu, 22 Oct 2020 16:50:04 +0300
From: Jarkko Nikula <jarkko.nikula@...ux.intel.com>
To: Michael Wu <michael.wu@...ics.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Morgan Chang <morgan.chang@...ics.com>
Subject: Re: [PATCH v2] i2c: designware: call
i2c_dw_read_clear_intrbits_slave() once
Hi
On 10/22/20 8:46 AM, Michael Wu wrote:
> @@ -217,10 +214,8 @@ static int i2c_dw_irq_handler_slave(struct dw_i2c_dev *dev)
> if (!i2c_slave_event(dev->slave, I2C_SLAVE_WRITE_RECEIVED,
> &val))
> dev_vdbg(dev->dev, "Byte %X acked!", val);
> - } else {
> + } else
> i2c_slave_event(dev->slave, I2C_SLAVE_STOP, &val);
> - stat = i2c_dw_read_clear_intrbits_slave(dev);
> - }
>
Minor nit. Please don't remove braces here since the upper part of if
statement has them.
From Documentation/process/coding-style.rst:
"
This does not apply if only one branch of a conditional statement is a
single
statement; in the latter case use braces in both branches:
.. code-block:: c
if (condition) {
do_this();
do_that();
} else {
otherwise();
}
"
Otherwise looks good to me.
Jarkko
Powered by blists - more mailing lists