From: moinejf@free.fr (Jean-Francois Moine)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] of: Make const the device node pointers in of_clk_get and of_node_put
Date: Sun, 9 Nov 2014 20:28:20 +0100 [thread overview]
Message-ID: <20141109202820.026252bf@armhf> (raw)
In-Reply-To: <20141109185019.GU4042@n2100.arm.linux.org.uk>
On Sun, 9 Nov 2014 18:50:19 +0000
Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> What this then means is that it fundamentally undermines the idea of
> storing the pointer to a device_node as a const pointer, as the device
> node must always be modified when you're done with it (because it's a
> ref-counted structure.) So, having it const in your code is a bug.
>
> What this also means is that every other place that you've added const
> below is also very dubious.
Thanks for the explanation.
The correct patch will be simpler: in the ASoC structures, I found only
three places where the device_node pointer is const.
--
Ken ar c'henta? | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
WARNING: multiple messages have this Message-ID (diff)
From: Jean-Francois Moine <moinejf-GANU6spQydw@public.gmane.org>
To: Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Cc: Grant Likely
<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/2] of: Make const the device node pointers in of_clk_get and of_node_put
Date: Sun, 9 Nov 2014 20:28:20 +0100 [thread overview]
Message-ID: <20141109202820.026252bf@armhf> (raw)
In-Reply-To: <20141109185019.GU4042-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
On Sun, 9 Nov 2014 18:50:19 +0000
Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org> wrote:
> What this then means is that it fundamentally undermines the idea of
> storing the pointer to a device_node as a const pointer, as the device
> node must always be modified when you're done with it (because it's a
> ref-counted structure.) So, having it const in your code is a bug.
>
> What this also means is that every other place that you've added const
> below is also very dubious.
Thanks for the explanation.
The correct patch will be simpler: in the ASoC structures, I found only
three places where the device_node pointer is const.
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Jean-Francois Moine <moinejf@free.fr>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Grant Likely <grant.likely@linaro.org>,
Rob Herring <robh+dt@kernel.org>, Mark Brown <broonie@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] of: Make const the device node pointers in of_clk_get and of_node_put
Date: Sun, 9 Nov 2014 20:28:20 +0100 [thread overview]
Message-ID: <20141109202820.026252bf@armhf> (raw)
In-Reply-To: <20141109185019.GU4042@n2100.arm.linux.org.uk>
On Sun, 9 Nov 2014 18:50:19 +0000
Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> What this then means is that it fundamentally undermines the idea of
> storing the pointer to a device_node as a const pointer, as the device
> node must always be modified when you're done with it (because it's a
> ref-counted structure.) So, having it const in your code is a bug.
>
> What this also means is that every other place that you've added const
> below is also very dubious.
Thanks for the explanation.
The correct patch will be simpler: in the ASoC structures, I found only
three places where the device_node pointer is const.
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
next prev parent reply other threads:[~2014-11-09 19:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-09 18:28 [PATCH 0/2] of: Fix some 'const' problems Jean-Francois Moine
2014-11-09 18:28 ` Jean-Francois Moine
2014-11-09 18:28 ` Jean-Francois Moine
2014-11-08 18:33 ` [PATCH 1/2] of: Make const the device node pointers in of_clk_get and of_node_put Jean-Francois Moine
2014-11-08 18:33 ` Jean-Francois Moine
2014-11-09 18:50 ` Russell King - ARM Linux
2014-11-09 18:50 ` Russell King - ARM Linux
2014-11-09 18:50 ` Russell King - ARM Linux
2014-11-09 19:28 ` Jean-Francois Moine [this message]
2014-11-09 19:28 ` Jean-Francois Moine
2014-11-09 19:28 ` Jean-Francois Moine
2014-11-09 11:38 ` [PATCH 2/2] ASoC: Remove useless casts Jean-Francois Moine
2014-11-09 11:38 ` Jean-Francois Moine
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141109202820.026252bf@armhf \
--to=moinejf@free.fr \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.