[PATCH] intel_th: Remove unused variable

From: Li Zhengyu
Date: Wed May 25 2022 - 04:43:15 EST


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@xxxxxxxxxx>
---
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