lkml.org 
[lkml]   [2022]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] intel_th: Remove unused variable
Date
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@huawei.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
\
 
 \ /
  Last update: 2022-05-25 10:43    [W:0.049 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site