From: Julien Grall Subject: [PATCH 1/4] xen/arm: io: handle_read: Use a local variable to store dabt Date: Fri, 11 Dec 2015 15:28:20 +0000 Message-ID: <1449847703-21252-2-git-send-email-julien.grall@citrix.com> References: <1449847703-21252-1-git-send-email-julien.grall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1a7Pds-0003wo-S2 for xen-devel@lists.xenproject.org; Fri, 11 Dec 2015 15:29:56 +0000 In-Reply-To: <1449847703-21252-1-git-send-email-julien.grall@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Julien Grall , ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org Rather than getting dabt every time through info->dabt, introduce a local variable and use it. Also fix a coding style error in the if condition. Signed-off-by: Julien Grall --- xen/arch/arm/io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/io.c b/xen/arch/arm/io.c index de5765a..7e29943 100644 --- a/xen/arch/arm/io.c +++ b/xen/arch/arm/io.c @@ -26,7 +26,8 @@ static int handle_read(const struct mmio_handler *handler, struct vcpu *v, mmio_info_t *info, register_t *r) { - uint8_t size = (1 << info->dabt.size) * 8; + const struct hsr_dabt dabt = info->dabt; + uint8_t size = (1 << dabt.size) * 8; if ( !handler->ops->read(v, info, r, handler->priv) ) return 0; @@ -36,7 +37,7 @@ static int handle_read(const struct mmio_handler *handler, struct vcpu *v, * Note that we expect the read handler to have zeroed the bits * outside the requested access size. */ - if ( info->dabt.sign && (*r & (1UL << (size - 1)) )) + if ( dabt.sign && (*r & (1UL << (size - 1))) ) { /* * We are relying on register_t using the same as -- 2.1.4