Commit b83afb7
committed
ACPI: battery: Drop redundant checks from acpi_battery_remove()
In acpi_battery_remove(), "battery" cannot be NULL because it is the
driver data of the platform device passed to that function and it has
been set by acpi_battery_probe(), so drop the redundant check of it
against NULL.
Moreover, getting the ACPI device pointer from battery->device is
slightly less overhead than using the ACPI_COMPANION() macro on the
platform device to retrieve it, so do that and drop the check of that
pointer against NULL which is also redundant.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/12836976.O9o76ZdvQC@rafael.j.wysocki1 parent abbdf22 commit b83afb7
1 file changed
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1271 | 1271 | | |
1272 | 1272 | | |
1273 | 1273 | | |
1274 | | - | |
1275 | 1274 | | |
1276 | 1275 | | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
| 1276 | + | |
1281 | 1277 | | |
1282 | 1278 | | |
1283 | 1279 | | |
| |||
0 commit comments