lkml.org 
[lkml]   [2012]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/10] cgroups: add res_counter_write_u64() API
On Wed, Feb 01, 2012 at 04:37:41AM +0100, Frederic Weisbecker wrote:
> +#if BITS_PER_LONG == 32
> +void res_counter_write_u64(struct res_counter *counter, int member, u64 val)
> +{
> + unsigned long long *target;
> + unsigned long flags;
> +
> + spin_lock_irqsave(&counter->lock, flags);
> + target = res_counter_member(counter, member);
> + *target = val;

Nitpick: What's the point to have temporary variable here?

> + spin_unlock_irqrestore(&counter->lock, flags);
> +}
> +#else
> +void res_counter_write_u64(struct res_counter *counter, int member, u64 val)
> +{
> + unsigned long long *target;
> +
> + target = res_counter_member(counter, member);
> + *target = val;

Ditto.

> +}
> +#endif

--
Kirill A. Shutemov


\
 
 \ /
  Last update: 2012-02-02 13:35    [W:0.200 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site