You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/09/06 17:46:57 UTC

[incubator-nuttx] branch mmc3 created (now 2919878)

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a change to branch mmc3
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


      at 2919878  drivers/mmcsd: Pass the right buffer size to SDIO_DMAPREFLIGHT

This branch includes the following new commits:

     new 2919878  drivers/mmcsd: Pass the right buffer size to SDIO_DMAPREFLIGHT

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[incubator-nuttx] 01/01: drivers/mmcsd: Pass the right buffer size to SDIO_DMAPREFLIGHT

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch mmc3
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 291987824643a86cb61c23a719904273925de019
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Sep 7 01:44:58 2021 +0800

    drivers/mmcsd: Pass the right buffer size to SDIO_DMAPREFLIGHT
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 drivers/mmcsd/mmcsd_sdio.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mmcsd/mmcsd_sdio.c b/drivers/mmcsd/mmcsd_sdio.c
index a9b8a68..31dcea1 100644
--- a/drivers/mmcsd/mmcsd_sdio.c
+++ b/drivers/mmcsd/mmcsd_sdio.c
@@ -1502,7 +1502,7 @@ static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv,
                                   FAR uint8_t *buffer, off_t startblock,
                                   size_t nblocks)
 {
-  size_t nbytes;
+  size_t nbytes = nblocks << priv->blockshift;
   off_t  offset;
   int ret;
 
@@ -1524,7 +1524,7 @@ static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv,
 
   if ((priv->caps & SDIO_CAPS_DMASUPPORTED) != 0)
     {
-      ret = SDIO_DMAPREFLIGHT(priv->dev, buffer, priv->blocksize);
+      ret = SDIO_DMAPREFLIGHT(priv->dev, buffer, nbytes);
 
       if (ret != OK)
         {
@@ -1552,7 +1552,6 @@ static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv,
    * offset
    */
 
-  nbytes = nblocks << priv->blockshift;
   if (IS_BLOCK(priv->type))
     {
       offset = startblock;
@@ -1878,8 +1877,8 @@ static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv,
                                    FAR const uint8_t *buffer,
                                    off_t startblock, size_t nblocks)
 {
+  size_t nbytes = nblocks << priv->blockshift;
   off_t  offset;
-  size_t nbytes;
   int ret;
   int evret = OK;
 
@@ -1903,7 +1902,7 @@ static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv,
 
   if ((priv->caps & SDIO_CAPS_DMASUPPORTED) != 0)
     {
-      ret = SDIO_DMAPREFLIGHT(priv->dev, buffer, priv->blocksize);
+      ret = SDIO_DMAPREFLIGHT(priv->dev, buffer, nbytes);
 
       if (ret != OK)
         {
@@ -1931,7 +1930,6 @@ static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv,
    * offset
    */
 
-  nbytes = nblocks << priv->blockshift;
   if (IS_BLOCK(priv->type))
     {
       offset = startblock;