Skip to content

Commit

Permalink
HID: core: remove unneeded assignment in hid_process_report()
Browse files Browse the repository at this point in the history
Commit bebcc52 ("HID: core: for input reports, process the usages by
priority list") split the iteration into two distinct loops in
hid_process_report().

After this change, the variable field is only used while iterating in the
second loop and the assignment of values to this variable in the first loop
is simply not needed.

Remove the unneeded assignment during retrieval. No functional change and
no change in the resulting object code.

This was discovered as a dead store with clang-analyzer.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Reviewed-by: Tom Rix <trix@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Lukas Bulwahn authored and Jiri Kosina committed Jul 21, 2022
1 parent aa051d3 commit 4df4b0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,7 @@ static void hid_process_report(struct hid_device *hid,

/* first retrieve all incoming values in data */
for (a = 0; a < report->maxfield; a++)
hid_input_fetch_field(hid, field = report->field[a], data);
hid_input_fetch_field(hid, report->field[a], data);

if (!list_empty(&report->field_entry_list)) {
/* INPUT_REPORT, we have a priority list of fields */
Expand Down

0 comments on commit 4df4b0f

Please sign in to comment.