mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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 <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Cc: linux-edac <[email protected]> Cc: James Morse <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Cc: Tony Luck <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
This commit is contained in:
parent
29a3388bfc
commit
718d58514e
1 changed files with 12 additions and 13 deletions
|
|
@ -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 a new issue