Skip to content

Commit

Permalink
Input: cyapa - remove superfluous type check in cyapa_gen5_read_idac_…
Browse files Browse the repository at this point in the history
…data()

drivers/input/mouse/cyapa_gen5.c: In function ‘cyapa_gen5_read_idac_data’:
drivers/input/mouse/cyapa_gen5.c:1876: warning: ‘max_element_cnt’ may be used uninitialized in this function
drivers/input/mouse/cyapa_gen5.c:1873: warning: ‘offset’ may be used uninitialized in this function

If *data_size is non-zero, and idac_data_type contains an unknown type,
max_element_cnt and offset will be uninitialized, and the loop will
process non-existing data.

However, this cannot happen (for now), as there's a test for unknown
types at the top of cyapa_gen5_read_idac_data().

As no "if ... else if ..." is used in other places, remove the
superfluous "if" to silence the compiler warning.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Dudley Du <dudl@cypress.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Geert Uytterhoeven authored and Dmitry Torokhov committed Mar 2, 2015
1 parent 17a2805 commit 2523caa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/mouse/cyapa_gen5.c
Original file line number Diff line number Diff line change
Expand Up @@ -1926,7 +1926,7 @@ static int cyapa_gen5_read_idac_data(struct cyapa *cyapa,
electrodes_tx = cyapa->electrodes_x;
max_element_cnt = ((cyapa->aligned_electrodes_rx + 7) &
~7u) * electrodes_tx;
} else if (idac_data_type == GEN5_RETRIEVE_SELF_CAP_PWC_DATA) {
} else {
offset = 2;
max_element_cnt = cyapa->electrodes_x +
cyapa->electrodes_y;
Expand Down

0 comments on commit 2523caa

Please sign in to comment.