From patchwork Fri Feb 9 03:10:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Goel X-Patchwork-Id: 127750 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp209263ljc; Thu, 8 Feb 2018 19:13:30 -0800 (PST) X-Google-Smtp-Source: AH8x227QXmOFlWhNcQByCR+WWai+nYyWxR5bQAxjHCMDJFqOtfbNW3usfCk5d/8+CwXFtaSCC8ie X-Received: by 10.36.39.215 with SMTP id g206mr1668227ita.17.1518146010288; Thu, 08 Feb 2018 19:13:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518146010; cv=none; d=google.com; s=arc-20160816; b=tlod0rwFZjYsNGHdz2rR5cg/HDgePnd+4HkJIOj+zKLkRnP3PAX6MaawFcxgg1alfU y2cZjJwRhPOSMzo10EEXcu1g2E0HQnIrXsvbVjDzqOn5VyxatZvpeIvCcXb4Iw9QFIZM Mib1h4//Mgt36VaEvx8yQPAGxR+SSza4tf8TtbW+siT4SO1BIE8qk+1sMzi5nO/Ub/8S rtnGIkR0eAzoU4gSPjERXrKMKP7+tbWdfvQN1PPPdFpN3kMqFFow6fU7Rzu6AhXhNnT+ k+L9NCosKXWsdtXq0Ge3SZyxOtyAa/viBa0uW9r6YGAFn2JTOeA+l30F3Wgkci25mKg4 55Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-unsubscribe:list-id:precedence:subject:cc :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=+vNuxqG+zQrisSaoYih8xmivuYX2EOnzqVAq7VjN3YA=; b=JuY4Yg8zYpNk/skxPrFZYGBxD1f4qzMm4FmFbfbnu71x4UBimiGpUrkZRmjpFGfVY/ IPcIOLpldWkIBvIsI4JhAyw4ejsnQa8YPdf1N/KGh2Uq8dhFbeVQgOzZECq6Ub0QmPq3 s6EPCkcQilx1INVedwfU4inpeeD7sK3+KxjCAQK7zy9f4MDOHDF8d6NAFSPwR78yqtWx VaHCMMW5A0zstzXJkOe1rusDKqFdT4SF04PWX8+iDurqC2Sv1WwwEYC0LuViwu+/JzDt eZzfEJQfNA5uz9ZfFVaWxEozvG/IC0/CRlD71n7yzykxoqLD+a8TnXWUg/Nyz2wuQeWC PRUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kG/bmbRG; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id d31si978152ioj.98.2018.02.08.19.13.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 19:13:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kG/bmbRG; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejz5t-0004zr-0b; Fri, 09 Feb 2018 03:11:21 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejz5r-0004zZ-Sp for xen-devel@lists.xenproject.org; Fri, 09 Feb 2018 03:11:19 +0000 X-Inumbo-ID: d4a9e0a0-0d46-11e8-ba59-bc764e045a96 Received: from mail-pg0-x243.google.com (unknown [2607:f8b0:400e:c05::243]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id d4a9e0a0-0d46-11e8-ba59-bc764e045a96; Fri, 09 Feb 2018 04:10:50 +0100 (CET) Received: by mail-pg0-x243.google.com with SMTP id m28so2741278pgc.9 for ; Thu, 08 Feb 2018 19:11:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=F6LYGHDdVvQSSI2icx1dDshk47vn6EhKO1d9/05JfEk=; b=kG/bmbRGWbbQy0xSk9eRX06rhglsz0wOA1theMezy0TemTAJTm9DF2Dak+Hq3b0AAI hsoxjRWla+LmhClToG7xWgSyVWfFGt1mx/TbaDrEHctVGEPsQC24ohl+XBlCufqunQVq 3my4fp8C0ZdXI1WydWiZMbyeGlyRvpGaCC/7I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F6LYGHDdVvQSSI2icx1dDshk47vn6EhKO1d9/05JfEk=; b=WA6gp+QEiRKKcUi+oOqY9YVVI/yojXOxxYLXOifXnt8QZ/HgPWxeK8/oKCTnVk0QCz YZc5SHFvBIVMa14YxnN1uRuTFWk4eT5SS43OO7u86Ky0EqaDAOeXvxE9WjgA/nWBHsFb mxeCAkJDPswuLH1JMSHPtyPo5jEV5pOAwXf9bZl9jav80nOns0N1qiY3gNUFjnp2pCmm Xa0ZgmOGsQtiiE5Rt0gbML675vCFA6sTXQrQ70LSqo8qVf4djs1+WAp1gSOBbWHjbjix qxc8ZI9awXM9+lWmXTf7rkL17kQ9cCrKmuSIIGrUGMkxmCK86tBtaNgH4b/2XgbWV37W t80w== X-Gm-Message-State: APf1xPBW5hr9je3A+Vgw44aEYQOgwAuZPkyMhl0RcRgJYyCpufhX5cqM oi/LF2GVE5WE4AYuhWVsNcmaB4uJT1jTNg== X-Received: by 10.98.247.25 with SMTP id h25mr1273264pfi.162.1518145877150; Thu, 08 Feb 2018 19:11:17 -0800 (PST) Received: from localhost.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id z15sm2663487pgr.62.2018.02.08.19.11.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 19:11:16 -0800 (PST) From: Sameer Goel To: xen-devel@lists.xenproject.org, julien.grall@arm.com, mjaggi@caviumnetworks.com Date: Thu, 8 Feb 2018 20:10:50 -0700 Message-Id: <20180209031055.21926-3-sameer.goel@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180209031055.21926-1-sameer.goel@linaro.org> References: <20180209031055.21926-1-sameer.goel@linaro.org> MIME-Version: 1.0 Cc: sstabellini@kernel.org, wei.liu2@citrix.com, george.dunlap@eu.citrix.com, Andrew.Cooper3@citrix.com, jbeulich@suse.com, Sameer Goel , Ian.Jackson@citrix.com, nd@arm.com, shankerd@codeaurora.org, roger.pau@citrix.com Subject: [Xen-devel] [PATCH 2/7] xen/bitops: Rename LOG_2 to ilog2 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Changing the name of the macro from LOG_2 to ilog2.This makes the function name similar to its Linux counterpart. Since, this is not used in multiple places, the code churn is minimal. This change helps in porting unchanged code from Linux. Signed-off-by: Sameer Goel Reviewed-by: Wei Liu --- xen/arch/x86/x86_64/asm-offsets.c | 2 +- xen/include/xen/bitops.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/x86_64/asm-offsets.c b/xen/arch/x86/x86_64/asm-offsets.c index 51be528f89..e6d4147525 100644 --- a/xen/arch/x86/x86_64/asm-offsets.c +++ b/xen/arch/x86/x86_64/asm-offsets.c @@ -166,7 +166,7 @@ void __dummy__(void) BLANK(); #endif - DEFINE(IRQSTAT_shift, LOG_2(sizeof(irq_cpustat_t))); + DEFINE(IRQSTAT_shift, ilog2(sizeof(irq_cpustat_t))); OFFSET(IRQSTAT_softirq_pending, irq_cpustat_t, __softirq_pending); BLANK(); diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h index e2019b02a3..a103e49089 100644 --- a/xen/include/xen/bitops.h +++ b/xen/include/xen/bitops.h @@ -223,7 +223,7 @@ static inline __u32 ror32(__u32 word, unsigned int shift) #define __L4(_x) (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x)) #define __L8(_x) (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x)) #define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x)) -#define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x)) +#define ilog2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x)) /** * for_each_set_bit - iterate over every set bit in a memory region