From nobody Fri Oct 2 12:25:02 2026 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C16C33F8234 for ; Fri, 31 Jul 2026 15:00:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785510029; cv=none; b=EKpkbWT/YOg3SknhyqrIZFFR588qi/ugmP18qEjA9Tl4jfheXxv74X0+EpuZiruEbhprL4rOap9WocUMcYAfmx4oj0KoL51+kQCVCL+sJE/K6Q47ykdTDCy9ZX1JgLuVB+7m/0fkn+ohdI5svfRMzqtcMV/FKNmoGd9wCXMDFdQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785510029; c=relaxed/simple; bh=qC8SBGSDaVZzK5t8Ty11OP9/qCN13H0ZY2jhQfa1Ewg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=HCd3fO2KALCSzxLYAPpguZSfw/ckCij4VjWwDw+MHq0i1VqTH+PIqd0v+tbjibG8PNMddF3dbWLlBfetgQ3Pk9NJZyEXDBQQxUAVpwQ9/o9nSxqGXx4IhSJVr3El4sDsqPyskvoTdpaZH2FXYVwUV2Rz7qLYPyYJc0Gb0yd8/Bg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cBK8+ORN; arc=none smtp.client-ip=209.85.210.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cBK8+ORN" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-84e0688b859so598103b3a.0 for ; Fri, 31 Jul 2026 08:00:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785510028; x=1786114828; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=a7YUAfWF28CYZia0ko86rgI/yXiMxE4LGUbouzjes4Y=; b=cBK8+ORN4Xm5bs76Or0WJqAusDAsPd9ugBTCHim55g5C/4A3oUIwMDKiHO8OmvdRu/ BoZplosbI0spegb1wL1HUNQaG5pCNHTAFiQBKolvyi8rLQKyZbkGOi6mzB/DpiuZkz4z t5U3C1FqlLvHbhQt2S73xZj8alGJKdk6eS7rDmWdUXA6V307WGMqME0GsJxgnN+/3q/4 4JhaVlohoqjQ/Hgaaj5fBMKd8vwm8yt0CEanzty+jHWGQRg4rybE2I5jvCJVuZbKYyGj ADsNURbkRkIICwnKczeQEHuXXaEZSXC47NDbuPeTGuiyJaqdWc3K55ZOGJ4SfOXjTmzU 0jAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785510028; x=1786114828; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=a7YUAfWF28CYZia0ko86rgI/yXiMxE4LGUbouzjes4Y=; b=KYfoR3uoUUB2XaU2fy1ydweqWnubImyYZoyGlMVmfRILoe9V4I0y14vTNm/h6V/avl BGmtwnpR/bYEq8fkSf2ABED20x+ekom2AkGhZ0E9XXtpXFjB6DCGaYtvJ1of+hRYoYjD Ojb3SvYQHhBZNgk1z+3DyotbSH8Gx92FlZhS41+YApSU9PSG9BwN4dGDGqKR/1PPqBdB A9ANrpfoHzVmLG32PJ2fbW23L5OUps5IpPgAlp6vZIR+eE2IQcJCmIkPW8ruMOkNk+CX +YffVEJipxD7q8r8+PuAFw2DZ2Nd0+lS+UTQV9PFOlgtLdyiX+CobPm6wOE8yqfzfY6G 1fyA== X-Gm-Message-State: AOJu0YxtHFyooR04F+EHHDL1yS8nGnAbKEBAqaZNMiwdp1Vb+iHeG71D T1EdaHSf/MhAfrnRvqmaJvadiCvancFzXJOoPZDz3K8uaC4AeAhoSdzo X-Gm-Gg: AR+sD11VkCju1pSNELOHlL71YgsLloj9r/eGCu+XsRftxYLRySu+em2zf5wgA4xAlZM sM0WyaBfi7iCNcECvsG62Fao+z343x5/mZ4WLBTUb6XPYpqcIK6JG2d4HFyP+QuaoN26HIAPogO CH0A1C1jPlr+6XTs6YqlcyhFQfE2CC3P0+PUHStSjL+zo45swgycMR6U0PEdyWDfExxC0JYu7R4 ZgTsy9CtuPbKo2cy4de5GPuVWrL1LAyixhg1PpRZR/LDxUZ+Be8phwYAx+jRtkQr26swQC4PyAs eA/fvEwSzxmDVVmUiAxYOTnHodLvDQ8d2crg+aWHA7obOUVekIcT5gmJdyfeFfeejJN8ymRVAof 2EJfZbePbEHXlarqAGS30amWd0VWK02un9FUWpCZfihmKGr+w4VN4BpuZnBeL/RIombMhIa6EGn ZWEpbIKI3sU1cxp5lHgEGGEwdxO+cpRVyjiWl/2qtYq1Ynxrkn/qTiW5aD5k1jNTEc+w== X-Received: by 2002:a05:6a00:802:b0:848:2f71:b657 with SMTP id d2e1a72fcca58-84ed71ab465mr1914520b3a.66.1785510027778; Fri, 31 Jul 2026 08:00:27 -0700 (PDT) Received: from ubuntu.. ([110.9.142.4]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cbe39ea9c50sm689194a12.27.2026.07.31.08.00.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2026 08:00:26 -0700 (PDT) From: Sang-Heon Jeon To: Azael Avalos , Hans de Goede , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Cc: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: [PATCH v2] platform/x86: toshiba_haps: Remove unnecessary ret in toshiba_haps_resume() Date: Sat, 1 Aug 2026 00:00:07 +0900 Message-ID: <20260731150010.1025556-1-ekffu200098@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The return value of toshiba_haps_protection_level() is ignored because ret is immediately overwritten by the toshiba_haps_reset_protection() call. And ret is only used by the check, which has no effect because both branches return the same value. So remove the check and ret, and return the value directly. No functional change. Found by the Coccinelle script from scripts/coccinelle/misc/cond_return_no_effect.cocci. Signed-off-by: Sang-Heon Jeon --- The platform/x86 patch of the treewide v1 series [1] is posted separately. You can find the Coccinelle script in v1 [1]. --- Changes from v1 [1] - Change base to platform-drivers-x86/for-next - Filter only toshiba_haps changes - Remove the unused ret variable - Update the subject [1] https://lore.kernel.org/all/20260723184538.3888637-1-ekffu200098@gmail.= com/ --- drivers/platform/x86/toshiba_haps.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/platform/x86/toshiba_haps.c b/drivers/platform/x86/tos= hiba_haps.c index c6633b74029f..b2eb91929d1d 100644 --- a/drivers/platform/x86/toshiba_haps.c +++ b/drivers/platform/x86/toshiba_haps.c @@ -244,18 +244,13 @@ static int toshiba_haps_suspend(struct device *device) static int toshiba_haps_resume(struct device *device) { struct toshiba_haps_dev *haps =3D dev_get_drvdata(device); - int ret; =20 /* Set the stored protection level */ - ret =3D toshiba_haps_protection_level(haps->acpi_dev->handle, - haps->protection_level); + toshiba_haps_protection_level(haps->acpi_dev->handle, + haps->protection_level); =20 /* Reset the protection on resume */ - ret =3D toshiba_haps_reset_protection(haps->acpi_dev->handle); - if (ret !=3D 0) - return ret; - - return ret; + return toshiba_haps_reset_protection(haps->acpi_dev->handle); } #endif =20 --=20 2.43.0