Received: from eggs.gnu.org ([2001:4830:134:3::10]:54335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3kuS-00026R-HD for qemu-devel@nongnu.org; Sun, 15 Oct 2017 11:33:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3kuP-0004d2-DC for qemu-devel@nongnu.org; Sun, 15 Oct 2017 11:33:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54834) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3kuP-0004cQ-8A for qemu-devel@nongnu.org; Sun, 15 Oct 2017 11:32:57 -0400 References: <20171013054842.32120-1-sw@weilnetz.de> From: Paolo Bonzini Message-ID: <4028eece-c9ff-113a-3cab-1a95c9ce79cc@redhat.com> Date: Sun, 15 Oct 2017 17:32:49 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] oslib-posix: Fix compiler warning and some data types List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Stefan Weil , Richard Henderson Cc: qemu-devel@nongnu.org, Stefan Hajnoczi On 14/10/2017 18:53, Philippe Mathieu-Daud=C3=A9 wrote: >> @@ -328,7 +328,7 @@ static void *do_touch_pages(void *arg) >> * don't need to write at all so we don't cause >> * wear on the storage backing the region... >> */ >> - *(volatile char *)addr =3D *addr; >> + *addr =3D *addr; > I personally prefer the other form which is mostly self-explicit when > reviewing this code. >=20 > Declaring addr non volatile and using volatile cast here: > Reviewed-by: Philippe Mathieu-Daud=C3=A9 >=20 I agree with Philippe; in genereal, volatile is more of a property of the access rather than the variable. Paolo