lkml.org 
[lkml]   [2009]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [TIP][RFC 2/7] futex: futex_top_waiter()
    On Mon, 2 Mar 2009, Darren Hart wrote:

    > From: Darren Hart <dvhltc@us.ibm.com>
    >
    > Improve legibility by wrapping finding the top waiter in a function. This
    > will be used by the follow-on patches for enabling requeue pi.
    > +static struct futex_q *futex_top_waiter(struct futex_hash_bucket *hb,
    > + union futex_key *key)

    Can we just have *head as argument instead of *hb ?

    > +{
    > + struct plist_head *head;
    > + struct futex_q *this;
    > + struct futex_q *top_waiter = NULL;

    struct futex_q *this;

    > + head = &hb->chain;
    > + plist_for_each_entry(this, head, list) {
    > + if (match_futex(&this->key, key)) {
    return this;

    > + top_waiter = this;
    > + break;
    > + }
    > + }
    > + return top_waiter;

    return NULL;

    Makes the function half the size.

    Thanks,

    tglx


    \
     
     \ /
      Last update: 2009-03-07 16:21    [W:0.024 / U:1.820 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site