All of lore.kernel.org
 help / color / mirror / Atom feed
From: leo.yan@linaro.org
To: YueHaibing <yuehaibing@huawei.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH -next] coresight: stm: remove set but not used variable 'res_size'
Date: Wed, 5 Dec 2018 08:39:21 +0800	[thread overview]
Message-ID: <20181205003921.GC11628@leoy-ThinkPad-X240s> (raw)
In-Reply-To: <1543653585-108277-1-git-send-email-yuehaibing@huawei.com>

On Sat, Dec 01, 2018 at 08:39:45AM +0000, YueHaibing wrote:
> 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
> 237483aa5cf4 ("coresight: stm: adding driver for CoreSight STM component")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

FWIW, Tested-by: Leo Yan <leo.yan@linaro.org>

> ---
>  drivers/hwtracing/coresight/coresight-stm.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c
> index ef339ff..f07825d 100644
> --- a/drivers/hwtracing/coresight/coresight-stm.c
> +++ b/drivers/hwtracing/coresight/coresight-stm.c
> @@ -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;
>  
> @@ -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);
> 
> 
> 

WARNING: multiple messages have this Message-ID (diff)
From: leo.yan@linaro.org
To: YueHaibing <yuehaibing@huawei.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH -next] coresight: stm: remove set but not used variable 'res_size'
Date: Wed, 05 Dec 2018 00:39:21 +0000	[thread overview]
Message-ID: <20181205003921.GC11628@leoy-ThinkPad-X240s> (raw)
In-Reply-To: <1543653585-108277-1-git-send-email-yuehaibing@huawei.com>

On Sat, Dec 01, 2018 at 08:39:45AM +0000, YueHaibing wrote:
> 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
> 237483aa5cf4 ("coresight: stm: adding driver for CoreSight STM component")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

FWIW, Tested-by: Leo Yan <leo.yan@linaro.org>

> ---
>  drivers/hwtracing/coresight/coresight-stm.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c
> index ef339ff..f07825d 100644
> --- a/drivers/hwtracing/coresight/coresight-stm.c
> +++ b/drivers/hwtracing/coresight/coresight-stm.c
> @@ -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;
>  
> @@ -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);
> 
> 
> 

WARNING: multiple messages have this Message-ID (diff)
From: leo.yan@linaro.org
To: YueHaibing <yuehaibing@huawei.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH -next] coresight: stm: remove set but not used variable 'res_size'
Date: Wed, 5 Dec 2018 08:39:21 +0800	[thread overview]
Message-ID: <20181205003921.GC11628@leoy-ThinkPad-X240s> (raw)
In-Reply-To: <1543653585-108277-1-git-send-email-yuehaibing@huawei.com>

On Sat, Dec 01, 2018 at 08:39:45AM +0000, YueHaibing wrote:
> 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
> 237483aa5cf4 ("coresight: stm: adding driver for CoreSight STM component")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

FWIW, Tested-by: Leo Yan <leo.yan@linaro.org>

> ---
>  drivers/hwtracing/coresight/coresight-stm.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c
> index ef339ff..f07825d 100644
> --- a/drivers/hwtracing/coresight/coresight-stm.c
> +++ b/drivers/hwtracing/coresight/coresight-stm.c
> @@ -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;
>  
> @@ -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);
> 
> 
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2018-12-05  0:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-01  8:39 [PATCH -next] coresight: stm: remove set but not used variable 'res_size' YueHaibing
2018-12-01  8:39 ` YueHaibing
2018-12-01  8:39 ` YueHaibing
2018-12-05  0:39 ` leo.yan [this message]
2018-12-05  0:39   ` leo.yan
2018-12-05  0:39   ` leo.yan
2018-12-05 17:24 ` Mathieu Poirier
2018-12-05 17:24   ` Mathieu Poirier
2018-12-05 17:24   ` Mathieu Poirier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181205003921.GC11628@leoy-ThinkPad-X240s \
    --to=leo.yan@linaro.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexandre.torgue@st.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=suzuki.poulose@arm.com \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.