From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Marchand Subject: [PATCH 1/2] eal: fix use of RTE_PTR_ALIGN_CEIL macro on 32bits system Date: Fri, 28 Feb 2014 09:21:35 +0100 Message-ID: <1393575696-25289-1-git-send-email-david.marchand@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: dev-VfR2kkLFssw@public.gmane.org To: liljegren.mats2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Return-path: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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 =E2=80=98eal_parse_base_virtaddr=E2=80=99: /home/lwrt/build/dpdk/i686-default-linuxapp-gcc/include/rte_common.h:133:= 22: error: cast from pointer to integer of different size [-Werror=3Dpointer-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 =E2=80=98RTE_PTR_ALIGN_FLOOR=E2=80=99 (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 =E2=80=98RTE_PTR_ALIGN_CEIL=E2=80=99 addr =3D 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=3Dpointer-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 =E2=80=98RTE_PTR_ALIGN_FLOOR=E2=80=99 (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 =E2=80=98RTE_PTR_ALIGN_CEIL=E2=80=99 addr =3D 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 =20 /* align the addr on 2M boundary */ - addr =3D RTE_PTR_ALIGN_CEIL(addr, RTE_PGSIZE_2M); + internal_config.base_virtaddr =3D RTE_PTR_ALIGN_CEIL((uintptr_t)addr, + RTE_PGSIZE_2M); =20 - internal_config.base_virtaddr =3D (uintptr_t) addr; return 0; } =20 --=20 1.7.10.4