All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] core: ofnode: Have ofnode_read_u32_default return a u32
Date: Wed, 22 May 2019 07:21:32 -0600	[thread overview]
Message-ID: <CAPnjgZ1O9uUvwEjuB8seTfp60gbAcedT5_ii1U0Krz3NZJrF0g@mail.gmail.com> (raw)
In-Reply-To: <20190510174810.4990-1-tpiepho@impinj.com>

On Fri, 10 May 2019 at 11:48, Trent Piepho <tpiepho@impinj.com> wrote:
>
> It was returning an int, which doesn't work if the u32 it is reading,
> or the default value, will overflow a signed int.
>
> While it could be made to work, when using a C standard/compiler where
> casting negative signed values to unsigned has a defined behavior,
> combined with careful casting, it seems obvious one is meant to use
> ofnode_read_s32_default() with signed values.
>
> Cc: Simon Glass <sjg@chromium.org>
> Signed-off-by: Trent Piepho <tpiepho@impinj.com>
> ---
>  drivers/core/ofnode.c | 2 +-
>  include/dm/ofnode.h   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Applied to u-boot-dm, thanks!

      reply	other threads:[~2019-05-22 13:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-10 17:48 [U-Boot] [PATCH] core: ofnode: Have ofnode_read_u32_default return a u32 Trent Piepho
2019-05-22 13:21 ` Simon Glass [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=CAPnjgZ1O9uUvwEjuB8seTfp60gbAcedT5_ii1U0Krz3NZJrF0g@mail.gmail.com \
    --to=sjg@chromium.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.