Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758582AbaDXWb2 (ORCPT ); Thu, 24 Apr 2014 18:31:28 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:30877 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755353AbaDXWbY (ORCPT ); Thu, 24 Apr 2014 18:31:24 -0400 Date: Fri, 25 Apr 2014 01:30:59 +0300 From: Dan Carpenter To: KY Srinivasan Cc: Andev , "olaf@aepfle.de" , "netdev@vger.kernel.org" , "jasowang@redhat.com" , LKML , "apw@canonical.com" , "devel@linuxdriverproject.org" , "davem@davemloft.net" Subject: Re: [PATCH V1 net-next 1/1] hyperv: Enable sendbuf mechanism on the send path Message-ID: <20140424223059.GE26890@mwanda> References: <1398288285-16268-1-git-send-email-kys@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 24, 2014 at 10:06:24PM +0000, KY Srinivasan wrote: > > From: Andev [mailto:debiandev@gmail.com] > > Your use of goto exit/cleanup in some functions and returning directly on > > errors in others could use a cleanup. Please consider doing that while you are > > touching those files. > > Will do. The most recent changes I made to netvsc.c, I think was > consistent with the existing code; going forward we will certainly > move towards a more consistent coding style. It scares me when you talk about being consistent with the existing code... Just do it the correct way. 1) Don't do the "return ret;" if you know ret is zero. 2) Replace: ret = vmbus_sendpacket(...); return ret; with return vmbus_sendpacket(...); 3) Don't do "goto cleanup;" when "return ret;" will suffice. The do-nothing goto is misleading because you assume it will cleanup somthing. Some people used to misread CodingStyle to think that all functions should only have one return but I have updated it so it is more clear. 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/