Skip to contentSkip to conversation

HID: core: Remove redundant assignment to pointer field

PATCH New Colin Ian King 1 participant 1 message Mar 2, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: core: Remove redundant assignment to pointer field

The pointer fields is being assigned a value that is never read, the pointer is re-assigned a new value in for-loops that occur later on. The assignment is redundant and can be removed.

Clean up clang scan build warning:
drivers/hid/hid-core.c:1665:30: warning: Although the value stored to 'field' is used in the enclosing expression, the value is never actually read from 'field' [deadcode.DeadStores]

---
 drivers/hid/hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-core.c +1 -1
index db925794fbe6..6579f4724bbb 100644
@@ -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 */
Signature · 1 line
2.34.1