Skip to contentSkip to conversation

ACPI / bus: Return error code from __acpi_match_device() in one case

PATCH Superseded Andy Shevchenko 1 participant 1 message Feb 5, 2018

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/6 ACPI / bus: Return error code from __acpi_match_device() in one case

Quoted 10 lines · Rafael J. Wysocki
Quoted 7 lines · Andy Shevchenko

Instead of playing tricks with last invalid entry, return simple -ENODATA error code casted to pointer.

It would be good for future in case caller passes NULL pointer for ID table. Moreover, caller can check the code to be sure what happened
inside callee.

Quoted 4 lines

Review

Quoted 2 lines
(quoted diff) +1 -1
-                       return id;
+                       return ERR_PTR(-ENODATA);

So why is returning id from here a problem?

I think you already noticed that in the following patch it becomes a problem if user supply ids == NULL.

That's why I added a second paragraph to the commit message to explain.