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


--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to