Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1587146

Re: [RFC/PATCH] of: Mark property::value as const

Path csiph.com!feeder.erje.net!2.eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Rob Herring <robh+dt@kernel.org>
Newsgroups linux.kernel
Subject Re: [RFC/PATCH] of: Mark property::value as const
Date Thu, 23 Feb 2017 23:20:02 +0100
Message-ID <te9TY-7sz-35@gated-at.bofh.it> (permalink)
References <taBvr-43Z-1@gated-at.bofh.it> <te7It-5Pd-5@gated-at.bofh.it> <te8Ey-6rD-3@gated-at.bofh.it>
X-Gm-Message-State AMke39kZ4Gch9E9qve1ilpQD8KNLUKHBGfUjr+blx0w/koemJulHoj0SJY5p9eq1XVnldXDd0A+E0yu9w1FnCQ==
X-Received by 10.129.51.86 with SMTP id z83mr21069192ywz.74.1487887800740; Thu, 23 Feb 2017 14:10:00 -0800 (PST)
MIME-Version 1.0
X-Gmail-Original-Message-ID <CAL_Jsq+OQgmqvHQ_AWXOqnK0Yh8T3EVyxyiTFk1+0AwNHCf+Ag@mail.gmail.com>
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 28
Organization linux.* mail to news gateway
X-Original-Cc Stephen Boyd <stephen.boyd@linaro.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
X-Original-Date Thu, 23 Feb 2017 16:09:40 -0600
X-Original-Message-ID <CAL_Jsq+OQgmqvHQ_AWXOqnK0Yh8T3EVyxyiTFk1+0AwNHCf+Ag@mail.gmail.com>
X-Original-References <20170214025040.23955-1-stephen.boyd@linaro.org> <58AF3E06.4030701@gmail.com> <58AF4D03.7020908@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1587146

Show key headers only | View raw


On Thu, Feb 23, 2017 at 2:58 PM, Frank Rowand <frowand.list@gmail.com> wrote:
> On 02/23/17 11:54, Frank Rowand wrote:
>> On 02/13/17 18:50, Stephen Boyd wrote:
>>> The 'blob' we pass into populate_properties() is marked as const,
>>> but we cast that const away when we assign the result of
>>> fdt_getprop_by_offset() to pp->value. Let's mark value as const
>>> instead, so that code can't mistakenly write to the value of the
>>> property that we've so far advertised as const.
>>>
>>> Unfortunately, this exposes a problem with the fdt resolver code,
>>> where we overwrite the value member of properties of phandles to
>>> update them with their final value. Add a comment for now to
>>> indicate where we're potentially writing over const data.
>>
>> The resolver should not be over writing anything in the FDT.  I'll
>> look at what is going on there.
>>
>> The FDT we expose to user space should be the FDT we booted with,
>> not something later modified.
>
> It seems that /sys/firmware/fdt is not documented.  I'll look into
> fixing that.

That's because the "official" interface is /proc/device-tree/ which is
now a symlink. IIRC, it is documented to use /proc/device-tree, not
the sysfs path.

Rob

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC/PATCH] of: Mark property::value as const Stephen Boyd <stephen.boyd@linaro.org> - 2017-02-14 04:00 +0100
  Re: [RFC/PATCH] of: Mark property::value as const Rob Herring <robh+dt@kernel.org> - 2017-02-23 14:50 +0100
  Re: [RFC/PATCH] of: Mark property::value as const Frank Rowand <frowand.list@gmail.com> - 2017-02-23 21:00 +0100
    Re: [RFC/PATCH] of: Mark property::value as const Frank Rowand <frowand.list@gmail.com> - 2017-02-23 22:00 +0100
      Re: [RFC/PATCH] of: Mark property::value as const Rob Herring <robh+dt@kernel.org> - 2017-02-23 23:20 +0100
        Re: [RFC/PATCH] of: Mark property::value as const Frank Rowand <frowand.list@gmail.com> - 2017-02-24 00:30 +0100
    Re: [RFC/PATCH] of: Mark property::value as const Frank Rowand <frowand.list@gmail.com> - 2017-02-23 22:50 +0100
  Re: [RFC/PATCH] of: Mark property::value as const Frank Rowand <frowand.list@gmail.com> - 2017-02-24 00:10 +0100
    Re: [RFC/PATCH] of: Mark property::value as const Frank Rowand <frowand.list@gmail.com> - 2017-02-24 00:30 +0100
    Re: [RFC/PATCH] of: Mark property::value as const Rob Herring <robh+dt@kernel.org> - 2017-02-24 00:40 +0100

csiph-web