Thread (14 messages) flat view 14 messages, 4 authors, 2017-02-27

Re: [PATCH v7 3/4] powerpc/pseries: Implement indexed-count hotplug memory add

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2017-02-17 06:58:59
Subsystem: the rest · Maintainer: Linus Torvalds

Nathan Fontenot [off-list ref] writes:
quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/power=
pc/platforms/pseries/hotplug-memory.c
quoted hunk ↗ jump to hunk
index 9609a72..0d1aa77 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -810,9 +901,6 @@ int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
 	u32 count, drc_index;
 	int rc;
=20=20
-	count =3D hp_elog->_drc_u.drc_count;
-	drc_index =3D hp_elog->_drc_u.drc_index;
        ^^^

This fails to build for me because of the above removal, ...

quoted hunk ↗ jump to hunk
@@ -829,20 +917,32 @@ int dlpar_memory(struct pseries_hp_errorlog *hp_elo=
g)
=20=20
...
 		break;
 	case PSERIES_HP_ELOG_ACTION_READD:
 		rc =3D dlpar_memory_readd_by_index(drc_index, prop);
						 ^^^
And the existing usage here.


Which leads to:


  arch/powerpc/platforms/pseries/hotplug-memory.c: In function =E2=80=98dlp=
ar_memory=E2=80=99:
  arch/powerpc/platforms/pseries/hotplug-memory.c:581:6: error: =E2=80=98dr=
c_index=E2=80=99 may be used uninitialized in this function [-Werror=3Dmayb=
e-uninitialized]
  if (lmbs[i].drc_index =3D=3D drc_index) {
  ^

Presumably you're using an old compiler that didn't pick that up? If so
please update to a more modern compiler.


I did the obvious fix, hopefully it is correct:
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc=
/platforms/pseries/hotplug-memory.c
index bc73546587e7..e28abfa013e5 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -1019,6 +1019,7 @@ int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
=20
 		break;
 	case PSERIES_HP_ELOG_ACTION_READD:
+		drc_index =3D hp_elog->_drc_u.drc_index;
 		rc =3D dlpar_memory_readd_by_index(drc_index, prop);
 		break;
 	default:

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help