From mboxrd@z Thu Jan 1 00:00:00 1970 From: Doug Goldstein Subject: Re: [PATCH] xen/mm: Fix page_list_* helpers to evaluate all their arguments Date: Sat, 5 Mar 2016 17:42:54 -0600 Message-ID: <56DB6EFE.1090801@cardoe.com> References: <1457196754-6299-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4638179418462340690==" Return-path: In-Reply-To: <1457196754-6299-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Andrew Cooper , Xen-devel Cc: George Dunlap , Tim Deegan , Jan Beulich List-Id: xen-devel@lists.xenproject.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============4638179418462340690== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="P2o3AoRiNSOLL0HHGDLh6oFcSm52d6MKH" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --P2o3AoRiNSOLL0HHGDLh6oFcSm52d6MKH Content-Type: multipart/mixed; boundary="s3Ab9CET86HWbNVno5Sscl7s2SKV4s0wb" From: Doug Goldstein To: Andrew Cooper , Xen-devel Cc: Jan Beulich , Tim Deegan , George Dunlap Message-ID: <56DB6EFE.1090801@cardoe.com> Subject: Re: [PATCH] xen/mm: Fix page_list_* helpers to evaluate all their arguments References: <1457196754-6299-1-git-send-email-andrew.cooper3@citrix.com> In-Reply-To: <1457196754-6299-1-git-send-email-andrew.cooper3@citrix.com> --s3Ab9CET86HWbNVno5Sscl7s2SKV4s0wb Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 3/5/16 10:52 AM, Andrew Cooper wrote: > If an architecture does not provide a custom page_list_entry, default > page_list_* helpers are provided, wrapping list_head as an underlying t= ype for > page_list_head. >=20 > The two declarations of the page_list_* helpers differ between defines = and > static inline functions, where the defines discard some of their parame= ters. >=20 > This causes a compilation failure if CONFIG_BIGMEM and debug=3Dn in p2m= -pod.c: >=20 > p2m-pod.c: In function =E2=80=98p2m_pod_cache_add=E2=80=99: > p2m-pod.c:72:20: error: unused variable =E2=80=98d=E2=80=99 [-Werror=3D= unused-variable] > struct domain *d =3D p2m->domain; > ^ > cc1: all warnings being treated as errors >=20 > because the use of d outside of the !NDEBUG section doesn't get evaluat= ed as a > parameter by page_list_del(). >=20 > Fix this by turning all #defines into static inline functions, so all > parameters are evaluated even if they are not used. >=20 > Doing this reveals that const-correctness of page_list_{next,prev}() is= > suspect, taking a const pointer and returning a non-const one. It is l= eft > functioning as it did before, with an explicit typecast to remove const= ness. >=20 > While editing this area, correct the return type of page_list_empty fro= m int > to bool_t. >=20 > Reported-by: Doug Goldstein > Signed-off-by: Andrew Cooper Reviewed-by: Doug Goldstein I had planned on doing something similar but your commit message is much better than what I would have come up with. Not sure if people would like Identified-by: Travis CI but it actually required a patch to be found. http://lists.xen.org/archives/html/xen-devel/2016-03/msg00735.html which is waiting to be merged. --=20 Doug Goldstein --s3Ab9CET86HWbNVno5Sscl7s2SKV4s0wb-- --P2o3AoRiNSOLL0HHGDLh6oFcSm52d6MKH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0 iQJ8BAEBCgBmBQJW228BXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNTM5MEQ2RTNFMTkyNzlCNzVDMzIwOTVB MkJDMDNEQzg3RUQxQkQ0AAoJEKK8A9yH7RvUoaUP/0+b1mRURcyNsO1qU65ZeGyu jCKXpGNGL5jwN+7UP9oWUt7IIYVkcs2mLhbYSl2Q4XFs/+gKHumLoAeQhDo1OBK2 NAqiPABC3OK5bCFZxy8ZgCnOrsSNVXFOnlUmzi3niwfvUUSY2GZF+0DAsxgXp1oJ 0Of9VwZt99d15ceRDIWn5NT02w8XQ8KzsqnL12J5T5vfymQisBJVVoLybyKudvyS 4QuChizXrVbmOrUEoeWmdGJSc7RuIPat3xcZUF0Ah0StR8IFiRGdvyJPzQK4j6m1 KPTadAZUHXwW95Fvn7c+DJyI/RQz3jzBXKfCvjQAmMlMGT1lSpRAOQCPbvQYQG5E U+a6P35kSA797h5mH+4Z3zihi9mOyT19sRQv2Lyz7PdaVBg7bAx2wG2zNGPMlekv dCeQwLDqCJjSVfGHR0AHt+Q+rK6373SLJKzwL2t9KosPLY85/tBv+k2TFufWxcID 61OskrR1JoFe4dzhENa584AwTaVwFru/Hijr4AdoTg5ir4h9Ws0abB02DfAqbA7l cs/+f9jFs+crGRHo54209wX3oeVJZB7NAxDhhaUO7LhxBBLsSjD8zRVf8piC0Ntn 6FFxVx8r9JJaGpjd8r/nHCDeK3ddS17Gi3bCYigazn9CsALc9MyTR+x90jQg6HG2 HmC0q9cDy43mmhXi14r9 =VNzx -----END PGP SIGNATURE----- --P2o3AoRiNSOLL0HHGDLh6oFcSm52d6MKH-- --===============4638179418462340690== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============4638179418462340690==--