[DTrace-devel] [PATCH] Refactoring for greater stylistic consistency

Eugene Loh eugene.loh at oracle.com
Tue Jan 5 17:32:43 PST 2021


On 01/05/2021 08:13 AM, Kris Van Hees wrote:

> On Mon, Dec 14, 2020 at 05:27:40PM -0500, eugene.loh at oracle.com wrote:
>> From: Eugene Loh <eugene.loh at oracle.com>
>>
>> Make stylistic changes for greater consistency.  Where possible:
>> - eliminate "(void)" on function calls
>> - eliminate parentheses on "return" argument
>> - eliminate {} on single-statement "if" and "else" blocks
>>      (this was not done exhaustively)
>> - eliminate space in "sizeof ()"
>> - consolidate to fewer lines
>>      (e.g., where the above changes made lines sufficiently shorter)
> Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
> ... pending a few tiny things mentioned below

Thanks for the R-by, but:

1)  You seem to want no space in "(typecast) foo".  There are many more 
instances of that than the cases you flagged.  I assume we should be 
methodical about this.  So I went through and changed the others.  If 
you like, I can make that available as a v2 patch or as a subsequent 
patch (to avoid having to look again at those thousands of lines of 
diffs).  Let me know.

2)  Style is subjective and clearly we're asking here for practices that 
not everyone employs.  Shall I start a style guide?  E.g., a top-level 
file with a list of rules.  Something akin to (but hopefully much 
shorter than) the kernel's Documentation/process/coding-style.rst.



More information about the DTrace-devel mailing list