All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 6/6] fdt: add decode helper library
Date: Thu, 13 Oct 2011 16:33:23 -0400	[thread overview]
Message-ID: <201110131633.25542.vapier@gentoo.org> (raw)
In-Reply-To: <1318371971-4457-7-git-send-email-sjg@chromium.org>

On Tuesday 11 October 2011 18:26:11 Simon Glass wrote:
> --- /dev/null
> +++ b/include/fdtdec.h
>
> +/*
> + * A typedef for a physical address. Note that fdt data is always big
> + * endian even on a litle endian machine.
> + */
> +#ifdef CONFIG_PHYS_64BIT
> +typedef u64 addr_t;
> +#define ADDR_T_NONE (-1ULL)
> +#define addr_to_cpu(reg) be64_to_cpu(reg)
> +#else
> +typedef u32 addr_t;
> +#define ADDR_T_NONE (-1U)
> +#define addr_to_cpu(reg) be32_to_cpu(reg)
> +#endif

"addr" is fairly generic.  how about "fdt_addr" instead ?

> --- /dev/null
> +++ b/lib/fdtdec.c
>
> +/* we need a generic GPIO interface here */
> +#include <asm/arch/gpio.h>

we have asm/gpio.h now, although i don't see this code using anything from the 
gpio header to need this include ...

> +static const char *compat_names[COMPAT_COUNT] = {

static const char * const compat_names[COMPAT_COUNT] = {

> +int fdtdec_next_alias(const void *blob, const char *name,
> +		enum fdt_compat_id id, int *upto)
> +{
> +#define MAX_STR_LEN 20
> +	char str[MAX_STR_LEN + 20];
> +	int node, err;
> +
> +	sprintf(str, "%.*s%d", MAX_STR_LEN, name, *upto);

where's that "20" coming from ?  just arbitrarily defined ?  might want to add 
an assert(strlen(name) <= MAX_STR_LEN).
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111013/c6b28a7b/attachment.pgp 

  reply	other threads:[~2011-10-13 20:33 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-11 22:26 [U-Boot] [PATCH v3 0/6] Run-time configuration of U-Boot via a flat device tree (fdt) Simon Glass
2011-10-11 22:26 ` [U-Boot] [PATCH v3 1/6] fdt: ARM: Add device tree control of U-Boot (CONFIG_OF_CONTROL) Simon Glass
2011-10-11 23:39   ` Stephen Warren
2011-10-11 22:26 ` [U-Boot] [PATCH v3 2/6] fdt: Add support for embedded device tree (CONFIG_OF_EMBED) Simon Glass
2011-10-13 21:13   ` Stephen Warren
2011-10-13 21:22     ` Simon Glass
2011-10-13 21:21   ` Stephen Warren
2011-10-13 21:25     ` Simon Glass
2011-10-13 21:50       ` Stephen Warren
2011-10-15  5:21         ` Simon Glass
2011-10-15  5:46         ` Grant Likely
2011-10-15 14:51           ` Simon Glass
2011-10-13 22:58   ` Mike Frysinger
2011-10-11 22:26 ` [U-Boot] [PATCH v3 3/6] fdt: Add support for a separate device tree (CONFIG_OF_SEPARATE) Simon Glass
2011-10-13 21:36   ` Stephen Warren
2011-10-15 15:12     ` Simon Glass
2011-10-11 22:26 ` [U-Boot] [PATCH v3 4/6] fdt: ARM: Implement embedded and separate device tree Simon Glass
2011-10-13 21:39   ` Stephen Warren
2011-10-15 15:15     ` Simon Glass
2011-10-11 22:26 ` [U-Boot] [PATCH v3 5/6] fdt: ARM: Add fdtcontroladdr to set device tree address in environment Simon Glass
2011-10-13 20:27   ` Mike Frysinger
2011-10-13 21:08     ` Simon Glass
2011-10-15 15:18       ` Simon Glass
2011-10-11 22:26 ` [U-Boot] [PATCH v3 6/6] fdt: add decode helper library Simon Glass
2011-10-13 20:33   ` Mike Frysinger [this message]
2011-10-13 21:28     ` Simon Glass
2011-10-13 23:01       ` Mike Frysinger
2011-10-13 23:16         ` Simon Glass
2011-10-13 23:32           ` Mike Frysinger
2011-10-14 18:12   ` Kumar Gala
2011-10-14 18:21     ` Simon Glass
2011-10-15  1:42       ` Aaron Williams
2011-10-15  2:16         ` Simon Glass
2011-10-11 23:37 ` [U-Boot] [PATCH v3 0/6] Run-time configuration of U-Boot via a flat device tree (fdt) Stephen Warren
2011-10-11 23:54   ` Simon Glass
2011-10-12  1:00     ` Jason
2011-10-12  1:07       ` Simon Glass

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=201110131633.25542.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /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.