Re: [PATCH RFC] Remove useless return variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Added CC: trivial@xxxxxxxxxxxxxxx

On Sun, May 18, 2014 at 7:04 AM, Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:
> Peter Senna Tschudin <peter.senna@xxxxxxxxx> 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)
The average age in days of the return statements my patch changes is
1384, which is more than 3 years, so, in average, the plan of adding
new code was lost...
See: http://pastebin.com/2k13sHU2

>
> 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.
My goal is to make the code cleaner and easier to understand.

Should I split this into a lot of patches?

>
> -Andi
>
> --
> ak@xxxxxxxxxxxxxxx -- Speaking for myself only



-- 
Peter

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux