From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Julia Lawall <julia@diku.dk>
Cc: linuxppc-dev@ozlabs.org, kernel-janitors@vger.kernel.org,
paulus@samba.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arch/powerpc/platforms/powermac/pic.c: move of_node_put
Date: Sun, 21 Sep 2008 18:12:28 -0700 [thread overview]
Message-ID: <1222045948.12085.9.camel@pasglop> (raw)
In-Reply-To: <Pine.LNX.4.64.0809211301030.7450@ask.diku.dk>
On Sun, 2008-09-21 at 13:01 +0200, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
>
> It seems better to dereference master before decrementing the reference
> count rather than afterwards.
>
> The problem was found using the following semantic match:
> (http://www.emn.fr/x-info/coccinelle/)
>
> // <smpl>
> @r exists@
> expression n,E;
> identifier fld;
> iterator I;
> statement S;
> @@
>
> * of_node_put(n)
> ... when != n = E
> when != I(n,...) S
> * n->fld
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
Ack.
No big deal, tho, those nodes are never going to go away :-)
Cheers,
Ben.
> ---
>
> arch/powerpc/platforms/powermac/pic.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
> index 6d149ae..d17aa2b 100644
> --- a/arch/powerpc/platforms/powermac/pic.c
> +++ b/arch/powerpc/platforms/powermac/pic.c
> @@ -395,10 +395,10 @@ static void __init pmac_pic_probe_oldstyle(void)
> if (max_real_irqs > 32)
> pmac_irq_hw[i++] = (volatile struct pmac_irq_hw __iomem *)
> (addr + 0x10);
> - of_node_put(master);
>
> printk(KERN_INFO "irq: Found primary Apple PIC %s for %d irqs\n",
> master->full_name, max_real_irqs);
> + of_node_put(master);
>
> /* Map interrupts of cascaded controller */
> if (slave && !of_address_to_resource(slave, 0, &r)) {
prev parent reply other threads:[~2008-09-22 1:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-21 11:01 [PATCH] arch/powerpc/platforms/powermac/pic.c: move of_node_put Julia Lawall
2008-09-22 1:12 ` Benjamin Herrenschmidt [this message]
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=1222045948.12085.9.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=julia@diku.dk \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.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).