public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sidong Yang <realwakka@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Sidong Yang <realwakka@gmail.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] staging: vboxvideo: vbox_main: Remove unnecessary local variable
Date: Thu, 10 Jan 2019 06:13:47 +0000	[thread overview]
Message-ID: <20190110061347.31326-1-realwakka@gmail.com> (raw)

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


             reply	other threads:[~2019-01-10  6:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10  6:13 Sidong Yang [this message]
2019-01-10 12:23 ` [PATCH] staging: vboxvideo: vbox_main: Remove unnecessary local variable 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

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=20190110061347.31326-1-realwakka@gmail.com \
    --to=realwakka@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox