From: Dan Carpenter <dan.carpenter@oracle•com>
To: Dexuan Cui <decui@microsoft•com>
Cc: "pebolle@tiscali•nl" <pebolle@tiscali•nl>,
"gregkh@linuxfoundation•org" <gregkh@linuxfoundation•org>,
"jasowang@redhat•com" <jasowang@redhat•com>,
"driverdev-devel@linuxdriverproject•org"
<driverdev-devel@linuxdriverproject•org>,
"olaf@aepfle•de" <olaf@aepfle•de>,
"linux-kernel@vger•kernel.org" <linux-kernel@vger•kernel.org>,
"stephen@networkplumber•org" <stephen@networkplumber•org>,
"stefanha@redhat•com" <stefanha@redhat•com>,
"netdev@vger•kernel.org" <netdev@vger•kernel.org>,
"apw@canonical•com" <apw@canonical•com>,
"davem@davemloft•net" <davem@davemloft•net>
Subject: Re: [PATCH V3 3/7] Drivers: hv: vmbus: add APIs to send/recv hvsock packet and get the r/w-ability
Date: Thu, 23 Jul 2015 13:10:57 +0300 [thread overview]
Message-ID: <20150723101057.GQ5371@mwanda> (raw)
In-Reply-To: <75f1792c788e418eaddc0d6b7e3381de@SIXPR30MB031.064d.mgd.msft.net>
On Thu, Jul 23, 2015 at 03:05:16AM +0000, Dexuan Cui wrote:
> The kind of usage is not rare in the kernel code:
Yeah. But it's used 5% of the time. If it's under 15% then there is a
risk that we'll write a checkpatch rule to enforce the standard way...
There are some places where != 0 is idiomatic, like when you are talking
about the number zero. strcmp() and friends should always be != 0 or
== 0.
In this specific case, writing it as "if (ret != 0)" caused the bug. If
we had written it as "if (ret) return ret;" then there are no zeroes so
wouldn't have been any temptation to return the zero instead of the ret.
> Hi Dan, I read this as a humor. :-)
:)
regards,
dan carpenter
next prev parent reply other threads:[~2015-07-23 10:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-21 10:58 [PATCH V3 3/7] Drivers: hv: vmbus: add APIs to send/recv hvsock packet and get the r/w-ability Dexuan Cui
2015-07-21 14:07 ` Vitaly Kuznetsov
2015-07-22 10:09 ` Dexuan Cui
2015-07-22 10:35 ` Dan Carpenter
2015-07-23 3:05 ` Dexuan Cui
2015-07-23 10:10 ` Dan Carpenter [this message]
2015-07-23 10:24 ` Dan Carpenter
2015-07-23 11:05 ` Dexuan Cui
2015-07-24 6:27 ` Sudip Mukherjee
2015-07-24 8:33 ` Dan Carpenter
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=20150723101057.GQ5371@mwanda \
--to=dan.carpenter@oracle$(echo .)com \
--cc=apw@canonical$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=decui@microsoft$(echo .)com \
--cc=driverdev-devel@linuxdriverproject$(echo .)org \
--cc=gregkh@linuxfoundation$(echo .)org \
--cc=jasowang@redhat$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=olaf@aepfle$(echo .)de \
--cc=pebolle@tiscali$(echo .)nl \
--cc=stefanha@redhat$(echo .)com \
--cc=stephen@networkplumber$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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