All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Gardiner Myers <jgmyers@speakeasy.net>
To: linux-kernel@vger.kernel.org
Subject: Re: [rfc/patch] wake_up_info() draft ...
Date: Thu, 01 Jan 2004 13:31:41 -0800	[thread overview]
Message-ID: <3FF491BD.5060806@speakeasy.net> (raw)
In-Reply-To: <fa.nd6oiha.q2gq9k@ifi.uio.no>

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.



       reply	other threads:[~2004-01-01 21:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.nd6oiha.q2gq9k@ifi.uio.no>
2004-01-01 21:31 ` John Gardiner Myers [this message]
2004-01-01 22:57   ` [rfc/patch] wake_up_info() draft Davide Libenzi
2004-01-02  2:54 Manfred Spraul
2004-01-02  3:31 ` Davide Libenzi
2004-01-02  9:32   ` Manfred Spraul
2004-01-02 17:07     ` Davide Libenzi
  -- strict thread matches above, loose matches on Subject: below --
2004-01-01  3:46 Davide Libenzi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FF491BD.5060806@speakeasy.net \
    --to=jgmyers@speakeasy.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.