From patchwork Tue Jul 18 06:09:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 789908 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=208.118.235.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="HDs+UOU2"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xBVSG57dJz9s06 for ; Tue, 18 Jul 2017 16:22:06 +1000 (AEST) Received: from localhost ([::1]:54252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXLtU-000205-EY for incoming@patchwork.ozlabs.org; Tue, 18 Jul 2017 02:22:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXLsV-0001gt-1Q for qemu-devel@nongnu.org; Tue, 18 Jul 2017 02:21:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXLsU-0000nV-2A for qemu-devel@nongnu.org; Tue, 18 Jul 2017 02:21:03 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:35365) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dXLsR-0000lG-Qy; Tue, 18 Jul 2017 02:20:59 -0400 Received: by mail-qk0-x244.google.com with SMTP id z22so1358722qka.2; Mon, 17 Jul 2017 23:20:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9KOoM2OeoDoWb1aE2NHWvN+NypfQFv8yKFZANDTIiPI=; b=HDs+UOU2+Aq3mAcFmgLNAqpNJjCqeR6Xgulnxa2pYFOKuZd2FLHZBJerx6UoXG0zFi zOhxtTQOAz4S+5mYsKN+aUzVOaL5C2/BCrTWvzZHMMvdYS19dOTP7/LOZ4IBHCL7yYYw 83is2BAhMAT+mI634+Izv3xfK0OyRspEqfNecwkFs+tEKWtqBRD7OPBYRq/r5ZVsyONq RqMmRlc6JubD0nZfShXiQf5CN10h45oBOt0CJPNKgYFAkKwYlToo0ZuGK4WZk/HmzA0v w2wxJRmhKwKIABRTW5GY240K6yJzniLvzchCy5NdMeM+9egg+AvK+y4xxGCyMr1dTqfe 4qMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=9KOoM2OeoDoWb1aE2NHWvN+NypfQFv8yKFZANDTIiPI=; b=Idl94cvaflbOWDfxg7EOLdg2JoEGaRMMfG9PV6p65aXw1MvJhvxiQDYHSJUHL8SeR4 bF3+RjqE/ZHojQBDU8/MSJ9wWAcaH1H3ZJpQ6BKDaHsCetavnLRApw4qXRxsXItmu5h6 MSqrwTHmmD6xGotkwwiyhdNh2CoMNEmEIRcvKyuznaM746UV5bZ31ShP/7cB0J1gUKKc ajfvddBEwD2MsKoZtu8k0eEShNxQYUP+ggxiYEJ9EJ0KxTZfjrLOJ8KgAV4kazLrLbfd HUoK0J7wqV7D+xuYz0aciLGuT9pPRW8bRGX5AQjxopbSPsNdo2nugG5wWVrIdly9672i Oy8A== X-Gm-Message-State: AIVw112UYu1QzgCx5cKyn9uui6HM8h5+p8ayzxPcD8MoJjhy/85D9W7x jTLIT07JBiYATLJaNxSJVg== X-Received: by 10.55.43.144 with SMTP id r16mr56811qkr.59.1500358859228; Mon, 17 Jul 2017 23:20:59 -0700 (PDT) Received: from yoga.offpageads.com ([138.117.48.223]) by smtp.gmail.com with ESMTPSA id l31sm1099862qtc.64.2017.07.17.23.20.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jul 2017 23:20:58 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-trivial@nongnu.org, Cornelia Huck , Christian Borntraeger , Alexander Graf , Richard Henderson Date: Tue, 18 Jul 2017 03:09:47 -0300 Message-Id: <20170718061005.29518-12-f4bug@amsat.org> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170718061005.29518-1-f4bug@amsat.org> References: <20170718061005.29518-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 11/29] s390x/sclp: use QEMU_IS_ALIGNED macro X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci Signed-off-by: Philippe Mathieu-Daudé Acked-by: Cornelia Huck --- hw/s390x/sclp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 *sccb) } assign_addr = (assign_info->rn - 1) * mhd->rzm; - if ((assign_addr % MEM_SECTION_SIZE == 0) && + if (QEMU_IS_ALIGNED(assign_addr, MEM_SECTION_SIZE) && (assign_addr >= mhd->padded_ram_size)) { /* Re-use existing memory region if found */ mr = memory_region_find(sysmem, assign_addr, 1).mr; @@ -297,7 +297,7 @@ static void unassign_storage(SCLPDevice *sclp, SCCB *sccb) unassign_addr = (assign_info->rn - 1) * mhd->rzm; /* if the addr is a multiple of 256 MB */ - if ((unassign_addr % MEM_SECTION_SIZE == 0) && + if (QEMU_IS_ALIGNED(unassign_addr, MEM_SECTION_SIZE) && (unassign_addr >= mhd->padded_ram_size)) { mhd->standby_state_map[(unassign_addr - mhd->padded_ram_size) / MEM_SECTION_SIZE] = 0;