[PATCH 2:2][MTD][NAND]omap : Adding DMA mode support in nand prefetch/post-write

Artem Bityutskiy dedekind1 at gmail.com
Fri Jul 10 08:44:26 EDT 2009


David Woodhouse wrote:
> On Fri, 2009-07-10 at 15:02 +0300, Artem Bityutskiy wrote:
>> On Fri, 2009-07-10 at 17:25 +0530, vimal singh wrote:
>>> +	/* The fifo depth is 64 bytes. We have a sync at each frame and frame
>>> +	 * length is 64 bytes.
>>> +	 */
>>> +	int buf_len = len/64;
>> To optimize performance it is better not to rely on gcc and use <<
> 
> If you ever see gcc screwing up division of an 'int' by a constant 64,
> file a GCC bug.

I did see gcc generated division instruction instead of shift
instruction on x86 when the kernel is compiles with size optimization.
I think this is because it division instruction is shorter.

The exact place I we saw was the UBIFS binary search function, and
division by 2 was not compiled into a shift instruction.

So what I suggested is to use shift explicitly if this is wanted.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)



More information about the linux-mtd mailing list