Skip to content

Commit

Permalink
coresight: stm: Remove set but not used variable 'res_size'
Browse files Browse the repository at this point in the history
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/hwtracing/coresight/coresight-stm.c: In function 'stm_probe':
drivers/hwtracing/coresight/coresight-stm.c:796:9: warning:
 variable 'res_size' set but not used [-Wunused-but-set-variable]

It never used since introduction in commit 237483a ("coresight: stm:
adding driver for CoreSight STM component")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Tested-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
YueHaibing authored and Greg Kroah-Hartman committed Feb 8, 2019
1 parent a0f890a commit a7325a6
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions drivers/hwtracing/coresight/coresight-stm.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)
struct stm_drvdata *drvdata;
struct resource *res = &adev->res;
struct resource ch_res;
size_t res_size, bitmap_size;
size_t bitmap_size;
struct coresight_desc desc = { 0 };
struct device_node *np = adev->dev.of_node;

Expand Down Expand Up @@ -833,15 +833,11 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)

drvdata->write_bytes = stm_fundamental_data_size(drvdata);

if (boot_nr_channel) {
if (boot_nr_channel)
drvdata->numsp = boot_nr_channel;
res_size = min((resource_size_t)(boot_nr_channel *
BYTES_PER_CHANNEL), resource_size(res));
} else {
else
drvdata->numsp = stm_num_stimulus_port(drvdata);
res_size = min((resource_size_t)(drvdata->numsp *
BYTES_PER_CHANNEL), resource_size(res));
}

bitmap_size = BITS_TO_LONGS(drvdata->numsp) * sizeof(long);

guaranteed = devm_kzalloc(dev, bitmap_size, GFP_KERNEL);
Expand Down

0 comments on commit a7325a6

Please sign in to comment.