From: Greg KH <gregkh@linuxfoundation.org>
To: Shivani Bhardwaj <shivanib134@gmail.com>
Cc: outreachy-kernel <outreachy-kernel@googlegroups.com>
Subject: Re: [Outreachy kernel] [PATCH] Staging: rts5208: sd: Remove redundant code
Date: Tue, 13 Oct 2015 16:39:02 -0700 [thread overview]
Message-ID: <20151013233902.GA9458@kroah.com> (raw)
In-Reply-To: <CAKHNQQHbg8ge_m3jjpcLU+x3EQrpzqCQviqM=E_avMYnRNJDUQ@mail.gmail.com>
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.
> >>
> >> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
> >> ---
> >> drivers/staging/rts5208/sd.c | 11 ++++-------
> >> 1 file changed, 4 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
> >> index d6c4982..4269be9 100644
> >> --- a/drivers/staging/rts5208/sd.c
> >> +++ b/drivers/staging/rts5208/sd.c
> >> @@ -2707,17 +2707,14 @@ RTY_SD_RST:
> >> return STATUS_FAIL;
> >> }
> >>
> >> + 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?
> >
> > thanks,
> >
> > greg k-h
>
> Logic remains fine, I think. support_1v8 statement was common to if
> and else so it is taken out. Also, it can be noted that programmer
> wants to set sd_card value only if hi_cap_flow is not null and (rsp[1]
> & 0x40) is true. For rest of the cases, programmer wants to clear the
> sd_card.
> I think I'm sure about the changes made.
But now you always call CLR_SD_HCXC() where before there was one code
path that did not make that call. Are you sure it is safe to call
CLR_SD_HCXC() before SET_SD_HCXC()?
thanks,
greg k-h
next prev parent reply other threads:[~2015-10-13 23:39 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 [this message]
2015-10-13 23:45 ` Shivani Bhardwaj
2015-10-13 23:50 ` Shivani Bhardwaj
2015-10-14 9:24 ` Arnd Bergmann
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=20151013233902.GA9458@kroah.com \
--to=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.