Re: [PATCH] xip cleanups

Jörn Engel
2005-06-28T12:53:52Z

On Tue, 28 June 2005 14:01:59 +0200, Christoph Hellwig wrote:
>
> adjust to kernel style and remove some unneeded NULL checks

Cool!

> rc = __inode_direct_access(inode, sector, &data);
> - if (rc)
> - return rc;
> - clear_page((void*)data);
> - return 0;
> + if (!rc)
> + clear_page(data);
> + return rc;

I personally prefer the original code. As a general rule, error
handling code is indented further than regular good-case code. That
makes reading a *lot* faster and the compiler should be smart enough
to generate identical code.

What are your arguments for the change?

> - (mapping->host,tmp.b_blocknr*(PAGE_SIZE/512) ,&data);
> + (mapping->host,tmp.b_blocknr * (PAGE_SIZE/512), &data);
^
You missed one.

Jörn

--
Fancy algorithms are slow when n is small, and n is usually small.
Fancy algorithms have big constants. Until you know that n is
frequently going to be big, don't get fancy.
-- Rob Pike