[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <zblc42zoivn3ofoe2ymqm2bar3ffiujzknqzm54ww5mi26oq32@25cjisrx274e>
Date: Wed, 11 Sep 2024 10:24:29 +0200
From: Andi Shyti <andi.shyti@...nel.org>
To: "Guntupalli, Manikanta" <manikanta.guntupalli@....com>
Cc: "git (AMD-Xilinx)" <git@....com>,
"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>, "linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Simek, Michal" <michal.simek@....com>,
"Pandey, Radhey Shyam" <radhey.shyam.pandey@....com>, "Goud, Srinivas" <srinivas.goud@....com>,
"Datta, Shubhrajyoti" <shubhrajyoti.datta@....com>, "manion05gk@...il.com" <manion05gk@...il.com>
Subject: Re: [PATCH 3/3] i2c: cadence: Add atomic transfer support for
controller version 1.4
Hi Manikanta,
> > > if (msg_timeout < adap->timeout)
> > > msg_timeout = adap->timeout;
> > >
> > > - /* Wait for the signal of completion */
> > > - time_left = wait_for_completion_timeout(&id->xfer_done, msg_timeout);
> > > + if (!id->atomic) {
> > > + /* Wait for the signal of completion */
> > > + time_left = wait_for_completion_timeout(&id->xfer_done,
> > msg_timeout);
> > > + } else {
> > > + /* 0 is success, -ETIMEDOUT is error */
> > > + time_left = !readl_poll_timeout_atomic(id->membase +
> > CDNS_I2C_ISR_OFFSET,
> > > + reg, (reg & CDNS_I2C_IXR_COMP),
> > > + CDNS_I2C_POLL_US_ATOMIC,
> > msg_timeout);
> > > + }
> >
> > You can merge this if/else with the one above, to save some code.
> Thank you for your suggestion to merge the if/else blocks to streamline the code. We have considered this approach; however, merging them would necessitate duplicating the following lines in both the if and else blocks:
> if (msg_timeout < adap->timeout)
> msg_timeout = adap->timeout;
OK, makes sense, I didn't see it.
Thanks,
Andi
Powered by blists - more mailing lists