EDAC: Remove EDAC_DIMM_OFF() macro
authorRobert Richter <rrichter@marvell.com>
Wed, 6 Nov 2019 09:33:04 +0000 (09:33 +0000)
committerBorislav Petkov <bp@suse.de>
Sat, 9 Nov 2019 10:23:49 +0000 (11:23 +0100)
commit977b1ce7c117905b3138dc727ed25f8af2ba2902
tree369bf783839852762d60d57fa5f3d4344989e9e0
parentbc9ad9e40dbc4c8874e806345df393a9cfeadad3
EDAC: Remove EDAC_DIMM_OFF() macro

The EDAC_DIMM_OFF() macro takes 5 arguments to get the DIMM's index.
Simplify this by storing the index in struct dimm_info to avoid its
calculation and remove the EDAC_DIMM_OFF() macro. The index can be
directly used then.

Another advantage is that edac_mc_alloc() could be used even if the
exact size of the layers is unknown. Only the number of DIMMs would be
needed.

Rename iterator variable to idx, while at it. The name is more handy,
esp. when searching for it in the code.

Signed-off-by: Robert Richter <rrichter@marvell.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
Cc: James Morse <james.morse@arm.com>
Cc: Tony Luck <tony.luck@intel.com>
Link: https://lkml.kernel.org/r/20191106093239.25517-3-rrichter@marvell.com
drivers/edac/edac_mc.c
drivers/edac/edac_mc_sysfs.c
include/linux/edac.h