Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262601AbTGFQtq (ORCPT ); Sun, 6 Jul 2003 12:49:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262589AbTGFQtq (ORCPT ); Sun, 6 Jul 2003 12:49:46 -0400 Received: from blackbird.intercode.com.au ([203.32.101.10]:12560 "EHLO blackbird.intercode.com.au") by vger.kernel.org with ESMTP id S262601AbTGFQtp (ORCPT ); Sun, 6 Jul 2003 12:49:45 -0400 Date: Mon, 7 Jul 2003 03:03:58 +1000 (EST) From: James Morris To: Davide Libenzi cc: Matthew Wilcox , Patrick Mochel , Subject: Re: kobjects, sysfs and the driver model make my head hurt In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 818 Lines: 33 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/