public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: vboxvideo: vbox_main: Remove unnecessary local variable
@ 2019-01-10  6:13 Sidong Yang
  2019-01-10 12:23 ` Dan Carpenter
  2019-01-11  9:42 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 6+ messages in thread
From: Sidong Yang @ 2019-01-10  6:13 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Sidong Yang, devel, linux-kernel

Removed unnecessary local variable in have_hgsmi_mode_hints.
The result of hgsmi_query_conf should be directly compared without
assigning to local variable.

Signed-off-by: Sidong Yang <realwakka@gmail.com>
---
 drivers/staging/vboxvideo/vbox_main.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/vboxvideo/vbox_main.c b/drivers/staging/vboxvideo/vbox_main.c
index e1fb70a42d32..62a69fde7435 100644
--- a/drivers/staging/vboxvideo/vbox_main.c
+++ b/drivers/staging/vboxvideo/vbox_main.c
@@ -170,18 +170,15 @@ static void vbox_accel_fini(struct vbox_private *vbox)
 static bool have_hgsmi_mode_hints(struct vbox_private *vbox)
 {
 	u32 have_hints, have_cursor;
-	int ret;
 
-	ret = hgsmi_query_conf(vbox->guest_pool,
-			       VBOX_VBVA_CONF32_MODE_HINT_REPORTING,
-			       &have_hints);
-	if (ret)
+	if (hgsmi_query_conf(vbox->guest_pool,
+			     VBOX_VBVA_CONF32_MODE_HINT_REPORTING,
+			     &have_hints))
 		return false;
 
-	ret = hgsmi_query_conf(vbox->guest_pool,
-			       VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING,
-			       &have_cursor);
-	if (ret)
+	if (hgsmi_query_conf(vbox->guest_pool,
+			     VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING,
+			     &have_cursor))
 		return false;
 
 	return have_hints == VINF_SUCCESS && have_cursor == VINF_SUCCESS;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-01-11  9:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-10  6:13 [PATCH] staging: vboxvideo: vbox_main: Remove unnecessary local variable Sidong Yang
2019-01-10 12:23 ` Dan Carpenter
2019-01-10 17:00   ` Sidong Yang
2019-01-10 19:44     ` Dan Carpenter
2019-01-11  3:36       ` Sidong Yang
2019-01-11  9:42 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox