Re: [PATCH v1 2/3] platform/x86: intel_scu_ipc: Simplify code with cleanup helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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






[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux