From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f180.google.com (mail-we0-f180.google.com [74.125.82.180]) by dpdk.org (Postfix) with ESMTP id BFE4F6A94 for ; Fri, 28 Feb 2014 09:20:17 +0100 (CET) Received: by mail-we0-f180.google.com with SMTP id u57so271020wes.11 for ; Fri, 28 Feb 2014 00:21:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=7Y8Fi86+4XH/PmMMrC+jiPbtePx6dO4fjFk+/afe7a4=; b=OT8bSqqnJfaEv4+YeExCTz1WoBo9zFzETRXXvlQPsp9DoG/TEo9xaAdDx4vHlBG4M5 xqBM3A0Zd50iKZ+BNd+kzRNPaDzIZgtmt991gYVK51lYbYo8iRbu45fOF5PWHRH9UoaY 1XnyGx/mihglwCLu4Y2d66Vs3LK89D+4nYuWOl32Y1ulz7ubgRF+24Ih/epcekkD0XS9 ewXZf1a4xLCOSsoW8n3cqg9WrZilYBJhBuH7OZqSiD5fSYZNSZlhfRx8iBUwAo1gIjO0 yHdm00FQ8mwYBpOGky+IM4iFBRyjf2VK+Ko0cu779brcSVvHqzj24BwdrV7eOAqSHqfL aMxw== X-Gm-Message-State: ALoCoQlJQs8WquSpJJXFqKs+sM4UsncIdZl9FJUATO9i5ADhK8AMe3YvZfk4s+BMrDZb1vFlyF/F X-Received: by 10.180.13.5 with SMTP id d5mr1269210wic.54.1393575704307; Fri, 28 Feb 2014 00:21:44 -0800 (PST) Received: from alcyon.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id jw4sm2396667wjc.20.2014.02.28.00.21.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2014 00:21:43 -0800 (PST) From: David Marchand To: liljegren.mats2@gmail.com Date: Fri, 28 Feb 2014 09:21:35 +0100 Message-Id: <1393575696-25289-1-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH 1/2] eal: fix use of RTE_PTR_ALIGN_CEIL macro on 32bits system X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 08:20:18 -0000 Build issue reported by Mats Liljegren : CC eal.o In file included from /home/lwrt/build/dpdk/lib/librte_eal/linuxapp/eal/eal.c:55:0: /home/lwrt/build/dpdk/lib/librte_eal/linuxapp/eal/eal.c: In function ‘eal_parse_base_virtaddr’: /home/lwrt/build/dpdk/i686-default-linuxapp-gcc/include/rte_common.h:133:22: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] RTE_PTR_ALIGN_FLOOR((typeof(ptr))RTE_PTR_ADD(ptr, (align) - 1), align) ^ /home/lwrt/build/dpdk/i686-default-linuxapp-gcc/include/rte_common.h:115:10: note: in definition of macro ‘RTE_PTR_ALIGN_FLOOR’ (typeof(ptr))rte_align_floor_int((uintptr_t)ptr, align) ^ /home/lwrt/build/dpdk/lib/librte_eal/linuxapp/eal/eal.c:566:9: note: in expansion of macro ‘RTE_PTR_ALIGN_CEIL’ addr = RTE_PTR_ALIGN_CEIL(addr, RTE_PGSIZE_2M); ^ /home/lwrt/build/dpdk/i686-default-linuxapp-gcc/include/rte_common.h:133:22: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] RTE_PTR_ALIGN_FLOOR((typeof(ptr))RTE_PTR_ADD(ptr, (align) - 1), align) ^ /home/lwrt/build/dpdk/i686-default-linuxapp-gcc/include/rte_common.h:115:46: note: in definition of macro ‘RTE_PTR_ALIGN_FLOOR’ (typeof(ptr))rte_align_floor_int((uintptr_t)ptr, align) ^ /home/lwrt/build/dpdk/lib/librte_eal/linuxapp/eal/eal.c:566:9: note: in expansion of macro ‘RTE_PTR_ALIGN_CEIL’ addr = RTE_PTR_ALIGN_CEIL(addr, RTE_PGSIZE_2M); ^ cc1: all warnings being treated as errors RTE_PTR_ALIGN_CEIL return type is the same as what we give it as input. So instead of casting the returned value, cast 'addr' which should be the same as base_virtaddr. Reported-by: Mats Liljegren Signed-off-by: David Marchand --- lib/librte_eal/linuxapp/eal/eal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index db0e15c..72b4dd7 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -563,9 +563,9 @@ eal_parse_base_virtaddr(const char *arg) #endif /* align the addr on 2M boundary */ - addr = RTE_PTR_ALIGN_CEIL(addr, RTE_PGSIZE_2M); + internal_config.base_virtaddr = RTE_PTR_ALIGN_CEIL((uintptr_t)addr, + RTE_PGSIZE_2M); - internal_config.base_virtaddr = (uintptr_t) addr; return 0; } -- 1.7.10.4