From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Mon, 27 May 2013 22:05:47 -0600 Subject: [U-Boot] [PATCH] input: simplify key_matrix_decode_fdt() In-Reply-To: References: <1369346997-24862-1-git-send-email-swarren@wwwdotorg.org> Message-ID: <51A42D1B.8010506@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 05/26/2013 01:31 PM, Simon Glass wrote: > Hi Stephen, > > On Thu, May 23, 2013 at 3:09 PM, Stephen Warren > wrote: > > From: Stephen Warren > > > 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:-)