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, 29 Oct 2013 20:18:03 +0100
From:	Lars-Peter Clausen <lars@...afoo.de>
To:	Stephen Boyd <sboyd@...eaurora.org>
CC:	Josh Cartwright <joshc@...eaurora.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-arm-msm@...r.kernel.org,
	Sagar Dharia <sdharia@...eaurora.org>,
	Gilad Avidov <gavidov@...eaurora.org>,
	Michael Bohan <mbohan@...eaurora.org>,
	"Ivan T. Ivanov" <iivanov@...sol.com>
Subject: Re: [PATCH v3 02/10] spmi: Linux driver framework for SPMI

On 10/29/2013 05:30 PM, Stephen Boyd wrote:
> On 10/29/13 08:56, Josh Cartwright wrote:
>>
>>>> +#define to_spmi_controller(d) container_of(d, struct spmi_controller, dev)
>>> Should be a inline function for better type safety.
>> Sounds good.  Will change the to_spmi_*() macros.
> 
> I was under the impression that container_of() already does type
> checking. At least it will ensure that typeof(d) == typeof(dev) in the
> above example which is about as good as it can get.

Well you'll get a warning, but the quality of the warning message is much
better when an inline function is used.

warning: initialization from incompatible pointer type

vs.

warning: Passing argument 1 of to_smpi_controller() from incompatible
pointer type. Expected struct device * got struct driver *


- Lars
--
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