Re: [PATCH 08/56] cris: Remove void casts

From: Bert Wesarg
Date: Wed Apr 08 2009 - 08:34:30 EST


On Wed, Apr 8, 2009 at 13:21, Jack Stone <jwjstone@xxxxxxxxxxx> wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <jwjstone@xxxxxxxxxxx>
> ---
> Âarch/cris/arch-v32/drivers/cryptocop.c | Â Â8 ++++----
> Â1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
> index 67c61ea..5d20327 100644
> --- a/arch/cris/arch-v32/drivers/cryptocop.c
> +++ b/arch/cris/arch-v32/drivers/cryptocop.c
> @@ -2455,7 +2455,7 @@ static int map_pages_to_iovec(struct iovec *iov, int iovlen, int *iovix, struct
> Â Â Â Â Â Â Â Â Â Â Â ÂDEBUG_API(printk("map_page_to_iovec: *pageix=%d >= nopages=%d\n", *pageix, nopages));
> Â Â Â Â Â Â Â Â Â Â Â Âreturn 0;
> Â Â Â Â Â Â Â Â}
> - Â Â Â Â Â Â Â iov[*iovix].iov_base = (unsigned char*)page_address(pages[*pageix]) + *pageoffset;
> + Â Â Â Â Â Â Â iov[*iovix].iov_base = page_address(pages[*pageix]) + *pageoffset;
Pointer arithmetic or intended cast (to avoid warnings for void
pointer arithmetic).

> Â Â Â Â Â Â Â Âtmplen = PAGE_SIZE - *pageoffset;
> Â Â Â Â Â Â Â Âif (tmplen < map_length){
> Â Â Â Â Â Â Â Â Â Â Â Â(*pageoffset) = 0;
> @@ -2780,16 +2780,16 @@ static int cryptocop_ioctl_process(struct inode *inode, struct file *filp, unsig
> Â Â Â Â Â Â Â Âsize_t tmplen = cop->tfrm_op.inlen;
>
> Â Â Â Â Â Â Â Âcop->tfrm_op.indata[0].iov_len = PAGE_SIZE - ((unsigned long int)(oper.indata + prev_ix) & ~PAGE_MASK);
> - Â Â Â Â Â Â Â cop->tfrm_op.indata[0].iov_base = (unsigned char*)page_address(inpages[0]) + ((unsigned long int)(oper.indata + prev_ix) & ~PAGE_MASK);
> + Â Â Â Â Â Â Â cop->tfrm_op.indata[0].iov_base = page_address(inpages[0]) + ((unsigned long int)(oper.indata + prev_ix) & ~PAGE_MASK);
Dito.

> Â Â Â Â Â Â Â Âtmplen -= cop->tfrm_op.indata[0].iov_len;
> Â Â Â Â Â Â Â Âfor (i = 1; i<noinpages; i++){
> Â Â Â Â Â Â Â Â Â Â Â Âcop->tfrm_op.indata[i].iov_len = tmplen < PAGE_SIZE ? tmplen : PAGE_SIZE;
> - Â Â Â Â Â Â Â Â Â Â Â cop->tfrm_op.indata[i].iov_base = (unsigned char*)page_address(inpages[i]);
> + Â Â Â Â Â Â Â Â Â Â Â cop->tfrm_op.indata[i].iov_base = page_address(inpages[i]);
> Â Â Â Â Â Â Â Â Â Â Â Âtmplen -= PAGE_SIZE;
> Â Â Â Â Â Â Â Â}
> Â Â Â Â} else {
> Â Â Â Â Â Â Â Âcop->tfrm_op.indata[0].iov_len = oper.inlen - prev_ix;
> - Â Â Â Â Â Â Â cop->tfrm_op.indata[0].iov_base = (unsigned char*)page_address(inpages[0]) + ((unsigned long int)(oper.indata + prev_ix) & ~PAGE_MASK);
> + Â Â Â Â Â Â Â cop->tfrm_op.indata[0].iov_base = page_address(inpages[0]) + ((unsigned long int)(oper.indata + prev_ix) & ~PAGE_MASK);
Dito.

> Â Â Â Â}
>
> Â Â Â Âiovlen = nooutpages + 6;
> --
Bert
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/