lkml.org 
[lkml]   [2014]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH RFC] Remove useless return variables
Date
Peter Senna Tschudin <peter.senna@gmail.com> writes:

> This patch remove variables that are initialized with a constant,
> are never updated, and are only used as parameter of return.
> Return the constant instead of using a variable.

This ret variable pattern is pretty standard in Linux, as it makes it
easier to add new code that may trigger new errors
(using the usual "goto forest" error handling pattern)

I don't see any benefit in whole-sale removing it. The compiler
doesn't care about it and will generate the same code in any
case.

-Andi

--
ak@linux.intel.com -- Speaking for myself only


\
 
 \ /
  Last update: 2014-05-18 07:41    [W:0.042 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site