Re: [RFC PATCH v1] refining the rpm_suspend function

From: Pavel Machek
Date: Tue Jan 19 2016 - 14:55:04 EST


Hi!

> + else{

missing space.

> + while (dev->power.runtime_status ==
> + RPM_SUSPENDING) {
> + if (dev->power.irq_safe) {
> + spin_unlock(&dev->power.lock);
> +
> + cpu_relax();
> +
> + spin_lock(&dev->power.lock);
> + continue;
> + }
> +
> + /* Wait for the other suspend
> + running in parallel with us. */
> + for (;;) {
> + prepare_to_wait(&dev->power.wait_queue,
> + &wait, TASK_UNINTERRUPTIBLE);
> + if (dev->power.runtime_status
> + != RPM_SUSPENDING)
> + break;

You really need to restructure the code so that you don't get
indentation _this_ deep.


> - might_sleep_if(!(rpmflags & RPM_ASYNC) && !dev->power.irq_safe);
> + might_sleep_if (!(rpmflags & RPM_ASYNC) && !dev->power.irq_safe);

Original was right. Function -> no space.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html