public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Florian Fainelli <florian@openwrt.org>
Cc: David Woodhouse <dwmw2@infradead.org>, linux-mtd@lists.infradead.org
Subject: Re: [PATCH 2/2 l2-mtd-2.6/dunno] NAND: fix almost all checkpatch warnings
Date: Thu, 02 Sep 2010 20:40:03 +0300	[thread overview]
Message-ID: <1283449203.1694.4.camel@brekeke> (raw)
In-Reply-To: <201009021356.00275.ffainelli@freebox.fr>

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 (Битюцкий Артём)

  reply	other threads:[~2010-09-02 17:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-02 11:56 [PATCH 2/2 l2-mtd-2.6/dunno] NAND: fix almost all checkpatch warnings Florian Fainelli
2010-09-02 17:40 ` Artem Bityutskiy [this message]
2010-09-02 17:44 ` Artem Bityutskiy
2010-09-02 17:54 ` Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1283449203.1694.4.camel@brekeke \
    --to=dedekind1@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=florian@openwrt.org \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox