From patchwork Tue Dec 19 03:16:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Goel X-Patchwork-Id: 122334 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3622056qgn; Mon, 18 Dec 2017 19:19:50 -0800 (PST) X-Google-Smtp-Source: ACJfBoubvp/KTTcjI/kryreKgd8soajPkKbSLuM4yqMN39NYJkd1G585gAvgRbzAhFJaYOSpn9rD X-Received: by 10.107.12.210 with SMTP id 79mr2321388iom.243.1513653590051; Mon, 18 Dec 2017 19:19:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513653590; cv=none; d=google.com; s=arc-20160816; b=Lv60AfXBD3CuNkaxbKXLCX7ri8Pi4wQ0RES4e6SDgM9Wyt0fT9HcwkYUkNbaYfgenT kzl4ioHPkPx78mIZWcpk7C2ofqwBGkS7xlr3MNu6hMuD0/cLzEQWZN7KqBgvvrCMVRj4 xneyUXO4a5/TokHg3jNXJhLd25u+4by5cdjg6qJFPd9b2Nf9THQxDdtjGLn7Pyu+l5Pg u7NMlIJDbiIKW+00iO2l3WEyb1MxU+9n+yiCuxINXSzWuka++ob8IJlGjT87tkj+sqpw Gr2YNzvCm2z5NRa838Bd/WrJ7m9IdNnRzv+wgbYQFGd3Wm/YtPcAlcHghB3Ox4gvVX31 SCuw== 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=x7HvvG0zkAYsEbCWBuLCe1HHPp+d5+y5XtlILe2EJRw=; b=NURD9BGeaE41Z41T27GMKiAjJPLoESYL7WPkAVJXlzsG/oTCQvGxvfrLUGQHtpORDO SAjregRrwZi6KtcOK7gIxG/ZzFAbDuo5lkNfJDzlzwLhel4n56OqFmoAoF88jgVT52OH OHWlzceHjdGNUPAuqcjkKytd37qh2qAdJnNDlMwsC/o7G74BeoPIHwi3mwm6xV2U15VC /Ev5eC54EnwKi/2qITl8RkruQr/gsLI8XxRW6DNUzKTp5hNZS84vcGQ0YabcP13p6Les AKGLwSRIJTaIz0sRGCGlF7EAss37rF+a6IfTR+ctT5c/uKOGsIwp/yEq8WnsxdkYhPUe l2Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QtBC2VOW; 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 w16si922897iod.260.2017.12.18.19.19.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 19:19:50 -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=QtBC2VOW; 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 1eR8P6-0006am-8O; Tue, 19 Dec 2017 03:17:16 +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 1eR8P5-0006ad-6u for xen-devel@lists.xenproject.org; Tue, 19 Dec 2017 03:17:15 +0000 X-Inumbo-ID: 028c9aab-e46b-11e7-b4a6-bc764e045a96 Received: from mail-pf0-x243.google.com (unknown [2607:f8b0:400e:c00::243]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 028c9aab-e46b-11e7-b4a6-bc764e045a96; Tue, 19 Dec 2017 04:16:31 +0100 (CET) Received: by mail-pf0-x243.google.com with SMTP id m26so10580887pfj.11 for ; Mon, 18 Dec 2017 19:17:13 -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=yRgeg2aHm2ra0r8hnOSfwUBT0njNNAdiTXTBqtFc/xI=; b=QtBC2VOWUm4SEpJH0IynQhwhBW47kTErZKJW0sbzQ3juNYHg34Ty7Ao7hbU4mz+whu wcPET4Psv+osMAbjwdcWi8NEumCE4qPCScPps8sSP7U8Ivve4xwijybeCVRnruuMuRuM GrlpZGR4Y8eoaHLcXIIlD2xVvKQXpO/XGl9fs= 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=yRgeg2aHm2ra0r8hnOSfwUBT0njNNAdiTXTBqtFc/xI=; b=VJ66vkQRYC1Wa+Jm1sCR+Di7VYseOo8geQokd/5PsMH1do/AJHWdxkoo87Bq55R8H6 1KwBuRuCe38HfnVp/w5RKm+STPP0G0pE7hch8A9iiV0SFtauSlcwtdnGCQT40/9rPqbH PWNKdzPFyD3p+zM2NCQXg6AlRkpfxZuorFJa84E2Qe6v2UbOQY5ALvrNnQRMJuzSQPjF StKExkb3i0bd0nJ6dsArYHUYMfyEaBi25/DjTnDO4M2wLDIZGzQgdjRcl5hB5JCBKtHj eH6s/U6wL+dAkaV2zmNqqh+5CcX0eapiDtuMxI/2+C59EY+Zh8kWFr5N2xcrew+DiM/E 8A/g== X-Gm-Message-State: AKGB3mKem7qlKHSUp/aZ1QAp1j/oxxUM6QT5TeussR26ou9ldt/LPnc2 3C2QW8bNeYretsGc5EtBk3NOAdAjeOaoZQ== X-Received: by 10.98.249.67 with SMTP id g3mr1782596pfm.197.1513653433164; Mon, 18 Dec 2017 19:17:13 -0800 (PST) Received: from sameer-ubuntu-book.qualcomm.com (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id 84sm28289917pfp.180.2017.12.18.19.17.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 19:17:12 -0800 (PST) From: Sameer Goel To: xen-devel@lists.xenproject.org, julien.grall@arm.com, mjaggi@caviumnetworks.com Date: Mon, 18 Dec 2017 20:16:57 -0700 Message-Id: <20171219031703.23420-3-sameer.goel@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171219031703.23420-1-sameer.goel@linaro.org> References: <20171219031703.23420-1-sameer.goel@linaro.org> MIME-Version: 1.0 Cc: sstabellini@kernel.org, Andrew.Cooper3@citrix.com, andre.przywara@linaro.org, jbeulich@suse.com, Sameer Goel , shankerd@codeaurora.org Subject: [Xen-devel] [RFC v4 2/8] 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 mutiple places, so the code churn is minimal. This change helps in porting unchanged code from Linux. Signed-off-by: Sameer Goel --- 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 e136af6b99..4bccbc9bdf 100644 --- a/xen/arch/x86/x86_64/asm-offsets.c +++ b/xen/arch/x86/x86_64/asm-offsets.c @@ -157,7 +157,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