mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Morris <jmorris@intercode.com.au>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Matthew Wilcox <willy@debian.org>,
	Patrick Mochel <mochel@osdl.org>, <linux-kernel@vger.kernel.org>
Subject: Re: kobjects, sysfs and the driver model make my head hurt
Date: Mon, 7 Jul 2003 03:03:58 +1000 (EST)	[thread overview]
Message-ID: <Mutt.LNX.4.44.0307070300180.930-100000@excalibur.intercode.com.au> (raw)
In-Reply-To: <Pine.LNX.4.55.0307060935140.14675@bigblue.dev.mcafeelabs.com>

On Sun, 6 Jul 2003, Davide Libenzi wrote:

> On Sun, 6 Jul 2003, Matthew Wilcox wrote:
> 
> > Why on earth does it return the value of its argument?
> 
> Maybe for the same reason 'strcpy' returns 'dest'. It allows you to use
> the function in a function parameter :

It also makes calling code cleaner when copying refcounted objects:

e.g.
	new->foo = foo_get(old->foo);
	new->bar = bar_get(old->bar);

otherwise, you'd have to do:

	foo_get(old->foo);
	new->foo = old->foo;
	bar_get(old->bar);
	new->bar = old->bar;


- James
-- 
James Morris
<jmorris@intercode.com.au>


  reply	other threads:[~2003-07-06 16:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-06 16:33 Matthew Wilcox
2003-07-06 16:42 ` Davide Libenzi
2003-07-06 17:03   ` James Morris [this message]
2003-07-06 17:15     ` Jeff Garzik
2003-07-07  7:05   ` Johan.Adolfsson
2003-07-06 16:46 ` Greg KH
2003-07-06 16:54   ` Jeff Garzik

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=Mutt.LNX.4.44.0307070300180.930-100000@excalibur.intercode.com.au \
    --to=jmorris@intercode.com.au \
    --cc=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    --cc=willy@debian.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®