From: Dan Carpenter Date: Wed, 11 Feb 2015 17:34:03 +0000 (-0800) Subject: Input: pxa27x_keypad - remove an unneeded NULL check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2b2f514705fa00df1bc01d68fe9decbb7d59fcc6;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 [Dmitry: remove the variable altogether given that it is used just once and dereference directly.] Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c index a89488aa1aa4..fcef5d1365e2 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c @@ -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);