From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <53A93E25.2090209@nsn.com> Date: Tue, 24 Jun 2014 11:00:21 +0200 From: Alexander Sverdlin MIME-Version: 1.0 Subject: Re: [PATCH 5/6] OF: Utility helper functions for dynamic nodes References: <1403430039-15085-1-git-send-email-pantelis.antoniou@konsulko.com> <1403430039-15085-6-git-send-email-pantelis.antoniou@konsulko.com> <53A85549.7040809@nsn.com> <6E91A461-4361-4A18-BE32-CECDD789C114@konsulko.com> <20140623183343.GA10389@heimdall> <78ACBAF6-A73E-4272-8D3A-258C4B10858C@konsulko.com> <53A93304.9000604@nsn.com> <53A93907.6070408@nsn.com> <2CAE7215-7D2D-454A-A6FD-6E93FAE8F1F7@konsulko.com> In-Reply-To: <2CAE7215-7D2D-454A-A6FD-6E93FAE8F1F7@konsulko.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit To: ext Pantelis Antoniou Cc: Ioan Nicu , Grant Likely , Rob Herring , Stephen Warren , Matt Porter , Koen Kooi , Greg Kroah-Hartman , Alison Chaiken , Dinh Nguyen , Jan Lubbe , Michael Stickel , Guenter Roeck , Dirk Behme , Alan Tull , Sascha Hauer , Michael Bohan , Michal Simek , Matt Ranostay , Joel Becker , devicetree@vger.kernel.org, Wolfram Sang , linux-i2c@vger.kernel.org, Mark Brown , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Pete Popov , Dan Malek , Georgi Vlaev List-ID: Hi! On 24/06/14 10:54, ext Pantelis Antoniou wrote: > The fact of the matter is that use of of_get_property() where the intended use is to check > for the existence of a property (that might be empty) is incorrect IMO. of_find_property might > work, as well as the more correct form, where we know the property is a boolean, of_property_read_bool(). > > The pointer returned from of_get_property() is not usable in any form. Whether it does > contains a NULL or not value is immaterial. That it works at all is a side-effect of how the > flattening code assigns value pointers. > > My vote is to just fix all the call sites using this questionable idiom. I fully agree with you here, this assumption that value!=NULL is simply not obvious. Let's wait, what Grant says, I can prepare a tree-wide patch, I think... -- Best regards, Alexander Sverdlin.