aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-02-11 12:34:03 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-02-12 02:07:12 -0500
commit2b2f514705fa00df1bc01d68fe9decbb7d59fcc6 (patch)
tree3466bff37d99557ca76494be55ef702091a246fa /drivers/input/keyboard
parent791738be57473fddaf393dcedcef31b577231aaa (diff)
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>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/pxa27x_keypad.c4
1 files changed, 1 insertions, 3 deletions
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)
345{ 345{
346 const struct pxa27x_keypad_platform_data *pdata = keypad->pdata; 346 const struct pxa27x_keypad_platform_data *pdata = keypad->pdata;
347 struct input_dev *input_dev = keypad->input_dev; 347 struct input_dev *input_dev = keypad->input_dev;
348 const struct matrix_keymap_data *keymap_data =
349 pdata ? pdata->matrix_keymap_data : NULL;
350 unsigned short keycode; 348 unsigned short keycode;
351 int i; 349 int i;
352 int error; 350 int error;
353 351
354 error = matrix_keypad_build_keymap(keymap_data, NULL, 352 error = matrix_keypad_build_keymap(pdata->matrix_keymap_data, NULL,
355 pdata->matrix_key_rows, 353 pdata->matrix_key_rows,
356 pdata->matrix_key_cols, 354 pdata->matrix_key_cols,
357 keypad->keycodes, input_dev); 355 keypad->keycodes, input_dev);