lkml.org 
[lkml]   [2014]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 1/3] qspinlock: Introducing a 4-byte queue spinlock implementation
On Mon, Feb 17, 2014 at 03:41:22PM -0500, Waiman Long wrote:
> +#define _QCODE(lock) (atomic_read(&(lock)->qlcode) >> _QCODE_OFFSET)
> +#define _QLOCK(lock) (atomic_read(&(lock)->qlcode) & _QSPINLOCK_LOCKED)

> +#define GET_QN_IDX(code) (((code) >> _QCODE_VAL_OFFSET) & 3)
> +#define GET_CPU_NR(code) (((code) >> (_QCODE_VAL_OFFSET + 2)) - 1)
> +#ifndef _SET_QCODE
> +#define _SET_QCODE(cpu, idx) ((((cpu) + 1) << (_QCODE_VAL_OFFSET + 2)) |\
> + ((idx) << _QCODE_VAL_OFFSET) |\


Someone please take the CPP away.. dude most this doesn't need to be a
macro. Its used only in 1 or two places and its utterly unreadable.


\
 
 \ /
  Last update: 2014-02-18 09:21    [W:0.301 / U:1.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site