Unhandled return values in acpi/video.c
Subsystems (2)
PATCH 1/1 Unhandled return values in acpi/video.c
Is there any particular reason not to care about return values of the acpi_remove_notify_handler()? If there is some reason, status variable is declared for nothing. If there aren't any reasons, this patch should solve the issue.
drivers/acpi/video.c +2 -2
@@ -1569,7 +1569,7 @@ static int acpi_video_bus_put_one_deviceACPI_DEVICE_NOTIFY , acpi_video_device_notify); -return 0 ; +return status; }static int acpi_video_bus_put_devices (struct acpi_video_bus *video)
@@ -1771,7 +1771,7 @@ static int acpi_video_bus_remove(structkfree (video->attached_array);kfree (video); -return 0 ; +return status; } static int
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 4 lines · ville palo
Is there any particular reason not to care about return values of the
acpi_remove_notify_handler()? If there is some reason, status variable is declared for nothing. If there aren't any reasons, this patch should solve the issue.
The thing is that all of this kinda pointless because mentioned return values will be forgotten on upper layers.
drivers/acpi/video.c static int acpi_video_bus_put_one_device · line 1573
Quoted 9 lines
drivers/acpi/video.c +1
-1@@ -1569,7 +1569,7 @@ static int acpi_video_bus_put_one_deviceACPI_DEVICE_NOTIFY , acpi_video_device_notify); -return 0 ; +return status; }
Assume, this happened. Then type of acpi_video_bus_put_one_device() will be changed to acpi_status and check at the beginning dropped. What a single caller of it do with return value? It spams logs and forgetting it. Assume we return status even from acpi_video_bus_put_devices() (and change return type). It will again be forgotten since both callers don't bother with it.
The real question is at which point return values should be dropped?
drivers/acpi/video.c static int acpi_video_bus_remove(struct · line 1775
Quoted 8 lines
drivers/acpi/video.c +1
-1static int acpi_video_bus_put_devices (struct acpi_video_bus *video)@@ -1771,7 +1771,7 @@ static int acpi_video_bus_remove(structkfree (video->attached_array);kfree (video); -return 0 ; +return status; }
Ditto: acpi_video_bus_remove() is ->remove method which is called (and probably should be called) without checking at all.
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 15 lines · Alexey Dobriyan
Quoted 4 lines · ville palo
Is there any particular reason not to care about return values of the
acpi_remove_notify_handler()? If there is some reason, status variable is declared for nothing. If there aren't any reasons, this patch should solve the issue.The thing is that all of this kinda pointless because mentioned return values will be forgotten on upper layers.
Quoted 6 lines
drivers/acpi/video.c +0
-0@@ -1569,7 +1569,7 @@ static int acpi_video_bus_put_one_deviceACPI_DEVICE_NOTIFY , acpi_video_device_notify);
Quoted 11 lines
drivers/acpi/video.c static int acpi_video_bus_put_one_device · line 1573
Quoted 3 lines
drivers/acpi/video.c +1
-1-return 0 ; +return status; }Assume, this happened. Then type of
acpi_video_bus_put_one_device()will be changed toacpi_statusand check at the beginning dropped. What a single caller of it do with return value? It spams logs and forgetting it. Assume we return status even fromacpi_video_bus_put_devices()(and change return type). It will again be forgotten since both callers don't bother with it.
Could it be helpfull for debugging purposes to know that there was or wasn't an error in acpi_remove_notify_handler() function or in acpi_video_bus_put_one_device()? (sorry for changing the return type :/)
Quoted 7 lines
The real question is at which point return values should be dropped?
Quoted 5 lines
drivers/acpi/video.c +0
-0static int acpi_video_bus_put_devices (struct acpi_video_bus *video)@@ -1771,7 +1771,7 @@ static int acpi_video_bus_remove(structkfree (video->attached_array);kfree (video);
Quoted 6 lines
drivers/acpi/video.c static int acpi_video_bus_put_one_device · line 1573
Quoted 3 lines
drivers/acpi/video.c +1
-1-return 0 ; +return status; }Ditto:
acpi_video_bus_remove()is ->remove method which is called (and probably should be called) without checking at all.
Well, why to declare status variable at all then :) Wouldn't it be good the get log messages in case of an error here as well?
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors