Skip to content

Commit

Permalink
Input: pxa27x_keypad - remove an unneeded NULL check
Browse files Browse the repository at this point in the history
Static checkers complain about this NULL check because we dereference it
without checking a couple lines later.  This function is only called
when "keypad->pdata" is non-NULL so we can just delete the NULL test.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
[Dmitry: remove the variable altogether given that it is used just once and
 dereference directly.]
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Dan Carpenter authored and Dmitry Torokhov committed Feb 12, 2015
1 parent 791738b commit 2b2f514
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/input/keyboard/pxa27x_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,11 @@ static int pxa27x_keypad_build_keycode(struct pxa27x_keypad *keypad)
{
const struct pxa27x_keypad_platform_data *pdata = keypad->pdata;
struct input_dev *input_dev = keypad->input_dev;
const struct matrix_keymap_data *keymap_data =
pdata ? pdata->matrix_keymap_data : NULL;
unsigned short keycode;
int i;
int error;

error = matrix_keypad_build_keymap(keymap_data, NULL,
error = matrix_keypad_build_keymap(pdata->matrix_keymap_data, NULL,
pdata->matrix_key_rows,
pdata->matrix_key_cols,
keypad->keycodes, input_dev);
Expand Down

0 comments on commit 2b2f514

Please sign in to comment.