All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] input: simplify key_matrix_decode_fdt()
Date: Mon, 27 May 2013 22:05:47 -0600	[thread overview]
Message-ID: <51A42D1B.8010506@wwwdotorg.org> (raw)
In-Reply-To: <CAPnjgZ2wNHuH8FvdEXcT_gp7joP7NreF=ZqEHoAaKGEQ6XgVDA@mail.gmail.com>

On 05/26/2013 01:31 PM, Simon Glass wrote:
> Hi Stephen,
> 
> On Thu, May 23, 2013 at 3:09 PM, Stephen Warren <swarren@wwwdotorg.org
> <mailto:swarren@wwwdotorg.org>> wrote:
> 
>     From: Stephen Warren <swarren at nvidia.com <mailto:swarren@nvidia.com>>
> 
>     We know the exact property names that the code wants to process. Look
>     these up directly with fdt_get_property(), rather than iterating over
>     all properties within the node, and checking each property's name, in
>     a convoluted fashion, against the expected name.
>     +       plain_keycode = create_keymap(config, (u32 *)prop->data,
>     +               proplen, KEY_FN, &config->fn_pos);
> 
> Probably don't need plain_keycode variable at all.

This is required because the variable is passed to free() later, and
config->plain_keycode is marked const, whereas free isn't prototyped to
take a const. I figured that it was simplest to use a separate variable
here rather than cast away the const when calling free(). Now, if C had
const_cast<>, then I would have made a different decision:-)

  reply	other threads:[~2013-05-28  4:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-23 22:09 [U-Boot] [PATCH] input: simplify key_matrix_decode_fdt() Stephen Warren
2013-05-26 19:31 ` Simon Glass
2013-05-28  4:05   ` Stephen Warren [this message]
2013-06-04 19:30 ` Stephen Warren
2013-06-05 12:34 ` [U-Boot] " Tom Rini

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=51A42D1B.8010506@wwwdotorg.org \
    --to=swarren@wwwdotorg.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.