Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752818AbbGWKLa (ORCPT ); Thu, 23 Jul 2015 06:11:30 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:40855 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752386AbbGWKLM (ORCPT ); Thu, 23 Jul 2015 06:11:12 -0400 Date: Thu, 23 Jul 2015 13:10:57 +0300 From: Dan Carpenter To: Dexuan Cui Cc: Vitaly Kuznetsov , "olaf@aepfle.de" , "pebolle@tiscali.nl" , "gregkh@linuxfoundation.org" , "jasowang@redhat.com" , "driverdev-devel@linuxdriverproject.org" , "linux-kernel@vger.kernel.org" , "stephen@networkplumber.org" , "stefanha@redhat.com" , "netdev@vger.kernel.org" , "apw@canonical.com" , "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 Message-ID: <20150723101057.GQ5371@mwanda> References: <1437476293-6837-1-git-send-email-decui@microsoft.com> <87zj2pk3jf.fsf@vitty.brq.redhat.com> <4538264677374d43961c2d709afb1dd3@SIXPR30MB031.064d.mgd.msft.net> <20150722103546.GO5371@mwanda> <75f1792c788e418eaddc0d6b7e3381de@SIXPR30MB031.064d.mgd.msft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <75f1792c788e418eaddc0d6b7e3381de@SIXPR30MB031.064d.mgd.msft.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 938 Lines: 25 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/