[PATCH 2/2 l2-mtd-2.6/dunno] NAND: fix almost all checkpatch warnings

Artem Bityutskiy dedekind1 at gmail.com
Thu Sep 2 13:40:03 EDT 2010


Hi,

I appreciate clean-up patches, but I do not like few things in this one:

On Thu, 2010-09-02 at 13:56 +0200, Florian Fainelli wrote:
>  		/* send the command to read the particular ecc bytes */
>  		/* take care about buswidth alignment in read_buf */
> -		aligned_pos = eccpos[start_step * chip->ecc.bytes] & ~(busw - 1);
> +		aligned_pos = eccpos[start_step * chip->ecc.bytes] &
> +								~(busw - 1);
>  		aligned_len = eccfrag_len;
>  		if (eccpos[start_step * chip->ecc.bytes] & (busw - 1))
>  			aligned_len++;
> -		if (eccpos[(start_step + num_steps) * chip->ecc.bytes] & (busw - 1))
> +		if (eccpos[(start_step + num_steps) * chip->ecc.bytes] &
> +								(busw - 1))

This is not pretty, How about a temporary variable, e.g.

i = (start_step + num_steps) * chip->ecc.bytes;
if (eccpos[i] & (busw - 1))

> -				memcpy(buf, chip->buffers->databuf + col, bytes);
> +				memcpy(buf, chip->buffers->databuf + col,
> +									bytes);

This is not nice as well, too many indentations for 'bytes'

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




More information about the linux-mtd mailing list