All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Kershner <david.kershner@unisys.com>
To: gregkh@linuxfoundation.org,
	driverdev-devel@linuxdriverproject.org,
	sparmaintainer@unisys.com, jes.sorensen@gmail.com
Subject: [PATCH 06/28] staging: unisys: visorbus: Clean up vmcall address function.
Date: Wed, 30 Aug 2017 13:36:13 -0400	[thread overview]
Message-ID: <72476df252dedd5f1386a9101d878577c701f39b.1504109643.git-series.david.kershner@unisys.com> (raw)
In-Reply-To: <cover.7bb5ed2411c582ab1e54255b493f8455545061de.1504109643.git-series.david.kershner@unisys.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 <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
---
 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

  parent reply	other threads:[~2017-08-30 17:37 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 17:36 [PATCH 00/28] staging: unisys: More updates to make the code more readable David Kershner
2017-08-30 17:36 ` [PATCH 01/28] staging: unisys: use the kernel min define David Kershner
2017-08-30 17:36 ` [PATCH 02/28] staging: unisys: visorbus: visorchipset.c: Fix bug in parser_init_byte_stream David Kershner
2017-08-30 17:36 ` [PATCH 03/28] staging: unisys: visorbus: visorbus_main.c: Fix return values for checks in visorbus_register_visor_driver David Kershner
2017-08-30 17:36 ` [PATCH 04/28] staging: unisys: visornic: Fix up existing function comments David Kershner
2017-08-30 17:36 ` [PATCH 05/28] staging: unisys: visornic: Fix miscellaneous block comment format issues David Kershner
2017-08-30 17:36 ` David Kershner [this message]
2017-08-30 17:36 ` [PATCH 07/28] staging: unisys: visorbus: Fix parameter alignment David Kershner
2017-08-30 17:36 ` [PATCH 08/28] staging: unisys: visorbus: Convert macros to functions David Kershner
2017-08-30 17:36 ` [PATCH 09/28] staging: unisys: visorbus: Use __func__ instead of name David Kershner
2017-08-30 17:36 ` [PATCH 10/28] staging: unisys: Don't check for null before getting driver device David Kershner
2017-08-30 17:36 ` [PATCH 11/28] staging: unisys: include: Add comment next to mutex David Kershner
2017-08-30 17:36 ` [PATCH 12/28] staging: unisys: visorbus: Consolidate controlvm channel creation David Kershner
2017-08-30 17:36 ` [PATCH 13/28] staging: unisys: visorbus: Remove useless comment David Kershner
2017-08-30 17:36 ` [PATCH 14/28] staging: unisys: visorbus: Remove useless initialization David Kershner
2017-08-30 17:36 ` [PATCH 15/28] staging: unisys: visorbus: Remove check for valid parm_addr David Kershner
2017-08-30 17:36 ` [PATCH 16/28] staging: unisys: visorbus: Split else if blocks into multiple if David Kershner
2017-08-30 17:36 ` [PATCH 17/28] staging: unisys: Change data to point to visor_controlvm_parameters_header David Kershner
2017-08-30 17:36 ` [PATCH 18/28] staging: unisys: visorbus: Remove useless else clause in visorutil_spar_detect David Kershner
2017-08-30 17:36 ` [PATCH 19/28] staging: unisys: visorbus: remove uneeded initializations David Kershner
2017-08-30 17:36 ` [PATCH 20/28] staging: unisys: visorbus: Move parser functions location in file David Kershner
2017-08-30 17:36 ` [PATCH 21/28] staging: unisys: visorchipset: Shorten parser_init_byte_stream David Kershner
2017-08-30 17:36 ` [PATCH 22/28] staging: unisys: visorbus: use all 80 characters for multi-line messages David Kershner
2017-08-30 17:36 ` [PATCH 23/28] staging: unisys: visornic: Remove unnecessary return values David Kershner
2017-08-30 17:36 ` [PATCH 24/28] staging: unisys: Use size of channel defined in the channel David Kershner
2017-08-30 17:36 ` [PATCH 25/28] staging: unisys: visorbus: just check for GUID David Kershner
2017-08-30 17:36 ` [PATCH 26/28] staging: unisys: visorbus: Fix up GUID definition David Kershner
2017-08-30 17:36 ` [PATCH 27/28] staging: unisys: visorbus: remove EXPORT_SYMBOL_GPL for visor_check_channel David Kershner
2017-08-30 17:36 ` [PATCH 28/28] staging: unisys: change pr_err to dev_err in visor_check_channel David Kershner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72476df252dedd5f1386a9101d878577c701f39b.1504109643.git-series.david.kershner@unisys.com \
    --to=david.kershner@unisys.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jes.sorensen@gmail.com \
    --cc=sparmaintainer@unisys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.