[07/19] EDAC, mc: Rename iterator variable to idx

Message ID 20191010202418.25098-8-rrichter@marvell.com
State New
Headers show
Series
  • EDAC: Rework edac_mc and ghes drivers
Related show

Commit Message

Robert Richter Oct. 10, 2019, 8:25 p.m.
Rename iterator variable to idx. The name is more handy, esp. when
searching it in the code.

Signed-off-by: Robert Richter <rrichter@marvell.com>

---
 drivers/edac/edac_mc.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

-- 
2.20.1

Comments

Mauro Carvalho Chehab Oct. 11, 2019, 10:41 a.m. | #1
Em Thu, 10 Oct 2019 20:25:18 +0000
Robert Richter <rrichter@marvell.com> escreveu:

> Rename iterator variable to idx. The name is more handy, esp. when

> searching it in the code.

> 

> Signed-off-by: Robert Richter <rrichter@marvell.com>


Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


> ---

>  drivers/edac/edac_mc.c | 14 +++++++-------

>  1 file changed, 7 insertions(+), 7 deletions(-)

> 

> diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c

> index c1e142643006..a893f793be8a 100644

> --- a/drivers/edac/edac_mc.c

> +++ b/drivers/edac/edac_mc.c

> @@ -319,7 +319,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned int mc_num,

>  	unsigned int idx, size, tot_dimms = 1;

>  	unsigned int tot_csrows = 1, tot_channels = 1;

>  	void *pvt, *p, *ptr = NULL;

> -	int i, j, row, chn, n, len;

> +	int j, row, chn, n, len;

>  	bool per_rank = false;

>  

>  	if (WARN_ON(n_layers > EDAC_MAX_LAYERS || n_layers == 0))

> @@ -329,14 +329,14 @@ struct mem_ctl_info *edac_mc_alloc(unsigned int mc_num,

>  	 * Calculate the total amount of dimms and csrows/cschannels while

>  	 * in the old API emulation mode

>  	 */

> -	for (i = 0; i < n_layers; i++) {

> -		tot_dimms *= layers[i].size;

> -		if (layers[i].is_virt_csrow)

> -			tot_csrows *= layers[i].size;

> +	for (idx = 0; idx < n_layers; idx++) {

> +		tot_dimms *= layers[idx].size;

> +		if (layers[idx].is_virt_csrow)

> +			tot_csrows *= layers[idx].size;

>  		else

> -			tot_channels *= layers[i].size;

> +			tot_channels *= layers[idx].size;

>  

> -		if (layers[i].type == EDAC_MC_LAYER_CHIP_SELECT)

> +		if (layers[idx].type == EDAC_MC_LAYER_CHIP_SELECT)

>  			per_rank = true;

>  	}

>  




Thanks,
Mauro

Patch

diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index c1e142643006..a893f793be8a 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -319,7 +319,7 @@  struct mem_ctl_info *edac_mc_alloc(unsigned int mc_num,
 	unsigned int idx, size, tot_dimms = 1;
 	unsigned int tot_csrows = 1, tot_channels = 1;
 	void *pvt, *p, *ptr = NULL;
-	int i, j, row, chn, n, len;
+	int j, row, chn, n, len;
 	bool per_rank = false;
 
 	if (WARN_ON(n_layers > EDAC_MAX_LAYERS || n_layers == 0))
@@ -329,14 +329,14 @@  struct mem_ctl_info *edac_mc_alloc(unsigned int mc_num,
 	 * Calculate the total amount of dimms and csrows/cschannels while
 	 * in the old API emulation mode
 	 */
-	for (i = 0; i < n_layers; i++) {
-		tot_dimms *= layers[i].size;
-		if (layers[i].is_virt_csrow)
-			tot_csrows *= layers[i].size;
+	for (idx = 0; idx < n_layers; idx++) {
+		tot_dimms *= layers[idx].size;
+		if (layers[idx].is_virt_csrow)
+			tot_csrows *= layers[idx].size;
 		else
-			tot_channels *= layers[i].size;
+			tot_channels *= layers[idx].size;
 
-		if (layers[i].type == EDAC_MC_LAYER_CHIP_SELECT)
+		if (layers[idx].type == EDAC_MC_LAYER_CHIP_SELECT)
 			per_rank = true;
 	}