From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXPHE-0000U8-R7 for qemu-devel@nongnu.org; Tue, 18 Jul 2017 05:58:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXPHB-0000E0-IQ for qemu-devel@nongnu.org; Tue, 18 Jul 2017 05:58:48 -0400 Date: Tue, 18 Jul 2017 11:58:40 +0200 From: Cornelia Huck Message-ID: <20170718115840.3017dd18@gondolin> In-Reply-To: <20170718061005.29518-12-f4bug@amsat.org> References: <20170718061005.29518-1-f4bug@amsat.org> <20170718061005.29518-12-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 11/29] s390x/sclp: use QEMU_IS_ALIGNED macro List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Philippe =?UTF-8?B?TWF0aGlldS1EYXVkw6k=?= Cc: qemu-trivial@nongnu.org, Christian Borntraeger , Alexander Graf , Richard Henderson , qemu-devel@nongnu.org, Eric Blake On Tue, 18 Jul 2017 03:09:47 -0300 Philippe Mathieu-Daud=C3=A9 wrote: > Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.= cocci >=20 > Signed-off-by: Philippe Mathieu-Daud=C3=A9 > --- > hw/s390x/sclp.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c > index 9253dbbc64..0a207c7345 100644 > --- a/hw/s390x/sclp.c > +++ b/hw/s390x/sclp.c > @@ -237,7 +237,7 @@ static void assign_storage(SCLPDevice *sclp, SCCB *sc= cb) > } > assign_addr =3D (assign_info->rn - 1) * mhd->rzm; > =20 > - if ((assign_addr % MEM_SECTION_SIZE =3D=3D 0) && > + if (QEMU_IS_ALIGNED(assign_addr, MEM_SECTION_SIZE) && > (assign_addr >=3D mhd->padded_ram_size)) { > /* Re-use existing memory region if found */ > mr =3D memory_region_find(sysmem, assign_addr, 1).mr; > @@ -297,7 +297,7 @@ static void unassign_storage(SCLPDevice *sclp, SCCB *= sccb) > unassign_addr =3D (assign_info->rn - 1) * mhd->rzm; > =20 > /* if the addr is a multiple of 256 MB */ > - if ((unassign_addr % MEM_SECTION_SIZE =3D=3D 0) && > + if (QEMU_IS_ALIGNED(unassign_addr, MEM_SECTION_SIZE) && > (unassign_addr >=3D mhd->padded_ram_size)) { > mhd->standby_state_map[(unassign_addr - > mhd->padded_ram_size) / MEM_SECTION_SIZE] =3D= 0; Acked-by: Cornelia Huck