Re: [Regression, post-2.6.34-rc1][PATCH] x86 / perf: Fix suspend to RAM on HP nx6325

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Sunday, March 21, 2010 - 10:31 am

On Sat, 20 Mar 2010, Rafael J. Wysocki wrote:

Please don't use a 'goto' for something like this.


Just do

	raw_spin_lock(&amd_nb_lock);
	if (cpuhw->amd_nb) {
		if (!--cpuhw->amd_nb->refcnt)
			kfree(cpuhw->amd_nb);
		cpuhw->amd_nb = NULL;
	}
	raw_spin_unlock(&amd_nb_lock);

instead. Much more readable.

Let's keep 'goto' for cases where we have error returns that we don't want 
to nest, not trivial stuff like this.

		Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[Regression, post-2.6.34-rc1][PATCH] x86 / perf: Fix suspe ..., Rafael J. Wysocki, (Sat Mar 20, 7:07 am)
Re: [Regression, post-2.6.34-rc1][PATCH] x86 / perf: Fix s ..., Rafael J. Wysocki, (Sat Mar 20, 1:48 pm)
Re: [Regression, post-2.6.34-rc1][PATCH] x86 / perf: Fix s ..., Linus Torvalds, (Sun Mar 21, 10:31 am)
Re: [Regression, post-2.6.34-rc1][PATCH] x86 / perf: Fix s ..., Rafael J. Wysocki, (Sun Mar 21, 1:51 pm)