lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 03 Mar 2009 16:32:48 +0100
From:	Stefan Richter <stefanr@...6.in-berlin.de>
To:	Jean Delvare <khali@...ux-fr.org>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Oleg Nesterov <oleg@...sign.ru>,
	David Howells <dhowells@...hat.com>
Subject: Re: [PATCH] Add to_delayed_work macro

Jean Delvare wrote:
> On Tue, 3 Mar 2009 00:29:52 -0800, Andrew Morton wrote:
>> On Tue, 3 Mar 2009 08:34:40 +0100 Jean Delvare <khali@...ux-fr.org> wrote:
>> 
>> > +#define to_delayed_work(_work)	container_of(_work, struct delayed_work, work)
>> 
>> As this is specifically designed to operate on a `struct work*', as
>> opposed to "any struct which has a field called `work'", we can get
>> additional type-safety by putting a C interface around it.
> 
> This is what I wanted to do in the first place, but then I noticed that
> _all_ such wrappers around container_of are implemented as macros
> rather than inline functions.

/Almost/ all.

http://lxr.linux.no/linux+v2.6.28/drivers/firewire/fw-device.h#L73

> So I decided to follow the crowd. Any idea why it is so?

Merely old habits.
-- 
Stefan Richter
-=====-==--= --== ---==
http://arcgraph.de/sr/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ