mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: wei_wang@realsil.com.cn
Cc: gregkh@suse.de, devel@linuxdriverproject.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging:rts_pstor:Fix SDIO issue
Date: Sun, 9 Oct 2011 09:06:44 +0300	[thread overview]
Message-ID: <20111009060644.GN18470@longonot.mountain> (raw)
In-Reply-To: <1318125810-30505-1-git-send-email-wei_wang@realsil.com.cn>

Adding the check for if (sd_check_err_code(chip, SD_NO_CARD)) is
good, but introducing the new "reset_pass" variable is wrong.

I don't think you are updating the new variable consistently on
all paths.  For example, if it's a 0x5209 chip and the code is like
this:
                   retval = sd_change_bank_voltage(chip, SD_IO_3V3);
                   if (retval != STATUS_SUCCESS) {
                   	TRACE_RET(chip, STATUS_FAIL);
                   }

In the old system that was considered a successful reset, but under
your new system we don't update "reset_pass" here so we pass this
test and then we immediately return STATUS_FAIL because reset_pass
isn't set.  If that's what you intended then just write it like that.

		retval = sd_change_bank_voltage(chip, SD_IO_3V3);
		TRACE_RET(chip, STATUS_FAIL);

So could you write it again but just set retval = STATUS_FAIL; for
the new failure pathes.  Or better yet, just return STATUS_FAIL
directly.  So this code would be:

> +				if (retval == STATUS_SUCCESS)
> +					reset_pass = 1;

				if (retval != STATUS_SUCCESS)
					TRACE_RET(chip, retval);
regards,
dan carpenter



  reply	other threads:[~2011-10-09  6:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-09  2:03 wei_wang
2011-10-09  6:06 ` Dan Carpenter [this message]
2011-10-09  6:48   ` wwang
2011-10-09 13:57     ` Dan Carpenter
2011-10-10  1:51       ` wwang
2011-10-10  1:51 wei_wang
2011-10-10  6:12 ` Dan Carpenter
2011-10-10  6:47 wei_wang
2011-10-10  7:55 ` Dan Carpenter

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=20111009060644.GN18470@longonot.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wei_wang@realsil.com.cn \
    /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

all inboxes | Powered by JetHome®