mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sidong Yang <realwakka@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: vboxvideo: vbox_main: Remove unnecessary local variable
Date: Thu, 10 Jan 2019 17:00:24 +0000	[thread overview]
Message-ID: <20190110170023.4vcyws3ktsf2sz3g@raspberrypi> (raw)
In-Reply-To: <20190110122358.GC1743@kadam>

On Thu, Jan 10, 2019 at 03:23:58PM +0300, Dan Carpenter wrote:
> On Thu, Jan 10, 2019 at 06:13:47AM +0000, Sidong Yang wrote:
> > 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>
> > ---
> 
> I sort of prefer the original...
> 
> The hgsmi_query_conf() function returns negative error codes if it
> can't complete the query because of allocation failures.  To me that's
> more obvious, when we write it in the original way.
> 
> In the new code it looks like it returns bool or something.  The
> copy_to/from_user() are normally written like if (copy_to_user()) {
> but those don't return negative error codes so it's a different
> situation.
> 

Hi, Dan.

I think you just point out that my code isn't obvious because the
function returns negative error codes. I agree with you. But what if
change my code like if(hgsmi_query_conf() != 0). 

> This isn't something in checkpatch or CodingStyle so there isn't a
> standard.  It's just personal opinion vs personal opinion.  If you were
> going to do a lot of vboxvideo development, then it would be your
> opinion which matters the most because you are doing the work.  But
> this is your first vboxvideo patch...
> 
> Let's just leave it as-is.

I agree with this comment. I'm just a newbie for this module and It
isn't about checkpatch or CodingStyle. but I just wondered if my code
has problem.

regards,
Sidong Yang

> 
> regards,
> dan carpenter
> 
> 

  reply	other threads:[~2019-01-10 17:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10  6:13 Sidong Yang
2019-01-10 12:23 ` Dan Carpenter
2019-01-10 17:00   ` Sidong Yang [this message]
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=20190110170023.4vcyws3ktsf2sz3g@raspberrypi \
    --to=realwakka@gmail.com \
    --cc=dan.carpenter@oracle.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

Powered by JetHome