From: Marek Vasut <marex@denx.de>
To: Austin Boyle <boyle.austin@gmail.com>
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mtd: m25p80: Calculate flash block protect bits based on number of sectors
Date: Wed, 16 Apr 2014 14:30:39 +0200 [thread overview]
Message-ID: <201404161430.39384.marex@denx.de> (raw)
In-Reply-To: <alpine.DEB.2.02.1404162216160.3848@austin-Satellite-L510>
On Wednesday, April 16, 2014 at 02:26:41 PM, Austin Boyle wrote:
> On Sun, 13 Apr 2014, Marek Vasut wrote:
> > This portion of code looks like a duplicate of ...
> >
> > > + for (lock_bits = 1; lock_bits < 7; lock_bits++) {
> > > + protected_area_start = flash->mtd.size -
> > > + get_protected_area(flash, lock_bits);
> > > + if (offset+len >= protected_area_start)
> > > + break;
> > > + }
> > > + lock_bits--;
> > > +
> > > + status_new = (status_old & ~SR_BP_BIT_MASK) |
> > > + ((lock_bits << SR_BP_BIT_OFFSET) & SR_BP_BIT_MASK);
> >
> > ... this here (if you don't consider the lock_bits--) . Why don't we move
> > this into a separate function to avoid the duplication?
>
> Thanks for reviewing this patch Marek, your suggestions were very
> helpful. I am about to post another version that
> hopefully addresses the issues raised, I would appreciate if you can take
> another look at it.
Actually, thank _you_ for working on this :)
Best regards,
Marek Vasut
prev parent reply other threads:[~2014-04-16 12:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-06 11:19 [PATCH v2] mtd: m25p80: Calculate flash block protect bits based on number of sectors Austin Boyle
2014-04-13 17:24 ` Marek Vasut
2014-04-16 12:26 ` Austin Boyle
2014-04-16 12:30 ` Marek Vasut [this message]
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=201404161430.39384.marex@denx.de \
--to=marex@denx.de \
--cc=boyle.austin@gmail.com \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).