lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 15 Apr 2019 14:03:57 +0800 From: Liang Yang <liang.yang@...ogic.com> To: Martin Blumenstingl <martin.blumenstingl@...glemail.com>, <linux-amlogic@...ts.infradead.org>, <linux-mtd@...ts.infradead.org>, <richard@....at>, <miquel.raynal@...tlin.com> CC: <linux-arm-kernel@...ts.infradead.org>, <marek.vasut@...il.com>, <linux-kernel@...r.kernel.org>, <computersforpeace@...il.com>, <dwmw2@...radead.org>, <bbrezillon@...nel.org>, <jianxin.pan@...ogic.com> Subject: Re: [PATCH 3/4] mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup On 2019/4/12 6:00, Martin Blumenstingl wrote: > This simplifies the code because it gets rid of the casts to an > u8-pointer when passing "info_buf" from struct meson_nfc_nand_chip. > Also it gets rid of the cast of the u8 databuf pointer to a void > pointer. > The logic inside meson_nfc_dma_buffer_setup() doesn't care about the > pointer types themselves because it only passes them to dma_map_single > which accepts a void pointer. > > No functional changes. > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@...glemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index 9a6023638101..57cc4bd3f665 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -470,15 +470,15 @@ static int meson_nfc_ecc_correct(struct nand_chip *nand, u32 *bitflips, > return ret; > } > > -static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, u8 *databuf, > - int datalen, u8 *infobuf, int infolen, > +static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, void *databuf, > + int datalen, void *infobuf, int infolen, > enum dma_data_direction dir) Tested-by:Liang Yang <liang.yang@...ogic.com> Acked-by: Liang Yang <liang.yang@...ogic.com> > { > struct meson_nfc *nfc = nand_get_controller_data(nand); > u32 cmd; > int ret = 0; > > - nfc->daddr = dma_map_single(nfc->dev, (void *)databuf, datalen, dir); > + nfc->daddr = dma_map_single(nfc->dev, databuf, datalen, dir); > ret = dma_mapping_error(nfc->dev, nfc->daddr); > if (ret) { > dev_err(nfc->dev, "DMA mapping error\n"); > @@ -645,7 +645,7 @@ static int meson_nfc_write_page_sub(struct nand_chip *nand, > return ret; > > ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, > - data_len, (u8 *)meson_chip->info_buf, > + data_len, meson_chip->info_buf, > info_len, DMA_TO_DEVICE); Tested-by:Liang Yang <liang.yang@...ogic.com> Acked-by: Liang Yang <liang.yang@...ogic.com> > if (ret) > return ret; > @@ -729,7 +729,7 @@ static int meson_nfc_read_page_sub(struct nand_chip *nand, > return ret; > > ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, > - data_len, (u8 *)meson_chip->info_buf, > + data_len, meson_chip->info_buf, Tested-by:Liang Yang <liang.yang@...ogic.com> Acked-by: Liang Yang <liang.yang@...ogic.com> > info_len, DMA_FROM_DEVICE); > if (ret) > return ret; >
Powered by blists - more mailing lists