[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


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 _at_ vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


この情報があなたの探していたものかどうか選択してください。
yes/まさにこれだ!   no/違うなぁ   part/一部見つかった   try/これで試してみる

あなたが探していた情報はどのようなことか、ご自由に記入下さい。特に「まさにこれだ!」と言う場合は記入をお願いします。
例:「複数のマシンからCATV経由でipmasqueradeを利用してWebを参照したい場合の設定について」
Follow-Ups: