[PATCH] [OneNAND] OTP support re-implementation 1/1

Artem Bityutskiy dedekind1 at gmail.com
Thu Sep 3 02:10:45 EDT 2009


On Thu, 2009-09-03 at 11:21 +0530, Amul Kumar Saha wrote:
> Hi Artem,
> 
> >> +if MTD_ONENAND_OTP
> >> +
> >> +config ONENAND_OTP_AREA
> >> + bool "OTP area ONLY"
> >> + depends on MTD_ONENAND_OTP
> >> + select ON_OTP_AREA
> >> +
> >> +config ONENAND_OTP_BLOCK0
> >> + bool "Block[0] ONLY"
> >> + depends on MTD_ONENAND_OTP&&  !ONENAND_OTP_AREA
> >> + select ON_OTP_BLOCK0
> >> +
> >> +config ONENAND_OTP_AREA_BLOCK0
> >> + bool "BOTH OTP area AND Block[0]"
> >> + depends on MTD_ONENAND_OTP&&  !ONENAND_OTP_AREA&&  !ONENAND_OTP_BLOCK0
> >> + select ON_OTP_AREA_BLOCK0
> >> +
> >> +endif #MTD_ONENAND_OTP
> >
> > If there were 10 OTP blocks, would you add 10 options?
> > I mean, are these switches really needed? Can we remove them?
> 
> There is just one OTP block.
> Three options are provided for the three known combinations of 1st Block and the OTP Block.
> The option to choose one should be provided to the user.

Wouldn't it be better to  make this run-time configurable? E.g., module
parameters? Too many config options are frowned upon usually.

> >> + struct onenand_chip *this = mtd->priv;
> >> + int value, block, page;
> >> +
> >> + /* Address translation */
> >> + switch (cmd) {
> >> + case ONENAND_CMD_OTP_ACCESS:
> >> + block = (int) (addr>>  this->erase_shift);
> >
> > Why do you need the (int) cast there? How about cleaning up
> >>> (missing space) ?
> 
> I can do that, but (int) cast has been followed throughout onenand_base.c file
> Just adhering to that.

Ok, you could send a cleanup patch for all places.

> 
> >> + page = -1;
> >> + break;
> >> +
> >> + default:
> >> + block = (int) (addr>>  this->erase_shift);
> >> + page = (int) (addr>>  this->page_shift);
> >
> > Ditto. And there are many places where you did not have put spaces properly.
> 
> I can't see any in the patch I sent.

Sorry, this is my stupid Thunderbug, probably.

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




More information about the linux-mtd mailing list