USB: Check no positive return values from pm_runtime_resume_and_get()
PATCH 1/1 USB: Check no positive return values from pm_runtime_resume_and_get()
pm_runtime_resume_and_get() always returns a negative error code or zero; there's no need to check for positive values such as returned by pm_runtime_get_sync(). Simply drop the check.
--- drivers/usb/core/driver.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/usb/core/driver.c +0 -4
@@ -1723,8 +1723,6 @@ int usb_autoresume_device(struct usb_device *udev)dev_vdbg (&udev->dev,"%s: cnt %d -> %d\n" , __func__,atomic_read (&udev->dev.power.usage_count), status); -if (status >0 ) - status =0 ;return status; }
@@ -1829,8 +1827,6 @@ int usb_autopm_get_interface(struct usb_interface *intf)dev_vdbg (&intf->dev,"%s: cnt %d -> %d\n" , __func__,atomic_read (&intf->dev.power.usage_count), status); -if (status >0 ) - status =0 ;return status; }EXPORT_SYMBOL_GPL (usb_autopm_get_interface);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerQuoted 6 lines · Sakari Ailus
pm_runtime_resume_and_get()always returns a negative error code or zero; there's no need to check for positive values such as returned bypm_runtime_get_sync(). Simply drop the check.Fixes 7626c52b6b46 ("usb: usb_autopm_get_interface use modern helper")
If there is no need for this check, why does this need to be backported to stable kernels?
confused,
greg k-h
Hi Greg,
Quoted 10 lines · Greg Kroah-Hartman
Quoted 6 lines · Sakari Ailus
pm_runtime_resume_and_get()always returns a negative error code or zero; there's no need to check for positive values such as returned bypm_runtime_get_sync(). Simply drop the check.Fixes 7626c52b6b46 ("usb: usb_autopm_get_interface use modern helper")If there is no need for this check, why does this need to be backported to stable kernels?
It's not necessary IMO.
The practice lately has been to add Cc: stable if the Fixes: tag is there. But there was no actual bug in this case, just that this change ideally would have been part of the original patch.
Signature · 3 lines
Regards, Sakari Ailus
Greg Kroah-Hartman
maintainerQuoted 11 lines · Sakari Ailus
Hi Greg,
Quoted 8 lines · Greg Kroah-Hartman
Quoted 6 lines · Sakari Ailus
pm_runtime_resume_and_get()always returns a negative error code or zero; there's no need to check for positive values such as returned bypm_runtime_get_sync(). Simply drop the check.Fixes 7626c52b6b46 ("usb: usb_autopm_get_interface use modern helper")
Quoted 6 lines
Quoted 2 lines
If there is no need for this check, why does this need to be backported to stable kernels?
It's not necessary IMO.
The practice lately has been to add Cc: stable if the Fixes: tag is there.
If it actually fixes a bug.
Quoted 2 lines
But there was no actual bug in this case, just that this change ideally would have been part of the original patch.
Then it's not really a "fix" so that tag does not need to be there either :)
thanks,
greg k-h
Quoted 19 lines · Greg Kroah-Hartman
Quoted 11 lines · Sakari Ailus
Hi Greg,
Quoted 8 lines · Greg Kroah-Hartman
Quoted 6 lines · Sakari Ailus
pm_runtime_resume_and_get()always returns a negative error code or zero; there's no need to check for positive values such as returned bypm_runtime_get_sync(). Simply drop the check.Fixes 7626c52b6b46 ("usb: usb_autopm_get_interface use modern helper")Quoted 6 lines
Quoted 2 lines
If there is no need for this check, why does this need to be backported to stable kernels?
It's not necessary IMO.
The practice lately has been to add Cc: stable if the Fixes: tag is there.
Quoted 7 lines
If it actually fixes a bug.
Quoted 2 lines
But there was no actual bug in this case, just that this change ideally would have been part of the original patch.
Then it's not really a "fix" so that tag does not need to be there either :)
I agree, both should be removed. Can you drop them or should I send v2?
Signature · 1 line
Sakari Ailus
Greg Kroah-Hartman
maintainerQuoted 22 lines · Sakari Ailus
Quoted 21 lines · Greg Kroah-Hartman
Quoted 11 lines · Sakari Ailus
Hi Greg,
Quoted 8 lines · Greg Kroah-Hartman
Quoted 6 lines · Sakari Ailus
pm_runtime_resume_and_get()always returns a negative error code or zero; there's no need to check for positive values such as returned bypm_runtime_get_sync(). Simply drop the check.Fixes 7626c52b6b46 ("usb: usb_autopm_get_interface use modern helper")Quoted 6 lines
Quoted 2 lines
If there is no need for this check, why does this need to be backported to stable kernels?
It's not necessary IMO.
The practice lately has been to add Cc: stable if the Fixes: tag is there.
If it actually fixes a bug.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
But there was no actual bug in this case, just that this change ideally would have been part of the original patch.
Then it's not really a "fix" so that tag does not need to be there either :)
I agree, both should be removed. Can you drop them or should I send v2?
Please send a v2.
thanks,
greg k-h