[cocci] [PATCH 25/36] platform/x86: toshiba_haps: remove conditional return with no effect
Sang-Heon Jeon <[email protected]> Fri, 24 Jul 2026 03:45:27 +0900
| Newsgroups | fr.inria.cocci,org.kernel.vger.linux-kernel,org.kernel.vger.platform-driver-x86 |
|---|---|
| Message-ID | <[email protected]> |
Both branches of the check return the same value, so the check has no effect. Remove it and return the value directly. This is the result of running the Coccinelle script from scripts/coccinelle/misc/cond_return_no_effect.cocci. Signed-off-by: Sang-Heon Jeon <[email protected]> --- drivers/platform/x86/toshiba_haps.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/platform/x86/toshiba_haps.c b/drivers/platform/x86/toshiba_haps.c index c6633b74029f..4f62476b8dd1 100644 --- a/drivers/platform/x86/toshiba_haps.c +++ b/drivers/platform/x86/toshiba_haps.c @@ -251,11 +251,7 @@ static int toshiba_haps_resume(struct device *device) haps->protection_level); /* Reset the protection on resume */ - ret = toshiba_haps_reset_protection(haps->acpi_dev->handle); - if (ret != 0) - return ret; - - return ret; + return toshiba_haps_reset_protection(haps->acpi_dev->handle); } #endif -- 2.43.0