From: Michael Ellerman <mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org>
To: Suraj Jitindar Singh
<sjitindarsingh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Tyrel Datwyler
<tyreld-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Cc: grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org
Subject: Re: [PATCH 2/2] powerpc: Update of_remove_property() call sites to remove null checking
Date: Mon, 09 May 2016 19:41:55 +1000 [thread overview]
Message-ID: <1462786915.5531.3.camel@ellerman.id.au> (raw)
In-Reply-To: <572C08DB.9000109-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Fri, 2016-05-06 at 13:00 +1000, Suraj Jitindar Singh wrote:
> On 05/05/16 16:50, Michael Ellerman wrote:
> > On Tue, 2016-05-03 at 15:32 -0700, Tyrel Datwyler wrote:
> > > On 04/27/2016 10:34 PM, Suraj Jitindar Singh wrote:
> > > > diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
> > > > index ceb18d3..a560a98 100644
> > > > --- a/arch/powerpc/platforms/pseries/mobility.c
> > > > +++ b/arch/powerpc/platforms/pseries/mobility.c
> > > > @@ -191,8 +191,8 @@ static int update_dt_node(__be32 phandle, s32 scope)
> > > > break;
> > > >
> > > > case 0x80000000:
> > > > - prop = of_find_property(dn, prop_name, NULL);
> > > > - of_remove_property(dn, prop);
> > > > + of_remove_property(dn, of_find_property(dn,
> > > > + prop_name, NULL));
> > > > prop = NULL;
> > > > break;
> > > >
> > > You haven't removed a NULL check here, as suggested by the changelog,
> > > but instead made a cosmetic change to the code that still leaves behind
> > > a now unnecessary "prop = NULL;" to bit rot.
> > Yeah I think you're right. Though it's not very clear how prop is used in that
> > function.
>
> I didn't delete the prop = NULL; initially as I didn't fully understand
> how it was used in the rest of the function and the effect of deleting
> it.
Yeah, it's pretty convoluted. I don't think you can actually prove it's safe to
remove the prop = NULL for arbitrary inputs.
cheers
--
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
next prev parent reply other threads:[~2016-05-09 9:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-28 5:34 [PATCH 1/2] drivers/of: Add check for null property in of_remove_property() Suraj Jitindar Singh
[not found] ` <1461821695-19204-1-git-send-email-sjitindarsingh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-28 5:34 ` [PATCH 2/2] powerpc: Update of_remove_property() call sites to remove null checking Suraj Jitindar Singh
[not found] ` <1461821695-19204-2-git-send-email-sjitindarsingh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-05-03 22:32 ` Tyrel Datwyler
[not found] ` <57292702.5070507-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2016-05-05 6:50 ` Michael Ellerman
2016-05-06 1:01 ` Suraj Jitindar Singh
[not found] ` <1462431031.12473.3.camel-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org>
2016-05-06 3:00 ` Suraj Jitindar Singh
[not found] ` <572C08DB.9000109-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-05-09 9:41 ` Michael Ellerman [this message]
2016-05-04 22:40 ` [2/2] " Michael Ellerman
2016-05-03 13:06 ` [PATCH 1/2] drivers/of: Add check for null property in of_remove_property() Rob Herring
2016-05-04 22:40 ` [1/2] " Michael Ellerman
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=1462786915.5531.3.camel@ellerman.id.au \
--to=mpe-gsx/oe8hsfggbc27wqdahg@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sjitindarsingh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=tyreld-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).