mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Ferry Toth" <fntoth@gmail.com>
Subject: Re: [PATCH v1 2/3] platform/x86: intel_scu_ipc: Simplify code with cleanup helpers
Date: Mon, 21 Oct 2024 11:34:24 +0300	[thread overview]
Message-ID: <ZxYSEPAVR8JbBx-G@smile.fi.intel.com> (raw)
In-Reply-To: <20241021070005.GW275077@black.fi.intel.com>

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



  reply	other threads:[~2024-10-21  8:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-16 11:48 [PATCH v1 0/3] platform/x86: intel_scu_ipc: Avoid working around IO and cleanups Andy Shevchenko
2024-10-16 11:48 ` [PATCH v1 1/3] platform/x86: intel_scu_ipc: Replace workaround by 32-bit IO Andy Shevchenko
2024-10-16 11:48 ` [PATCH v1 2/3] platform/x86: intel_scu_ipc: Simplify code with cleanup helpers Andy Shevchenko
2024-10-21  7:00   ` Mika Westerberg
2024-10-21  8:34     ` Andy Shevchenko [this message]
2024-10-16 11:48 ` [PATCH v1 3/3] platform/x86: intel_scu_ipc: Save a copy of the entire struct intel_scu_ipc_data Andy Shevchenko
2024-10-21  7:00   ` Mika Westerberg
2024-10-17 21:10 ` [PATCH v1 0/3] platform/x86: intel_scu_ipc: Avoid working around IO and cleanups Ferry Toth

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=ZxYSEPAVR8JbBx-G@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=fntoth@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®