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

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

Commit Message

Robert Richter Nov. 6, 2019, 9:33 a.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>

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

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

-- 
2.20.1

Comments

Borislav Petkov Nov. 9, 2019, 10:21 a.m. | #1
On Wed, Nov 06, 2019 at 09:33:16AM +0000, Robert Richter wrote:
> 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 | 12 ++++++------

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

> 

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

> index 3dc1c5afabce..f76252b7a787 100644

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

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

> @@ -330,14 +330,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;

>  	}

>  

> -- 


Merging that one with 2/20 where you already are converting to "idx" in
the same function.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Patch

diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 3dc1c5afabce..f76252b7a787 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -330,14 +330,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;
 	}