lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 25 May 2022 16:41:29 +0800
From:   Li Zhengyu <lizhengyu3@...wei.com>
To:     <alexander.shishkin@...ux.intel.com>
CC:     <linux-kernel@...r.kernel.org>
Subject: [PATCH] intel_th: Remove unused variable

Since commit a753bfcfdb1f ("intel_th: Make the switch allocate its subdevices")
factored out intel_th_subdevice_alloc() from intel_th_populate(), (!req)
is always true. When (!req) is been removed, variable 'req' is unused.

Signed-off-by: Li Zhengyu <lizhengyu3@...wei.com>
---
After commit a753bfcfdb1f, whether intel_th_request_hub_module() has been 
called or not, it will always been called when (subdev->type == INTEL_TH_SWITCH) 
is true. I'm not sure if it's fine.

 drivers/hwtracing/intel_th/core.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index 7e753a75d23b..59885b05220e 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -618,7 +618,6 @@ intel_th_subdevice_alloc(struct intel_th *th,
 {
 	struct intel_th_device *thdev;
 	struct resource res[3];
-	unsigned int req = 0;
 	int r, err;
 
 	thdev = intel_th_device_alloc(th, subdev->type, subdev->name,
@@ -686,11 +685,8 @@ intel_th_subdevice_alloc(struct intel_th *th,
 		goto fail_free_res;
 
 	/* need switch driver to be loaded to enumerate the rest */
-	if (subdev->type == INTEL_TH_SWITCH && !req) {
-		err = intel_th_request_hub_module(th);
-		if (!err)
-			req++;
-	}
+	if (subdev->type == INTEL_TH_SWITCH)
+		intel_th_request_hub_module(th);
 
 	return thdev;
 
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ