public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Vimal Singh <vimal.newwork@gmail.com>
Cc: Linux MTD <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH v2 2/2] Creating helper func for block alignment verfication
Date: Fri, 29 Jan 2010 06:45:30 +0200	[thread overview]
Message-ID: <1264740330.21418.1.camel@localhost.localdomain> (raw)
In-Reply-To: <ce9ab5791001282019w79ed389av6dfe45226af4ee7a@mail.gmail.com>

On Fri, 2010-01-29 at 09:49 +0530, Vimal Singh wrote:
> On Thu, Jan 28, 2010 at 8:16 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> > Hi,
> >
> > On Wed, 2010-01-13 at 18:59 +0530, Vimal Singh wrote:
> >> From 310f7faa8f319bd9384512f7d5a7f13dcfbeebc8 Mon Sep 17 00:00:00 2001
> >> From: Vimal Singh <vimalsingh@ti.com>
> >> Date: Wed, 13 Jan 2010 18:11:47 +0530
> >> Subject: [PATCH] Creating helper func for block alignment verfication
> >>
> >> These checks are fairly common in 'nand_erase_nand', 'nand_lock'
> >> and 'nand_unlock' functions.
> >>
> >> Signed-off-by: Vimal Singh <vimalsingh@ti.com>
> >> ---
> >>  drivers/mtd/nand/nand_base.c |   97 +++++++++++++++---------------------------
> >>  1 files changed, 34 insertions(+), 63 deletions(-)
> >>
> >> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> >> index 4e27426..c80cec5 100644
> >> --- a/drivers/mtd/nand/nand_base.c
> >> +++ b/drivers/mtd/nand/nand_base.c
> >> @@ -108,6 +108,37 @@ static int nand_do_write_oob(struct
> >>   */
> >>  DEFINE_LED_TRIGGER(nand_led_trigger);
> >>
> >> +static int block_alignment_verification(struct mtd_info *mtd,
> >> +                                     loff_t ofs, uint64_t len)
> >> +{
> >
> > This function checks not only alignment, so the name is bad. I suggest
> > check_offs_len() - it at least does not lie about what it does :-)
> 
> OK, no problem.
> 
> >
> >> +     struct nand_chip *chip = mtd->priv;
> >> +
> >> +     DEBUG(MTD_DEBUG_LEVEL3, "%s: start = 0x%012llx, len = %llu\n",
> >> +                     __func__, (unsigned long long)ofs, len);
> >
> > No, you should keep the DEBUG part in the caller. Because of __func__.
> 
> Agree.
> 
> >
> > Also please, introduce the helper in the _first_ patch, and then use it
> > in your functions in the second patch. This is more logical.
> 
> Before 1st patch this helper will be called by just one function
> "nand_erase_nand". And then in that creating helper function does not
> makes sense to me.

It does. It will be a preparation to the next patch.

> To me doing this in 2nd patch looks more logical.
> 
> Either way we will achieve same goal only number of lines in patches will defer.
> So, if you still insist I can make it 1st patch.

OK, it is not a big deal.

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

  reply	other threads:[~2010-01-29  4:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-13 12:53 [PATCH 2/2] Creating helper func for block alignment verfication Vimal Singh
2010-01-13 13:06 ` Vimal Singh
2010-01-13 13:20   ` Vimal Singh
2010-01-13 13:29     ` [PATCH v2 " Vimal Singh
2010-01-13 13:37       ` Vimal Singh
2010-01-28 14:46       ` Artem Bityutskiy
2010-01-29  4:19         ` Vimal Singh
2010-01-29  4:45           ` Artem Bityutskiy [this message]
2010-01-29  5:38             ` Vimal Singh

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=1264740330.21418.1.camel@localhost.localdomain \
    --to=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=vimal.newwork@gmail.com \
    /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