lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5593B0EA.1070101@zoho.com>
Date:	Wed, 1 Jul 2015 14:50:42 +0530
From:	Sohny Thomas <sohnythomas@...o.com>
To:	Julia Lawall <julia.lawall@...6.fr>
Cc:	Sudip Mukherjee <sudipm.mukherjee@...il.com>,
	benjamin.romer@...sys.com, david.kershner@...sys.com,
	bryan.thompson@...sys.com, erik.arfvidson@...sys.com,
	devel@...verdev.osuosl.org, gregkh@...uxfoundation.org,
	sparmaintainer@...sys.com, kernel-janitors@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Staging: unisys: virtpci: fixed a brace coding style
 issue

>>>>   	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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ