From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id D5EA51BFF0F for ; Wed, 30 Aug 2017 17:37:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D1C0C2EEAB for ; Wed, 30 Aug 2017 17:37:17 +0000 (UTC) Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JUHBWhLHx9AF for ; Wed, 30 Aug 2017 17:37:17 +0000 (UTC) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0067.outbound.protection.outlook.com [104.47.36.67]) by silver.osuosl.org (Postfix) with ESMTPS id 0B1752E71F for ; Wed, 30 Aug 2017 17:37:17 +0000 (UTC) From: David Kershner Subject: [PATCH 06/28] staging: unisys: visorbus: Clean up vmcall address function. Date: Wed, 30 Aug 2017 13:36:13 -0400 Message-ID: <72476df252dedd5f1386a9101d878577c701f39b.1504109643.git-series.david.kershner@unisys.com> In-Reply-To: References: MIME-Version: 1.0 List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: gregkh@linuxfoundation.org, driverdev-devel@linuxdriverproject.org, sparmaintainer@unisys.com, jes.sorensen@gmail.com The function vmcall address needed to be cleaned up. The structure vmcall_controlvm_addr was not needed so it was removed and was replaced with vmcall_io_controlvm_addr_params since it needs to be allocated on the heap for DMA access. With the structure removed and the fields as local variables, it helped clean up the formatting of the function. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 27 +++++++------------ 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index e296df7..7423c9e 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -86,12 +86,6 @@ struct vmcall_io_controlvm_addr_params { u8 unused[4]; } __packed; -struct vmcall_controlvm_addr { - struct vmcall_io_controlvm_addr_params params; - int err; - u64 physaddr; -}; - struct visorchipset_device { struct acpi_device *acpi_device; unsigned long poll_jiffies; @@ -109,7 +103,7 @@ struct visorchipset_device { */ struct controlvm_message controlvm_pending_msg; bool controlvm_pending_msg_valid; - struct vmcall_controlvm_addr controlvm_addr; + struct vmcall_io_controlvm_addr_params controlvm_params; }; static struct visorchipset_device *chipset_dev; @@ -1341,15 +1335,16 @@ static int unisys_vmcall(unsigned long tuple, unsigned long param) static unsigned int issue_vmcall_io_controlvm_addr(u64 *control_addr, u32 *control_bytes) { - chipset_dev->controlvm_addr.physaddr = virt_to_phys( - &chipset_dev->controlvm_addr.params); - chipset_dev->controlvm_addr.err = unisys_vmcall(VMCALL_CONTROLVM_ADDR, - chipset_dev->controlvm_addr.physaddr); - if (chipset_dev->controlvm_addr.err) - return chipset_dev->controlvm_addr.err; - - *control_addr = chipset_dev->controlvm_addr.params.address; - *control_bytes = chipset_dev->controlvm_addr.params.channel_bytes; + u64 physaddr; + int err; + + physaddr = virt_to_phys(&chipset_dev->controlvm_params); + err = unisys_vmcall(VMCALL_CONTROLVM_ADDR, physaddr); + if (err) + return err; + + *control_addr = chipset_dev->controlvm_params.address; + *control_bytes = chipset_dev->controlvm_params.channel_bytes; return 0; } -- git-series 0.9.1 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel