Skip to content

Commit

Permalink
[libata] fix smatch warning for zpodd_wake_dev
Browse files Browse the repository at this point in the history
Fix a smatch warning caused by an useless pointer check.
The context parameter (aka. ata_dev) will never be NULL until we remove
the acpi notification handler, so it is pointless to check it for NULL.

Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Aaron Lu <[email protected]>
Signed-off-by: Jeff Garzik <[email protected]>
  • Loading branch information
aaronlu authored and Jeff Garzik committed Feb 20, 2013
1 parent 84a9a8c commit 53637e0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/ata/libata-zpodd.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,7 @@ static void zpodd_wake_dev(acpi_handle handle, u32 event, void *context)
struct zpodd *zpodd = ata_dev->zpodd;
struct device *dev = &ata_dev->sdev->sdev_gendev;

if (event == ACPI_NOTIFY_DEVICE_WAKE && ata_dev &&
pm_runtime_suspended(dev)) {
if (event == ACPI_NOTIFY_DEVICE_WAKE && pm_runtime_suspended(dev)) {
zpodd->from_notify = true;
pm_runtime_resume(dev);
}
Expand Down

0 comments on commit 53637e0

Please sign in to comment.