[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-mmc
Subject: Re: [PATCH v9 3/3] mmc: sdhci-msm: Add platform_execute_tunning implementation
From: Georgi Djakov <gdjakov () mm-sol ! com>
Date: 2014-02-28 22:29:53
Message-ID: 53110DE1.6070204 () mm-sol ! com
[Download RAW message or body]
On 28.02.14, 22:51, Josh Cartwright wrote:
[..]
> > + sg_init_one(&sg, data_buf, sizeof(data_buf));
> > + memset(data_buf, 0, sizeof(data_buf));
> > + mmc_wait_for_req(mmc, &mrq);
> > +
> > + if (!cmd.error && !data.error &&
> > + !memcmp(data_buf, tuning_block_pattern, sizeof(data_buf))) {
>
> This memcmp is broken, sizeof(data_buf) is likely not what you want,
> maybe you want 'size'? Same thing for sg_init_one()/memset() above.
>
> From sparse:
>
> drivers/mmc/host/sdhci-msm.c: In function ‘sdhci_msm_execute_tuning’:
> drivers/mmc/host/sdhci-msm.c:461:53: warning: argument to ‘sizeof’ in \
> ‘memcmp’ call is the same expression as the first source; did you mean \
> to provide an explicit length? [-Wsizeof-pointer-memaccess]
> !memcmp(data_buf, tuning_block_pattern, sizeof(data_buf))) {
>
Nice catch, Josh! Thanks for reviewing!
BR,
Georgi
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic