[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.11.1503300743080.2887@gentwo.org>
Date: Mon, 30 Mar 2015 07:44:30 -0500 (CDT)
From: Christoph Lameter <cl@...ux.com>
To: Steven Rostedt <rostedt@...dmis.org>
cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
stable@...r.kernel.org,
Uwe Kleine-Koenig <u.kleine-koenig@...gutronix.de>
Subject: Re: [for-next][PATCH 1/4] ring-buffer: Replace this_cpu_*() with
__this_cpu_*()
On Fri, 27 Mar 2015, Steven Rostedt wrote:
> Where in the patch do you see the comment? Or were you talking about
> the change log? The original patch did have a comment, an it was
> dropped, that's what I thought you were talking about.
Sorry yes the changelog.
> Actually, it is equivalent, but I do see a issue with my patch.
>
> val &= val & (val - 1);
>
> is the same as the more reasonable:
>
> val &= val - 1;
>
> I think I meant to replace &= with = :-/
>
> >
> > or more compact
> >
> > unsigned int val = __this_cpu_read(current_context);
> >
> > __this_cpu_write(current_context, val & (val - 1));
>
> Maybe I'll just use your compact version.
Hmmm... It could even be more compact
__this_cpu_and(current_context, __this_cpu_read(current_context) - 1);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists