Skip to content

Commit 8a8c8ba

Browse files
masahir0yBoris Brezillon
authored and
Boris Brezillon
committed
mtd: nand: denali: rename misleading dma_buf to tmp_buf
The "dma_buf" is not used for a DMA bounce buffer, but for arranging the transferred data for the syndrome page layout. In fact, it is used in the PIO mode as well, so "dma_buf" is a misleading name. Rename it to "tmp_buf". Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Boris Brezillon <[email protected]>
1 parent c9e916a commit 8a8c8ba

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

drivers/mtd/nand/denali.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -710,12 +710,12 @@ static int denali_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
710710
int ecc_steps = chip->ecc.steps;
711711
int ecc_size = chip->ecc.size;
712712
int ecc_bytes = chip->ecc.bytes;
713-
void *dma_buf = denali->buf;
713+
void *tmp_buf = denali->buf;
714714
int oob_skip = denali->oob_skip_bytes;
715715
size_t size = writesize + oobsize;
716716
int ret, i, pos, len;
717717

718-
ret = denali_data_xfer(denali, dma_buf, size, page, 1, 0);
718+
ret = denali_data_xfer(denali, tmp_buf, size, page, 1, 0);
719719
if (ret)
720720
return ret;
721721

@@ -730,11 +730,11 @@ static int denali_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
730730
else if (pos + len > writesize)
731731
len = writesize - pos;
732732

733-
memcpy(buf, dma_buf + pos, len);
733+
memcpy(buf, tmp_buf + pos, len);
734734
buf += len;
735735
if (len < ecc_size) {
736736
len = ecc_size - len;
737-
memcpy(buf, dma_buf + writesize + oob_skip,
737+
memcpy(buf, tmp_buf + writesize + oob_skip,
738738
len);
739739
buf += len;
740740
}
@@ -745,7 +745,7 @@ static int denali_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
745745
uint8_t *oob = chip->oob_poi;
746746

747747
/* BBM at the beginning of the OOB area */
748-
memcpy(oob, dma_buf + writesize, oob_skip);
748+
memcpy(oob, tmp_buf + writesize, oob_skip);
749749
oob += oob_skip;
750750

751751
/* OOB ECC */
@@ -758,19 +758,19 @@ static int denali_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
758758
else if (pos + len > writesize)
759759
len = writesize - pos;
760760

761-
memcpy(oob, dma_buf + pos, len);
761+
memcpy(oob, tmp_buf + pos, len);
762762
oob += len;
763763
if (len < ecc_bytes) {
764764
len = ecc_bytes - len;
765-
memcpy(oob, dma_buf + writesize + oob_skip,
765+
memcpy(oob, tmp_buf + writesize + oob_skip,
766766
len);
767767
oob += len;
768768
}
769769
}
770770

771771
/* OOB free */
772772
len = oobsize - (oob - chip->oob_poi);
773-
memcpy(oob, dma_buf + size - len, len);
773+
memcpy(oob, tmp_buf + size - len, len);
774774
}
775775

776776
return 0;
@@ -841,7 +841,7 @@ static int denali_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
841841
int ecc_steps = chip->ecc.steps;
842842
int ecc_size = chip->ecc.size;
843843
int ecc_bytes = chip->ecc.bytes;
844-
void *dma_buf = denali->buf;
844+
void *tmp_buf = denali->buf;
845845
int oob_skip = denali->oob_skip_bytes;
846846
size_t size = writesize + oobsize;
847847
int i, pos, len;
@@ -851,7 +851,7 @@ static int denali_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
851851
* This simplifies the logic.
852852
*/
853853
if (!buf || !oob_required)
854-
memset(dma_buf, 0xff, size);
854+
memset(tmp_buf, 0xff, size);
855855

856856
/* Arrange the buffer for syndrome payload/ecc layout */
857857
if (buf) {
@@ -864,11 +864,11 @@ static int denali_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
864864
else if (pos + len > writesize)
865865
len = writesize - pos;
866866

867-
memcpy(dma_buf + pos, buf, len);
867+
memcpy(tmp_buf + pos, buf, len);
868868
buf += len;
869869
if (len < ecc_size) {
870870
len = ecc_size - len;
871-
memcpy(dma_buf + writesize + oob_skip, buf,
871+
memcpy(tmp_buf + writesize + oob_skip, buf,
872872
len);
873873
buf += len;
874874
}
@@ -879,7 +879,7 @@ static int denali_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
879879
const uint8_t *oob = chip->oob_poi;
880880

881881
/* BBM at the beginning of the OOB area */
882-
memcpy(dma_buf + writesize, oob, oob_skip);
882+
memcpy(tmp_buf + writesize, oob, oob_skip);
883883
oob += oob_skip;
884884

885885
/* OOB ECC */
@@ -892,22 +892,22 @@ static int denali_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
892892
else if (pos + len > writesize)
893893
len = writesize - pos;
894894

895-
memcpy(dma_buf + pos, oob, len);
895+
memcpy(tmp_buf + pos, oob, len);
896896
oob += len;
897897
if (len < ecc_bytes) {
898898
len = ecc_bytes - len;
899-
memcpy(dma_buf + writesize + oob_skip, oob,
899+
memcpy(tmp_buf + writesize + oob_skip, oob,
900900
len);
901901
oob += len;
902902
}
903903
}
904904

905905
/* OOB free */
906906
len = oobsize - (oob - chip->oob_poi);
907-
memcpy(dma_buf + size - len, oob, len);
907+
memcpy(tmp_buf + size - len, oob, len);
908908
}
909909

910-
return denali_data_xfer(denali, dma_buf, size, page, 1, 1);
910+
return denali_data_xfer(denali, tmp_buf, size, page, 1, 1);
911911
}
912912

913913
static int denali_write_page(struct mtd_info *mtd, struct nand_chip *chip,

0 commit comments

Comments
 (0)