[PATCH 0/5] EDAC: Remove edac_align_ptr()

From: Borislav Petkov
Date: Thu Mar 10 2022 - 04:53:23 EST


From: Borislav Petkov <bp@xxxxxxx>

Hi,

this edac_align_ptr() thing was part of the original EDAC upstreaming
effort in 2006:

da9bb1d27b21 ("[PATCH] EDAC: core EDAC support code")

Comment above the usage says:

"Everything is kmalloc'ed as one big chunk - more efficient."

but I don't think that "efficiency" is measurable anymore. Then, 15+
years ago probably.

So get rid of it in favor of simple kzalloc() allocations for the couple
of structures needed at each call site.

It boots fine here with amd64_edac but I'd greatly appreciate testing
with other EDAC drivers.

Thx!

Borislav Petkov (5):
EDAC/mc: Get rid of silly one-shot struct allocation in
edac_mc_alloc()
EDAC/pci: Get rid of the silly one-shot memory allocation in
edac_pci_alloc_ctl_info()
EDAC/device: Get rid of the silly one-shot memory allocation in
edac_device_alloc_ctl_info()
EDAC/device: Sanitize edac_device_alloc_ctl_info() definition
EDAC/mc: Get rid of edac_align_ptr()

drivers/edac/edac_device.c | 135 +++++++++++++------------------
drivers/edac/edac_device.h | 14 ++++
drivers/edac/edac_device_sysfs.c | 5 +-
drivers/edac/edac_mc.c | 96 +++-------------------
drivers/edac/edac_module.h | 2 -
drivers/edac/edac_pci.c | 25 +++---
6 files changed, 95 insertions(+), 182 deletions(-)

--
2.29.2