linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linuxppc-dev@ozlabs.org, Jeremy Kerr <jk@ozlabs.org>
Subject: Re: [PATCH 2/2] fsl/embedded6xx: don't cast the result of of_get_property
Date: Wed, 26 Sep 2007 14:55:18 +0200	[thread overview]
Message-ID: <244a03b111160633e9a9d8926be155fa@kernel.crashing.org> (raw)
In-Reply-To: <20070926104419.1b92002e.sfr@canb.auug.org.au>

>> -	avr_clock = *(u32*)of_get_property(avr, "clock-frequency", &len);
>> -	phys_addr = ((u32*)of_get_property(avr, "reg", &len))[0];
>> +	phys_addr = of_get_property(avr, "reg", &len);
>> +	avr_clock_prop = of_get_property(avr, "clock-frequency", &len);
>
> If you don't use the value of the len variable, then you can pass NULL 
> to
> of_get_property.

OTOH, it is almost always an error to not use the length (missing
error check).


Segher

      parent reply	other threads:[~2007-09-26 12:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-14  5:46 [PATCH 1/2] cell: don't cast the result of of_get_property() Jeremy Kerr
2007-09-14  5:46 ` [PATCH 2/2] fsl/embedded6xx: don't cast the result of of_get_property Jeremy Kerr
2007-09-25 20:27   ` Kumar Gala
2007-09-26  0:44   ` Stephen Rothwell
2007-09-26  0:52     ` Jeremy Kerr
2007-09-26  0:59       ` Stephen Rothwell
2007-09-26 12:55     ` Segher Boessenkool [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=244a03b111160633e9a9d8926be155fa@kernel.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=jk@ozlabs.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=sfr@canb.auug.org.au \
    /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).