Re: [PATCH 13/29] memstick: core: stop passing pointer tocard->current_mrq

From: Maxim Levitsky
Date: Mon Oct 25 2010 - 22:04:26 EST


On Mon, 2010-10-25 at 08:41 -0700, Alex Dubov wrote:
>
> --- On Fri, 22/10/10, Maxim Levitsky <maximlevitsky@xxxxxxxxx> wrote:
>
> > From: Maxim Levitsky <maximlevitsky@xxxxxxxxx>
> > Subject: [PATCH 13/29] memstick: core: stop passing pointer to card->current_mrq
> > To: "Alex Dubov" <oakad@xxxxxxxxx>
> > Cc: "Andrew Morton" <akpm@xxxxxxxxxxxxxxxxxxxx>, "LKML" <linux-kernel@xxxxxxxxxxxxxxx>, "Maxim Levitsky" <maximlevitsky@xxxxxxxxx>
> > Received: Friday, 22 October, 2010, 4:53 PM
> > This cleans up a lot of code and
> > makes the assumption
> > (*mrq == &card->current_mrq) official.
> >
> > Signed-off-by: Maxim Levitsky <maximlevitsky@xxxxxxxxx>
> > ---
>
> Unfortunately, the description does not match the patch.
> While the main optimization (merging req and card arguments for good) is
> fully reasonable given the posterior knowledge of MSPro evolution, this
> patch introduces some functional changes as well, which can not be
> considered to be a pure cleanup.
Agreed, some stuff slipped to that patch, will split.



> Some WARN_ONs also appear to be misplaced:
>
> > if (msb->block_req) {
> > - mspro_block_complete_req(card, (*mrq)->error);
> > + mspro_block_complete_req(card, mrq->error);
> > error = mspro_block_issue_req(card, false);
> >
> > - if (!msb->block_req) {
> > + if (error) {
> > + WARN_ON(msb->block_req);
Nope that on purpose.
If mspro_block_issue_req returns error, the msb->block_req must be NULL.


Best regards,
Maxim Levitsky

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/