All of lore.kernel.org
 help / color / mirror / Atom feed
From: micky <micky_ching@realsil.com.cn>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-mmc@vger.kernel.org
Subject: Re: mmc: rtsx: add support for pre_req and post_req
Date: Mon, 3 Mar 2014 09:13:44 +0800	[thread overview]
Message-ID: <5313D748.1080404@realsil.com.cn> (raw)
In-Reply-To: <20140228202432.GA29547@elgon.mountain>

On 03/01/2014 04:35 AM, Dan Carpenter wrote:
> Hello Micky Ching,
>
> The patch c42deffd5b53: "mmc: rtsx: add support for pre_req and
> post_req" from Feb 17, 2014, leads to the following static checker
> warning:
>
> 	drivers/mmc/host/rtsx_pci_sdmmc.c:525 sd_pre_dma_transfer()
> 	warn: we tested 'next' before and it was 'false'
>
> drivers/mmc/host/rtsx_pci_sdmmc.c
>     520                          "error: invalid cookie data[%d] host[%d]\n",
>     521                          data->host_cookie, host->next_data.cookie);
>     522                  data->host_cookie = 0;
>     523          }
>     524
>     525          if (next || (!next && data->host_cookie != host->next_data.cookie))
>                               ^^^^^
> We are testing "next" twice.  Often that means the intention was to test
> a different variable?
Yes, it can be write as follow.
if (next || data->host_cookie != host->next_data.cookie)
>
>     526                  sg_count = rtsx_pci_dma_map_sg(pcr,
>     527                                  data->sg, data->sg_len, read);
>     528          else
>     529                  sg_count = host->next_data.sg_count;
>
> regards,
> dan carpenter
>


  reply	other threads:[~2014-03-03  1:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28 20:35 mmc: rtsx: add support for pre_req and post_req Dan Carpenter
2014-03-03  1:13 ` micky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-02-24 22:03 Dan Carpenter
2014-02-24 22:03 Dan Carpenter
2014-02-25  1:52 ` micky
2014-02-25  7:59   ` 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=5313D748.1080404@realsil.com.cn \
    --to=micky_ching@realsil.com.cn \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-mmc@vger.kernel.org \
    /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.