Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752407AbbGAJVI (ORCPT ); Wed, 1 Jul 2015 05:21:08 -0400 Received: from sender153-mail.zoho.com ([74.201.84.153]:22248 "EHLO sender153-mail.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752916AbbGAJU5 (ORCPT ); Wed, 1 Jul 2015 05:20:57 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=subject:to:references:cc:from:message-id:date:user-agent:mime-version:in-reply-to:content-type; b=siOSSLHHODV4I+67PYaACkfyEolEEgCdIaVgoHAMwMW+27citPS7gedD3QbKrcl6YhHQ32SSoIku 1IYtKGhMuwkXh78iZ6pBsf9LdJzZiXkbsSt9WLAXfGsnzEURg3Q/ Subject: Re: [PATCH] Staging: unisys: virtpci: fixed a brace coding style issue To: Julia Lawall References: <55930BB1.10502@zoho.com> <20150701065749.GA2411@sudip-PC> <55939890.6090903@zoho.com> Cc: Sudip Mukherjee , benjamin.romer@unisys.com, david.kershner@unisys.com, bryan.thompson@unisys.com, erik.arfvidson@unisys.com, devel@driverdev.osuosl.org, gregkh@linuxfoundation.org, sparmaintainer@unisys.com, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org From: Sohny Thomas Message-ID: <5593B0EA.1070101@zoho.com> Date: Wed, 1 Jul 2015 14:50:42 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1226 Lines: 37 >>>> i = virtpci_device_del(NULL /*no parent bus */, VIRTHBA_TYPE, >>>> &scsi.wwnn, NULL); >>>> - if (i) { >>>> + if (i) >>>> return 1; >>>> - } >>>> - return 0; >>>> + else >>>> + return 0; >>> No, now this will introduce a new checkpatch warning that "else is not >>> required after return". why did you introduce this "else"? >> I did this so that the code is more readable and understandable, I checked and >> checkpatch didn't call this out , so its clean. >> >> Otherwise the above code looks like this >> >> if(i) >> return 1; >> return 0; > > That looks fine. > > I haven't looked at the code in detail. Is it normal that the return > values seem to be 0 1 and -1? Which values represent success and which > represent an error? It is nicer to have the errors under if and success > as a direct return at the end. Here in this driver directory, return 1 means SUCCESS and return 0 means FAILURE So you mean my code change is fine? > > julia > -- 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/