2006-05-21 11:06:14

by Chris Wedgwood

[permalink] [raw]
Subject: Re: + x86-move-vsyscall-page-out-of-fixmap-above-stack-tidy.patch added to -mm tree

On Sun, May 21, 2006 at 02:51:54AM -0700, [email protected] wrote:

> - if ((ret = insert_vm_struct(mm, vma))) {
> + ret = insert_vm_struct(mm, vma);
> + if (ret) {

Urgh.

It's not really any cleaner/clearer so why do that?


2006-05-21 12:10:00

by Andrew Morton

[permalink] [raw]
Subject: Re: + x86-move-vsyscall-page-out-of-fixmap-above-stack-tidy.patch added to -mm tree

Chris Wedgwood <[email protected]> wrote:
>
> On Sun, May 21, 2006 at 02:51:54AM -0700, [email protected] wrote:
>
> > - if ((ret = insert_vm_struct(mm, vma))) {
> > + ret = insert_vm_struct(mm, vma);
> > + if (ret) {
>
> Urgh.
>
> It's not really any cleaner/clearer so why do that?
>

Because it's cleaner and clearer and because Linus said.

One is an assignment and the other is a test. These have nothing to do
with each other.

Keep it simple.

2006-05-21 18:18:11

by Chris Wedgwood

[permalink] [raw]
Subject: Re: + x86-move-vsyscall-page-out-of-fixmap-above-stack-tidy.patch added to -mm tree

On Sun, May 21, 2006 at 05:09:51AM -0700, Andrew Morton wrote:

> Because it's cleaner and clearer

some would disagree

> and because Linus said.

ok, sure, that works (i don't personally agree, but if there is
contention it's best that someone just stands up and says "because i
said so")

> One is an assignment and the other is a test. These have nothing to
> do with each other.

should there be a comment in codingstyle about this then perhaps?