From: Arnd Bergmann <arnd@arndb.de>
To: outreachy-kernel@googlegroups.com
Cc: Shivani Bhardwaj <shivanib134@gmail.com>,
Greg KH <gregkh@linuxfoundation.org>
Subject: Re: [Outreachy kernel] [PATCH] Staging: rts5208: sd: Remove redundant code
Date: Wed, 14 Oct 2015 11:24:33 +0200 [thread overview]
Message-ID: <6287823.a8MvGuEn0R@wuerfel> (raw)
In-Reply-To: <CAKHNQQEB4pmKB+UujyZa_te1BZfubs4JVR2Z+4qRe1e814iNLg@mail.gmail.com>
On Wednesday 14 October 2015 05:15:12 Shivani Bhardwaj wrote:
> On Wed, Oct 14, 2015 at 5:09 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Wed, Oct 14, 2015 at 04:54:45AM +0530, Shivani Bhardwaj wrote:
> >> On Wed, Oct 14, 2015 at 4:44 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> >> > On Wed, Oct 14, 2015 at 04:30:10AM +0530, Shivani Bhardwaj wrote:
> >> >> Change the order of statements and remove extra code.
> >> >> + CLR_SD_HCXC(sd_card);
> >> >> +
> >> >> if (hi_cap_flow) {
> >> >> if (rsp[1] & 0x40)
> >> >> SET_SD_HCXC(sd_card);
> >> >> - else
> >> >> - CLR_SD_HCXC(sd_card);
> >> >> -
> >> >> - support_1v8 = false;
> >> >> - } else {
> >> >> - CLR_SD_HCXC(sd_card);
> >> >> - support_1v8 = false;
> >> >> }
> >> >> +
> >> >> + support_1v8 = false;
> >> >> dev_dbg(rtsx_dev(chip), "support_1v8 = %d\n", support_1v8);
> >> >>
> >> >> if (support_1v8) {
> >> >
> >> > Are you sure you didn't change the logic of what is happening here?
> >> >
> >> > Why are you making this change? What prompted it?
...
> I don't think it should be a problem because that is what we
> ultimately want in our code - to clear the memory card subject to
> constraints that one of the two if conditions is wrong. Now, if both
> the if statements, that is,
> if (hi_cap_flow) and if (rsp[1] & 0x40)
>
> turn out to be true, they set the cleared sd_card again.
>
> That is what we wanted. If both the if statements are true - set the
> sd_card else clear it up.
I guess this would be easier to verify if it were not obscured by the
SET_SD_HCXC/CLR_SD_HCXC macros ;-)
Your change looks like a correct transformation, and it would be logical
to remove the support_1v8 variable next, as it can never be true.
However, I wonder whether that is just a bug in the driver, as UHS-1
cards are required to support 1.8v operation, and there is clearly
code to handle it here. Maybe one of them should actually say
"support_1v8 = true".
Arnd
next prev parent reply other threads:[~2015-10-14 9:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-13 23:00 [PATCH] Staging: rts5208: sd: Remove redundant code Shivani Bhardwaj
2015-10-13 23:14 ` [Outreachy kernel] " Greg KH
2015-10-13 23:24 ` Shivani Bhardwaj
2015-10-13 23:39 ` Greg KH
2015-10-13 23:45 ` Shivani Bhardwaj
2015-10-13 23:50 ` Shivani Bhardwaj
2015-10-14 9:24 ` Arnd Bergmann [this message]
2015-10-14 10:16 ` Shivani Bhardwaj
2015-10-14 13:44 ` Arnd Bergmann
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=6287823.a8MvGuEn0R@wuerfel \
--to=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=outreachy-kernel@googlegroups.com \
--cc=shivanib134@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.