Patchwork [-next] edac: i82975x: remove set but not used variable 'dtype'

login
register
mail settings
Submitter YueHaibing
Date Nov. 1, 2018, 2:26 a.m.
Message ID <20181101022604.7312-1-yuehaibing@huawei.com>
Download mbox | patch
Permalink /patch/647397/
State New
Headers show

Comments

YueHaibing - Nov. 1, 2018, 2:26 a.m.
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/edac/i82975x_edac.c:378:16: warning:
 variable ‘dtype’ set but not used [-Wunused-but-set-variable]

It never used since introduction in commit
084a4fccef39 ("edac: move dimm properties to struct dimm_info")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/edac/i82975x_edac.c | 2 --
 1 file changed, 2 deletions(-)
Borislav Petkov - Nov. 6, 2018, 6:05 p.m.
On Thu, Nov 01, 2018 at 10:26:04AM +0800, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/edac/i82975x_edac.c:378:16: warning:
>  variable ‘dtype’ set but not used [-Wunused-but-set-variable]
> 
> It never used since introduction in commit
> 084a4fccef39 ("edac: move dimm properties to struct dimm_info")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/edac/i82975x_edac.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/edac/i82975x_edac.c b/drivers/edac/i82975x_edac.c
> index 892815e..ae0d8fa 100644
> --- a/drivers/edac/i82975x_edac.c
> +++ b/drivers/edac/i82975x_edac.c
> @@ -375,7 +375,6 @@ static void i82975x_init_csrows(struct mem_ctl_info *mci,
>  	u32 cumul_size, nr_pages;
>  	int index, chan;
>  	struct dimm_info *dimm;
> -	enum dev_type dtype;
>  
>  	last_cumul_size = 0;
>  
> @@ -413,7 +412,6 @@ static void i82975x_init_csrows(struct mem_ctl_info *mci,
>  		 *   [0-7] for single-channel; i.e. csrow->nr_channels = 1
>  		 *   [0-3] for dual-channel; i.e. csrow->nr_channels = 2
>  		 */
> -		dtype = i82975x_dram_type(mch_window, index);

Please get rid of that silly function too and move the comment and the
assignment to the single place where it is done:

        /*
         * ECC is possible on i92975x ONLY with DEV_X8
         */
        dimm->dtype = DEV_X8;


Thx.
YueHaibing - Nov. 7, 2018, 1:28 a.m.
On 2018/11/7 2:05, Borislav Petkov wrote:
> On Thu, Nov 01, 2018 at 10:26:04AM +0800, YueHaibing wrote:
>> Fixes gcc '-Wunused-but-set-variable' warning:
>>
>> drivers/edac/i82975x_edac.c:378:16: warning:
>>  variable ‘dtype’ set but not used [-Wunused-but-set-variable]
>>
>> It never used since introduction in commit
>> 084a4fccef39 ("edac: move dimm properties to struct dimm_info")
>>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>> ---
>>  drivers/edac/i82975x_edac.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/edac/i82975x_edac.c b/drivers/edac/i82975x_edac.c
>> index 892815e..ae0d8fa 100644
>> --- a/drivers/edac/i82975x_edac.c
>> +++ b/drivers/edac/i82975x_edac.c
>> @@ -375,7 +375,6 @@ static void i82975x_init_csrows(struct mem_ctl_info *mci,
>>  	u32 cumul_size, nr_pages;
>>  	int index, chan;
>>  	struct dimm_info *dimm;
>> -	enum dev_type dtype;
>>  
>>  	last_cumul_size = 0;
>>  
>> @@ -413,7 +412,6 @@ static void i82975x_init_csrows(struct mem_ctl_info *mci,
>>  		 *   [0-7] for single-channel; i.e. csrow->nr_channels = 1
>>  		 *   [0-3] for dual-channel; i.e. csrow->nr_channels = 2
>>  		 */
>> -		dtype = i82975x_dram_type(mch_window, index);
> 
> Please get rid of that silly function too and move the comment and the
> assignment to the single place where it is done:
> 
>         /*
>          * ECC is possible on i92975x ONLY with DEV_X8
>          */
>         dimm->dtype = DEV_X8;
> 

OK, will send v2.

> 
> Thx.
>

Patch

diff --git a/drivers/edac/i82975x_edac.c b/drivers/edac/i82975x_edac.c
index 892815e..ae0d8fa 100644
--- a/drivers/edac/i82975x_edac.c
+++ b/drivers/edac/i82975x_edac.c
@@ -375,7 +375,6 @@  static void i82975x_init_csrows(struct mem_ctl_info *mci,
 	u32 cumul_size, nr_pages;
 	int index, chan;
 	struct dimm_info *dimm;
-	enum dev_type dtype;
 
 	last_cumul_size = 0;
 
@@ -413,7 +412,6 @@  static void i82975x_init_csrows(struct mem_ctl_info *mci,
 		 *   [0-7] for single-channel; i.e. csrow->nr_channels = 1
 		 *   [0-3] for dual-channel; i.e. csrow->nr_channels = 2
 		 */
-		dtype = i82975x_dram_type(mch_window, index);
 		for (chan = 0; chan < csrow->nr_channels; chan++) {
 			dimm = mci->csrows[index]->channels[chan]->dimm;