Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752263AbaKDWjw (ORCPT ); Tue, 4 Nov 2014 17:39:52 -0500 Received: from v094114.home.net.pl ([79.96.170.134]:50042 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752018AbaKDWju (ORCPT ); Tue, 4 Nov 2014 17:39:50 -0500 From: "Rafael J. Wysocki" To: Timur Tabi Cc: Mika Westerberg , Linus Walleij , Alexandre Courbot , Heikki Krogerus , Mathias Nyman , Ning Li , Alan Cox , lkml Subject: Re: [PATCH v2 0/2] pinctrl: Intel Cherryview/Braswell support Date: Wed, 05 Nov 2014 00:00:35 +0100 Message-ID: <2332194.vp9vAagaFD@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/3.16.0-rc5+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <54595416.1020205@codeaurora.org> References: <1415012493-134561-1-git-send-email-mika.westerberg@linux.intel.com> <4886671.cQ44SiRoEW@vostro.rjw.lan> <54595416.1020205@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, November 04, 2014 04:32:54 PM Timur Tabi wrote: > On 11/04/2014 04:47 PM, Rafael J. Wysocki wrote: > > What exactly do you need the size of the property alone for? > > There are lots of situations where you don't know the size of the > property in advance (e.g. strings), and drivers use of_find_property() > or of_get_property() to pre-allocate a buffer or to verify that the > property is correctly formed in the device tree. The problem is that in ACPI properties are not contiguous buffers full of data. They generally have internal structure. But device_property_read_string(), for example, gives you a pointer to the value of the property and you can check the size of that just fine using strlen(). Isn't that sufficient? Rafael -- 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/