Re: [rfc/patch] wake_up_info() draft ...

From: John Gardiner Myers
Date: Thu Jan 01 2004 - 16:40:27 EST


Minor issues:

I don't know why dup_wait_info() returns a value--it is always ignored. If duping can fail, the situation is not particularly recoverable.

I don't like that the dup method is responsible for copying the dup and dtor members of struct __wait_info. It would be simpler for the common code in dup_wait_info() to always copy the dup and dtor function pointers:

void * (*dup)(void *);

static inline void dup_wait_info(wait_info_t *s, wait_info_t *d)
{
close_wait_info(d);
*d = *s;
if (s->dup)
d->data = s->dup(s->data);
}

I prefer the style where assignment functions, such as dup_wait_info(), place the destination argument to the left of the source, to mimic the assignment operator and functions such as strcpy().

remove_wait_queue_info() could be optimized slightly by transferring ownership of the wait queue info data instead of duping it.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/