From: Andrew Jones Subject: Re: [PATCH 2/9] Move phys_addr_t type definition to lib/libcflat.h Date: Wed, 20 Apr 2016 16:02:19 +0200 Message-ID: <20160420140219.vpqst65i2pdbttpy@hawk.localdomain> References: <402065c756cb125968afa0bf8614f9f50ad5f47c.1461155725.git.agordeev@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, Thomas Huth , Radim =?utf-8?B?S3LEjW3DocWZ?= To: Alexander Gordeev Return-path: Received: from mx1.redhat.com ([209.132.183.28]:34995 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751783AbcDTOCX (ORCPT ); Wed, 20 Apr 2016 10:02:23 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0D09981100 for ; Wed, 20 Apr 2016 14:02:23 +0000 (UTC) Content-Disposition: inline In-Reply-To: <402065c756cb125968afa0bf8614f9f50ad5f47c.1461155725.git.agordeev@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Apr 20, 2016 at 03:18:48PM +0200, Alexander Gordeev wrote: > This change leads to removing '#include 's from > several places that only included alloc.h to get the typedef. >=20 > Cc: Andrew Jones > Cc: Thomas Huth > Cc: Radim Kr=C4=8Dm=C3=A1=C5=99 > Suggested-by: Andrew Jones > Signed-off-by: Alexander Gordeev > --- > arm/selftest.c | 1 - > lib/alloc.h | 3 --- > lib/arm/asm/page.h | 2 -- > lib/arm/asm/setup.h | 1 - > lib/arm/setup.c | 1 - > lib/libcflat.h | 3 +++ > lib/powerpc/asm/setup.h | 1 - > 7 files changed, 3 insertions(+), 9 deletions(-) >=20 > diff --git a/arm/selftest.c b/arm/selftest.c > index 75dc91f..a8ae191 100644 > --- a/arm/selftest.c > +++ b/arm/selftest.c > @@ -7,7 +7,6 @@ > */ > #include > #include > -#include > #include > #include > #include > diff --git a/lib/alloc.h b/lib/alloc.h > index 0b4b4bd..81f5369 100644 > --- a/lib/alloc.h > +++ b/lib/alloc.h > @@ -58,9 +58,6 @@ static inline void *memalign(size_t alignment, size= _t size) > return alloc_ops->memalign(alignment, size); > } > =20 > -typedef u64 phys_addr_t; > -#define INVALID_PHYS_ADDR (~(phys_addr_t)0) Moving the typedef is fine, but INVALID_PHYS_ADDR is an arbitrary address chosen by the phys-mem-alloc subsystem. In practice it's probably invalid for everything else too, but it should probably stay in alloc.h. I realize the naming isn't great, as it doesn't convey the connection to alloc, but I'm not sure we want to rename it now. > - > /* > * phys_alloc is a very simple allocator which allows physical memor= y > * to be partitioned into regions until all memory is allocated. > diff --git a/lib/arm/asm/page.h b/lib/arm/asm/page.h > index df76969..3802641 100644 > --- a/lib/arm/asm/page.h > +++ b/lib/arm/asm/page.h > @@ -16,8 +16,6 @@ > =20 > #define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE) > =20 > -#include > - > typedef u64 pteval_t; > typedef u64 pmdval_t; > typedef u64 pgdval_t; > diff --git a/lib/arm/asm/setup.h b/lib/arm/asm/setup.h > index cb8fdbd..a502a04 100644 > --- a/lib/arm/asm/setup.h > +++ b/lib/arm/asm/setup.h > @@ -6,7 +6,6 @@ > * This work is licensed under the terms of the GNU LGPL, version 2. > */ > #include > -#include /* phys_addr_t */ > #include > #include > =20 > diff --git a/lib/arm/setup.c b/lib/arm/setup.c > index 8c6172f..1cba23a 100644 > --- a/lib/arm/setup.c > +++ b/lib/arm/setup.c > @@ -13,7 +13,6 @@ > #include > #include > #include > -#include > #include > #include > #include > diff --git a/lib/libcflat.h b/lib/libcflat.h > index b58a8a1..6aef14f 100644 > --- a/lib/libcflat.h > +++ b/lib/libcflat.h > @@ -60,6 +60,9 @@ typedef _Bool bool; > #define PRIx64 __PRI64_PREFIX "x" > #define PRIxPTR __PRIPTR_PREFIX "x" > =20 > +typedef u64 phys_addr_t; > +#define INVALID_PHYS_ADDR (~(phys_addr_t)0) > + > extern void puts(const char *s); > extern void exit(int code); > extern void abort(void); > diff --git a/lib/powerpc/asm/setup.h b/lib/powerpc/asm/setup.h > index 29a6d7d..b1e1e5a 100644 > --- a/lib/powerpc/asm/setup.h > +++ b/lib/powerpc/asm/setup.h > @@ -6,7 +6,6 @@ > * This work is licensed under the terms of the GNU LGPL, version 2. > */ > #include > -#include /* phys_addr_t */ > =20 > #define NR_CPUS 8 /* arbitrarily set for now */ > extern u32 cpus[NR_CPUS]; > --=20 > 1.8.3.1 > Thanks, drew=20