Skip to content

Commit 11b1177

Browse files
committed
Merge tag 'edac_fixes_for_5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
Pull EDAC fixes from Borislav Petkov: - Do not build mpc85_edac as a module (Michael Ellerman) - Correct edac_mc_find()'s return value on error (Robert Richter) * tag 'edac_fixes_for_5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: EDAC/mc: Fix edac_mc_find() in case no device is found EDAC/mpc85xx: Prevent building as a module
2 parents 4e785e8 + 29a0c84 commit 11b1177

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

drivers/edac/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ config EDAC_PND2
263263
micro-server but may appear on others in the future.
264264

265265
config EDAC_MPC85XX
266-
tristate "Freescale MPC83xx / MPC85xx"
267-
depends on FSL_SOC
266+
bool "Freescale MPC83xx / MPC85xx"
267+
depends on FSL_SOC && EDAC=y
268268
help
269269
Support for error detection and correction on the Freescale
270270
MPC8349, MPC8560, MPC8540, MPC8548, T4240

drivers/edac/edac_mc.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -679,22 +679,18 @@ static int del_mc_from_global_list(struct mem_ctl_info *mci)
679679

680680
struct mem_ctl_info *edac_mc_find(int idx)
681681
{
682-
struct mem_ctl_info *mci = NULL;
682+
struct mem_ctl_info *mci;
683683
struct list_head *item;
684684

685685
mutex_lock(&mem_ctls_mutex);
686686

687687
list_for_each(item, &mc_devices) {
688688
mci = list_entry(item, struct mem_ctl_info, link);
689-
690-
if (mci->mc_idx >= idx) {
691-
if (mci->mc_idx == idx) {
692-
goto unlock;
693-
}
694-
break;
695-
}
689+
if (mci->mc_idx == idx)
690+
goto unlock;
696691
}
697692

693+
mci = NULL;
698694
unlock:
699695
mutex_unlock(&mem_ctls_mutex);
700696
return mci;

0 commit comments

Comments
 (0)