From patchwork Fri May 13 00:13:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9086931 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0A2649F1D3 for ; Fri, 13 May 2016 00:14:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 694C520204 for ; Fri, 13 May 2016 00:14:43 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C219B200D0 for ; Fri, 13 May 2016 00:14:42 +0000 (UTC) Received: from localhost ([::1]:60298 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b10kb-0008P1-NU for patchwork-qemu-devel@patchwork.kernel.org; Thu, 12 May 2016 20:14:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b10kN-0008Iz-6J for qemu-devel@nongnu.org; Thu, 12 May 2016 20:14:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b10kL-0002e7-0C for qemu-devel@nongnu.org; Thu, 12 May 2016 20:14:26 -0400 Received: from mail-qg0-x244.google.com ([2607:f8b0:400d:c04::244]:33274) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b10kK-0002dX-Sd for qemu-devel@nongnu.org; Thu, 12 May 2016 20:14:24 -0400 Received: by mail-qg0-x244.google.com with SMTP id 90so6865195qgz.0 for ; Thu, 12 May 2016 17:14:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Db7Xcm7OvRsV0yi7NJyuS4HTqXecKj91hn08EVzjXY0=; b=OGikY+sS2bBlZbyXxsTL5lojKf6mnGu43G1Sitm+ANjhr+Wogz/mxAoWtuqoL4i7g5 DEKqY4BRr7S0hVJ0M7UCis48bc12bcGIkHgvqDm8jrTlcgFAwXaaeusin4/QNB6YQz8b a1BvQYcZJeDGhlf7/YXihzplTsNWoXuIY4KfoC7/ffPHenKCXzIARflpcZUNefzLS0CN 21nDc+T/WI18/9Y4w4vk9noG4qOM0yb9jWEJLMEOWhKJMetzfxTAzINVPLL6xQcJHkVI HPVzT1WnsYnlOe5FtEpbbZraO2Dxl1ectQopd8iaM2eN1d23ehq6iPd9VbXy2Csx1zCG UjAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Db7Xcm7OvRsV0yi7NJyuS4HTqXecKj91hn08EVzjXY0=; b=iVSd0LtTs1Rlf2S7dyYIJYZTECirPq0b+g2AaS9cxzcPTZLTgJyhwaSsREwVA5cwI4 hw7tqIRdBRnMWzTPIP2Qd++q1uiLTW5VPrRGbbR1c56Difi8C4Okx5l626+9AEiablxW v+TbgmiNeGdz5RIOtCBlpEMZA/T0EMhSx7wxM87rG2YbsGExbBcLzJOLPzSdeZ7uxQze gbJxC2vCuwg7/LTDewxciXWa/gIrjMGRoqzaRMLWjclRHMG21UcIB3QMFqzeB0j4wGcM q1KMuNe2yy70GNFv7Oo+HEKz/H04M7s0ag4JBaYFpDxCvMQfCyZvnjpVbDTindFeTBjp zwAg== X-Gm-Message-State: AOPr4FWTuTDhHI5p10JIA0/CoCNufj4GQkoKyX6wwOuP8Y9PMjDvMoG6tZhElq38c2M3+A== X-Received: by 10.141.45.5 with SMTP id w5mr13355628qhe.1.1463098464424; Thu, 12 May 2016 17:14:24 -0700 (PDT) Received: from bigtime.com ([172.56.44.137]) by smtp.gmail.com with ESMTPSA id w16sm7171321qka.35.2016.05.12.17.14.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 May 2016 17:14:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 12 May 2016 14:13:03 -1000 Message-Id: <1463098420-29113-3-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1463098420-29113-1-git-send-email-rth@twiddle.net> References: <1463098420-29113-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c04::244 Subject: [Qemu-devel] [PULL 02/39] include/qemu/osdep.h: Add a macro to check for alignment 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: peter.maydell@linaro.org, Sergey Fedorov , Sergey Fedorov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sergey Fedorov Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov Message-Id: <1461341333-19646-2-git-send-email-sergey.fedorov@linaro.org> Signed-off-by: Richard Henderson --- include/qemu/osdep.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 408783f..e3bc50b 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -158,6 +158,9 @@ extern int daemon(int, int); /* Round number up to multiple */ #define QEMU_ALIGN_UP(n, m) QEMU_ALIGN_DOWN((n) + (m) - 1, (m)) +/* Check if n is a multiple of m */ +#define QEMU_IS_ALIGNED(n, m) (((n) % (m)) == 0) + #ifndef ROUND_UP #define ROUND_UP(n,d) (((n) + (d) - 1) & -(d)) #endif