Skip to content

Commit 2b2f514

Browse files
Dan Carpenterdtor
authored andcommitted
Input: pxa27x_keypad - remove an unneeded NULL check
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>
1 parent 791738b commit 2b2f514

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/input/keyboard/pxa27x_keypad.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,13 +345,11 @@ static int pxa27x_keypad_build_keycode(struct pxa27x_keypad *keypad)
345345
{
346346
const struct pxa27x_keypad_platform_data *pdata = keypad->pdata;
347347
struct input_dev *input_dev = keypad->input_dev;
348-
const struct matrix_keymap_data *keymap_data =
349-
pdata ? pdata->matrix_keymap_data : NULL;
350348
unsigned short keycode;
351349
int i;
352350
int error;
353351

354-
error = matrix_keypad_build_keymap(keymap_data, NULL,
352+
error = matrix_keypad_build_keymap(pdata->matrix_keymap_data, NULL,
355353
pdata->matrix_key_rows,
356354
pdata->matrix_key_cols,
357355
keypad->keycodes, input_dev);

0 commit comments

Comments
 (0)