[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZxYSEPAVR8JbBx-G@smile.fi.intel.com>
Date: Mon, 21 Oct 2024 11:34:24 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc: linux-kernel@...r.kernel.org, platform-driver-x86@...r.kernel.org,
Hans de Goede <hdegoede@...hat.com>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
Ferry Toth <fntoth@...il.com>
Subject: Re: [PATCH v1 2/3] platform/x86: intel_scu_ipc: Simplify code with
cleanup helpers
On Mon, Oct 21, 2024 at 10:00:05AM +0300, Mika Westerberg wrote:
> On Wed, Oct 16, 2024 at 02:48:25PM +0300, Andy Shevchenko wrote:
> > Use macros defined in linux/cleanup.h to automate resource lifetime
> > control in the driver.
...
> > get_device(&ipcdev->dev);
> > +
>
> unintended whitespace change?
Hmm... I don't remember, probably.
I will remove this part in v2.
...
> > err = intel_scu_ipc_check_status(scu);
> > - if (!err) { /* Read rbuf */
> > - for (nc = 0, offset = 0; nc < 4; nc++, offset += 4)
> > - wbuf[nc] = ipc_data_readl(scu, offset);
> > - memcpy(data, wbuf, count);
> > - }
>
> Here you changed also the check to be for if (err) instead of (!err) so
> at least mention why you did these at the same time you did the cleanup
> change. It is fine by me but good to mention in the commit message.
Yes, this is the part of the cleanup change. It's a byproduct of it.
I will try to mention this in the commit message, however I consider
the text redundant.
...
> > - if (!err) {
> > - u32 outbuf[4] = {};
> > -
> > - for (i = 0; i < outbuflen; i++)
> > - outbuf[i] = ipc_data_readl(scu, 4 * i);
> > -
> > - memcpy(out, outbuf, outlen);
>
> Same here.
Same answer.
> > + if (err) {
> > + dev_err(&scu->dev, "IPC command %#x failed with %d\n", cmdval, err);
> > + return err;
> > }
...
Thank you for the review!
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists