EDAC/mc: Cleanup _edac_mc_free() code
Remove needless and boilerplate variable declarations. No functional changes. [ bp: Add newlines for better readability. ] Signed-off-by: Robert Richter <rrichter@marvell.com> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: linux-edac <linux-edac@vger.kernel.org> Cc: James Morse <james.morse@arm.com> Cc: Mauro Carvalho Chehab <mchehab@kernel.org> Cc: Tony Luck <tony.luck@intel.com> Link: https://lkml.kernel.org/r/20190624150758.6695-10-rrichter@marvell.com
This commit is contained in:
parent
29a3388bfc
commit
718d58514e
@ -275,28 +275,27 @@ void *edac_align_ptr(void **p, unsigned size, int n_elems)
|
||||
|
||||
static void _edac_mc_free(struct mem_ctl_info *mci)
|
||||
{
|
||||
int i, chn, row;
|
||||
struct csrow_info *csr;
|
||||
const unsigned int tot_dimms = mci->tot_dimms;
|
||||
const unsigned int tot_channels = mci->num_cschannel;
|
||||
const unsigned int tot_csrows = mci->nr_csrows;
|
||||
int i, chn, row;
|
||||
|
||||
if (mci->dimms) {
|
||||
for (i = 0; i < tot_dimms; i++)
|
||||
for (i = 0; i < mci->tot_dimms; i++)
|
||||
kfree(mci->dimms[i]);
|
||||
kfree(mci->dimms);
|
||||
}
|
||||
|
||||
if (mci->csrows) {
|
||||
for (row = 0; row < tot_csrows; row++) {
|
||||
for (row = 0; row < mci->nr_csrows; row++) {
|
||||
csr = mci->csrows[row];
|
||||
if (csr) {
|
||||
if (csr->channels) {
|
||||
for (chn = 0; chn < tot_channels; chn++)
|
||||
kfree(csr->channels[chn]);
|
||||
kfree(csr->channels);
|
||||
}
|
||||
kfree(csr);
|
||||
if (!csr)
|
||||
continue;
|
||||
|
||||
if (csr->channels) {
|
||||
for (chn = 0; chn < mci->num_cschannel; chn++)
|
||||
kfree(csr->channels[chn]);
|
||||
kfree(csr->channels);
|
||||
}
|
||||
kfree(csr);
|
||||
}
|
||||
kfree(mci->csrows);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user