2009-04-08 11:22:57

by Jack Stone

[permalink] [raw]
Subject: [PATCH 0/56] Remove void casts

This patch series removes void pointer casts from the kernel.

These casts are not needed in C.

These patches are against Linus' tree


2009-04-08 11:23:30

by Jack Stone

[permalink] [raw]
Subject: [PATCH 01/56] adfs: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/adfs/super.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/adfs/super.c b/fs/adfs/super.c
index dd9becc..9ae1ed1 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -242,7 +242,7 @@ static struct kmem_cache *adfs_inode_cachep;
static struct inode *adfs_alloc_inode(struct super_block *sb)
{
struct adfs_inode_info *ei;
- ei = (struct adfs_inode_info *)kmem_cache_alloc(adfs_inode_cachep, GFP_KERNEL);
+ ei = kmem_cache_alloc(adfs_inode_cachep, GFP_KERNEL);
if (!ei)
return NULL;
return &ei->vfs_inode;
--
1.5.4.3

2009-04-08 11:24:17

by Jack Stone

[permalink] [raw]
Subject: [PATCH 03/56] atm: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/atm/lanai.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index cf97c34..2c9d0da 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -1459,7 +1459,7 @@ static int __devinit vcc_table_allocate(struct lanai_dev *lanai)
return (lanai->vccs == NULL) ? -ENOMEM : 0;
#else
int bytes = (lanai->num_vci) * sizeof(struct lanai_vcc *);
- lanai->vccs = (struct lanai_vcc **) vmalloc(bytes);
+ lanai->vccs = vmalloc(bytes);
if (unlikely(lanai->vccs == NULL))
return -ENOMEM;
memset(lanai->vccs, 0, bytes);
--
1.5.4.3

2009-04-08 11:23:49

by Jack Stone

[permalink] [raw]
Subject: [PATCH 02/56] alpha: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
arch/alpha/boot/bootpz.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/alpha/boot/bootpz.c b/arch/alpha/boot/bootpz.c
index 1036b51..6e7af60 100644
--- a/arch/alpha/boot/bootpz.c
+++ b/arch/alpha/boot/bootpz.c
@@ -129,7 +129,7 @@ pal_init(void)
pcb_va->flags = 1;
pcb_va->res1 = 0;
pcb_va->res2 = 0;
- pcb_pa = (struct pcb_struct *)find_pa((unsigned long)pcb_va);
+ pcb_pa = find_pa((unsigned long)pcb_va);

/*
* a0 = 2 (OSF)
--
1.5.4.3

2009-04-08 11:24:38

by Jack Stone

[permalink] [raw]
Subject: [PATCH 04/56] befs: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/befs/linuxvfs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 76afd0d..cfd9698 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -277,7 +277,7 @@ static struct inode *
befs_alloc_inode(struct super_block *sb)
{
struct befs_inode_info *bi;
- bi = (struct befs_inode_info *)kmem_cache_alloc(befs_inode_cachep,
+ bi = kmem_cache_alloc(befs_inode_cachep,
GFP_KERNEL);
if (!bi)
return NULL;
--
1.5.4.3

2009-04-08 11:24:59

by Jack Stone

[permalink] [raw]
Subject: [PATCH 07/56] coda: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/coda/inode.c | 2 +-
fs/coda/upcall.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/coda/inode.c b/fs/coda/inode.c
index 830f51a..a0407b3 100644
--- a/fs/coda/inode.c
+++ b/fs/coda/inode.c
@@ -43,7 +43,7 @@ static struct kmem_cache * coda_inode_cachep;
static struct inode *coda_alloc_inode(struct super_block *sb)
{
struct coda_inode_info *ei;
- ei = (struct coda_inode_info *)kmem_cache_alloc(coda_inode_cachep, GFP_KERNEL);
+ ei = kmem_cache_alloc(coda_inode_cachep, GFP_KERNEL);
if (!ei)
return NULL;
memset(&ei->c_fid, 0, sizeof(struct CodaFid));
diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c
index c274d94..0f2e171 100644
--- a/fs/coda/upcall.c
+++ b/fs/coda/upcall.c
@@ -59,7 +59,7 @@ static void *alloc_upcall(int opcode, int size)

#define UPARG(op)\
do {\
- inp = (union inputArgs *)alloc_upcall(op, insize); \
+ inp = alloc_upcall(op, insize); \
if (IS_ERR(inp)) { return PTR_ERR(inp); }\
outp = (union outputArgs *)(inp); \
outsize = insize; \
--
1.5.4.3

2009-04-08 11:25:29

by Jack Stone

[permalink] [raw]
Subject: [PATCH 06/56] cifs: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/cifs/transport.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index 0ad3e2d..fb3bd00 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -111,7 +111,7 @@ AllocOplockQEntry(struct inode *pinode, __u16 fid, struct cifsTconInfo *tcon)
cERROR(1, ("Null parms passed to AllocOplockQEntry"));
return NULL;
}
- temp = (struct oplock_q_entry *) kmem_cache_alloc(cifs_oplock_cachep,
+ temp = kmem_cache_alloc(cifs_oplock_cachep,
GFP_KERNEL);
if (temp == NULL)
return temp;
--
1.5.4.3

2009-04-08 11:25:49

by Jack Stone

[permalink] [raw]
Subject: [PATCH 05/56] block: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/block/amiflop.c | 2 +-
drivers/block/cciss.c | 11 ++++-------
drivers/block/cciss_scsi.c | 3 +--
drivers/block/cpqarray.c | 2 +-
drivers/block/sx8.c | 2 +-
drivers/block/viodasd.c | 3 +--
6 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
index 8df436f..702667b 100644
--- a/drivers/block/amiflop.c
+++ b/drivers/block/amiflop.c
@@ -1727,7 +1727,7 @@ static int __init amiga_floppy_init(void)
}

ret = -ENOMEM;
- if ((raw_buf = (char *)amiga_chip_alloc (RAW_BUF_SIZE, "Floppy")) ==
+ if ((raw_buf = amiga_chip_alloc (RAW_BUF_SIZE, "Floppy")) ==
NULL) {
printk("fd: cannot get chip mem buffer\n");
goto out_memregion;
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 0ef6f08..0c4747a 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -452,7 +452,7 @@ static CommandList_struct *cmd_alloc(ctlr_info_t *h, int get_from_pool)
dma_addr_t cmd_dma_handle, err_dma_handle;

if (!get_from_pool) {
- c = (CommandList_struct *) pci_alloc_consistent(h->pdev,
+ c = pci_alloc_consistent(h->pdev,
sizeof(CommandList_struct), &cmd_dma_handle);
if (c == NULL)
return NULL;
@@ -460,8 +460,7 @@ static CommandList_struct *cmd_alloc(ctlr_info_t *h, int get_from_pool)

c->cmdindex = -1;

- c->err_info = (ErrorInfo_struct *)
- pci_alloc_consistent(h->pdev, sizeof(ErrorInfo_struct),
+ c->err_info = pci_alloc_consistent(h->pdev, sizeof(ErrorInfo_struct),
&err_dma_handle);

if (c->err_info == NULL) {
@@ -3773,12 +3772,10 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
hba[i]->cmd_pool_bits =
kmalloc(DIV_ROUND_UP(hba[i]->nr_cmds, BITS_PER_LONG)
* sizeof(unsigned long), GFP_KERNEL);
- hba[i]->cmd_pool = (CommandList_struct *)
- pci_alloc_consistent(hba[i]->pdev,
+ hba[i]->cmd_pool = pci_alloc_consistent(hba[i]->pdev,
hba[i]->nr_cmds * sizeof(CommandList_struct),
&(hba[i]->cmd_pool_dhandle));
- hba[i]->errinfo_pool = (ErrorInfo_struct *)
- pci_alloc_consistent(hba[i]->pdev,
+ hba[i]->errinfo_pool = pci_alloc_consistent(hba[i]->pdev,
hba[i]->nr_cmds * sizeof(ErrorInfo_struct),
&(hba[i]->errinfo_pool_dhandle));
if ((hba[i]->cmd_pool_bits == NULL)
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
index a3fd87b..1e997b2 100644
--- a/drivers/block/cciss_scsi.c
+++ b/drivers/block/cciss_scsi.c
@@ -212,8 +212,7 @@ scsi_cmd_stack_setup(int ctlr, struct cciss_scsi_adapter_data_t *sa)
// pci_alloc_consistent guarantees 32-bit DMA address will
// be used

- stk->pool = (struct cciss_scsi_cmd_stack_elem_t *)
- pci_alloc_consistent(hba[ctlr]->pdev, size, &stk->cmd_pool_handle);
+ stk->pool = pci_alloc_consistent(hba[ctlr]->pdev, size, &stk->cmd_pool_handle);

if (stk->pool == NULL) {
printk("stk->pool is null\n");
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index ca268ca..207fbb6 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -1353,7 +1353,7 @@ static cmdlist_t * cmd_alloc(ctlr_info_t *h, int get_from_pool)
dma_addr_t cmd_dhandle;

if (!get_from_pool) {
- c = (cmdlist_t*)pci_alloc_consistent(h->pci_dev,
+ c = pci_alloc_consistent(h->pci_dev,
sizeof(cmdlist_t), &cmd_dhandle);
if(c==NULL)
return NULL;
diff --git a/drivers/block/sx8.c b/drivers/block/sx8.c
index ff0448e..48c8bb4 100644
--- a/drivers/block/sx8.c
+++ b/drivers/block/sx8.c
@@ -890,7 +890,7 @@ queue_one_request:
*/

VPRINTK("build msg\n");
- msg = (struct carm_msg_rw *) carm_ref_msg(host, crq->tag);
+ msg = carm_ref_msg(host, crq->tag);

if (writing) {
msg->type = CARM_MSG_WRITE;
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c
index ecccf65..6e1210e 100644
--- a/drivers/block/viodasd.c
+++ b/drivers/block/viodasd.c
@@ -285,8 +285,7 @@ static int send_request(struct request *req)
((u64)sg_dma_address(&sg[0])) << 32,
sg_dma_len(&sg[0]));
else {
- bevent = (struct vioblocklpevent *)
- vio_get_event_buffer(viomajorsubtype_blockio);
+ bevent = vio_get_event_buffer(viomajorsubtype_blockio);
if (bevent == NULL) {
printk(VIOD_KERN_WARNING
"error allocating disk event buffer\n");
--
1.5.4.3

2009-04-08 11:26:15

by Jack Stone

[permalink] [raw]
Subject: [PATCH 08/56] cris: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
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;
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);
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);
}

iovlen = nooutpages + 6;
--
1.5.4.3

2009-04-08 11:26:40

by Jack Stone

[permalink] [raw]
Subject: [PATCH 10/56] ext2: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/ext2/super.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index f983225..be6825a 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -143,7 +143,7 @@ static struct kmem_cache * ext2_inode_cachep;
static struct inode *ext2_alloc_inode(struct super_block *sb)
{
struct ext2_inode_info *ei;
- ei = (struct ext2_inode_info *)kmem_cache_alloc(ext2_inode_cachep, GFP_KERNEL);
+ ei = kmem_cache_alloc(ext2_inode_cachep, GFP_KERNEL);
if (!ei)
return NULL;
#ifdef CONFIG_EXT2_FS_POSIX_ACL
--
1.5.4.3

2009-04-08 11:26:59

by Jack Stone

[permalink] [raw]
Subject: [PATCH 11/56] freevxfs: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/freevxfs/vxfs_inode.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/freevxfs/vxfs_inode.c b/fs/freevxfs/vxfs_inode.c
index 03a6ea5..9811217 100644
--- a/fs/freevxfs/vxfs_inode.c
+++ b/fs/freevxfs/vxfs_inode.c
@@ -138,7 +138,7 @@ __vxfs_iget(ino_t ino, struct inode *ilistp)
if (!IS_ERR(pp)) {
struct vxfs_inode_info *vip;
struct vxfs_dinode *dip;
- caddr_t kaddr = (char *)page_address(pp);
+ caddr_t kaddr = page_address(pp);

if (!(vip = kmem_cache_alloc(vxfs_inode_cachep, GFP_KERNEL)))
goto fail;
--
1.5.4.3

2009-04-08 11:27:32

by Jack Stone

[permalink] [raw]
Subject: [PATCH 12/56] hpfs: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/hpfs/super.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c
index fecf402..ab539dc 100644
--- a/fs/hpfs/super.c
+++ b/fs/hpfs/super.c
@@ -164,7 +164,7 @@ static struct kmem_cache * hpfs_inode_cachep;
static struct inode *hpfs_alloc_inode(struct super_block *sb)
{
struct hpfs_inode_info *ei;
- ei = (struct hpfs_inode_info *)kmem_cache_alloc(hpfs_inode_cachep, GFP_NOFS);
+ ei = kmem_cache_alloc(hpfs_inode_cachep, GFP_NOFS);
if (!ei)
return NULL;
ei->vfs_inode.i_version = 1;
--
1.5.4.3

2009-04-08 11:28:19

by Jack Stone

[permalink] [raw]
Subject: [PATCH 13/56] i2c: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/i2c/i2c-core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index b6f3a0d..1578645 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1510,7 +1510,7 @@ struct i2c_adapter* i2c_get_adapter(int id)
struct i2c_adapter *adapter;

mutex_lock(&core_lock);
- adapter = (struct i2c_adapter *)idr_find(&i2c_adapter_idr, id);
+ adapter = idr_find(&i2c_adapter_idr, id);
if (adapter && !try_module_get(adapter->owner))
adapter = NULL;

--
1.5.4.3

2009-04-08 11:29:01

by Jack Stone

[permalink] [raw]
Subject: [PATCH 14/56] ia64: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
arch/ia64/kernel/mca_drv.c | 2 +-
arch/ia64/mm/contig.c | 2 +-
arch/ia64/mm/discontig.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c
index f94aaa8..820f34e 100644
--- a/arch/ia64/kernel/mca_drv.c
+++ b/arch/ia64/kernel/mca_drv.c
@@ -496,7 +496,7 @@ recover_from_read_error(slidx_table_t *slidx,
u64 target_identifier;
pal_min_state_area_t *pmsa;
struct ia64_psr *psr1, *psr2;
- ia64_fptr_t *mca_hdlr_bh = (ia64_fptr_t*)mca_handler_bhhook;
+ ia64_fptr_t *mca_hdlr_bh = mca_handler_bhhook;

/* Is target address valid? */
target_identifier = get_target_identifier(peidx);
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c
index 0ee085e..e0d27b0 100644
--- a/arch/ia64/mm/contig.c
+++ b/arch/ia64/mm/contig.c
@@ -272,7 +272,7 @@ paging_init (void)
map_size = PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) *
sizeof(struct page));
vmalloc_end -= map_size;
- vmem_map = (struct page *) vmalloc_end;
+ vmem_map = vmalloc_end;
efi_memmap_walk(create_mem_map_page_table, NULL);

/*
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index d85ba98..f3a45cd 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -668,7 +668,7 @@ void __init paging_init(void)
#ifdef CONFIG_VIRTUAL_MEM_MAP
vmalloc_end -= PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) *
sizeof(struct page));
- vmem_map = (struct page *) vmalloc_end;
+ vmem_map = vmalloc_end;
efi_memmap_walk(create_mem_map_page_table, NULL);
printk("Virtual mem_map starts at 0x%p\n", vmem_map);
#endif
--
1.5.4.3

2009-04-08 11:29:33

by Jack Stone

[permalink] [raw]
Subject: [PATCH 15/56] ide: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/ide/pmac.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index 052b9bf..f76e4e6 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1682,7 +1682,7 @@ static int __devinit pmac_ide_init_dma(ide_hwif_t *hwif,
* The +2 is +1 for the stop command and +1 to allow for
* aligning the start address to a multiple of 16 bytes.
*/
- pmif->dma_table_cpu = (struct dbdma_cmd*)pci_alloc_consistent(
+ pmif->dma_table_cpu = pci_alloc_consistent(
dev,
(MAX_DCMDS + 2) * sizeof(struct dbdma_cmd),
&hwif->dmatable_dma);
--
1.5.4.3

2009-04-08 11:29:59

by Jack Stone

[permalink] [raw]
Subject: [PATCH 16/56] idle: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/idle/i7300_idle.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/idle/i7300_idle.c b/drivers/idle/i7300_idle.c
index bf74039..112a4d1 100644
--- a/drivers/idle/i7300_idle.c
+++ b/drivers/idle/i7300_idle.c
@@ -227,7 +227,7 @@ static int __init i7300_idle_ioat_init(void)
writew(IOAT_CHANCTRL_CHANNEL_IN_USE,
ioat_chanbase + IOAT_CHANCTRL_OFFSET);

- ioat_desc = (struct ioat_dma_descriptor *)dma_alloc_coherent(
+ ioat_desc = dma_alloc_coherent(
&dummy_dma_dev, 4096,
(dma_addr_t *)&ioat_desc_phys, GFP_KERNEL);
if (!ioat_desc) {
--
1.5.4.3

2009-04-08 11:30:37

by Jack Stone

[permalink] [raw]
Subject: [PATCH 09/56] efs: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/efs/super.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/efs/super.c b/fs/efs/super.c
index f049428..6869342 100644
--- a/fs/efs/super.c
+++ b/fs/efs/super.c
@@ -59,7 +59,7 @@ static struct kmem_cache * efs_inode_cachep;
static struct inode *efs_alloc_inode(struct super_block *sb)
{
struct efs_inode_info *ei;
- ei = (struct efs_inode_info *)kmem_cache_alloc(efs_inode_cachep, GFP_KERNEL);
+ ei = kmem_cache_alloc(efs_inode_cachep, GFP_KERNEL);
if (!ei)
return NULL;
return &ei->vfs_inode;
--
1.5.4.3

2009-04-08 11:31:06

by Jack Stone

[permalink] [raw]
Subject: [PATCH 17/56] infiniband: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/infiniband/hw/amso1100/c2_cq.c | 4 ++--
drivers/infiniband/hw/ehca/ehca_irq.c | 9 ++++-----
2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/infiniband/hw/amso1100/c2_cq.c b/drivers/infiniband/hw/amso1100/c2_cq.c
index bb17cce..f5c45b1 100644
--- a/drivers/infiniband/hw/amso1100/c2_cq.c
+++ b/drivers/infiniband/hw/amso1100/c2_cq.c
@@ -133,7 +133,7 @@ static inline int c2_poll_one(struct c2_dev *c2dev,
struct c2_qp *qp;
int is_recv = 0;

- ce = (struct c2wr_ce *) c2_mq_consume(&cq->mq);
+ ce = c2_mq_consume(&cq->mq);
if (!ce) {
return -EAGAIN;
}
@@ -146,7 +146,7 @@ static inline int c2_poll_one(struct c2_dev *c2dev,
while ((qp =
(struct c2_qp *) (unsigned long) ce->qp_user_context) == NULL) {
c2_mq_free(&cq->mq);
- ce = (struct c2wr_ce *) c2_mq_consume(&cq->mq);
+ ce = c2_mq_consume(&cq->mq);
if (!ce)
return -EAGAIN;
}
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
index 99bcbd7..4b89b79 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -479,13 +479,13 @@ void ehca_tasklet_neq(unsigned long data)
struct ehca_eqe *eqe;
u64 ret;

- eqe = (struct ehca_eqe *)ehca_poll_eq(shca, &shca->neq);
+ eqe = ehca_poll_eq(shca, &shca->neq);

while (eqe) {
if (!EHCA_BMASK_GET(NEQE_COMPLETION_EVENT, eqe->entry))
parse_ec(shca, eqe->entry);

- eqe = (struct ehca_eqe *)ehca_poll_eq(shca, &shca->neq);
+ eqe = ehca_poll_eq(shca, &shca->neq);
}

ret = hipz_h_reset_event(shca->ipz_hca_handle,
@@ -572,8 +572,7 @@ void ehca_process_eq(struct ehca_shca *shca, int is_irq)
eqe_cnt = 0;
do {
u32 token;
- eqe_cache[eqe_cnt].eqe =
- (struct ehca_eqe *)ehca_poll_eq(shca, eq);
+ eqe_cache[eqe_cnt].eqe = ehca_poll_eq(shca, eq);
if (!eqe_cache[eqe_cnt].eqe)
break;
eqe_value = eqe_cache[eqe_cnt].eqe->entry;
@@ -637,7 +636,7 @@ void ehca_process_eq(struct ehca_shca *shca, int is_irq)
goto unlock_irq_spinlock;
do {
struct ehca_eqe *eqe;
- eqe = (struct ehca_eqe *)ehca_poll_eq(shca, &shca->eq);
+ eqe = ehca_poll_eq(shca, &shca->eq);
if (!eqe)
break;
process_eqe(shca, eqe);
--
1.5.4.3

2009-04-08 11:31:36

by Jack Stone

[permalink] [raw]
Subject: [PATCH 18/56] isdn: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/isdn/hardware/eicon/capifunc.c | 2 +-
drivers/isdn/hardware/eicon/diddfunc.c | 2 +-
drivers/isdn/hardware/eicon/divasfunc.c | 2 +-
drivers/isdn/hardware/eicon/divasi.c | 27 ++++++++-------------------
drivers/isdn/hardware/eicon/idifunc.c | 2 +-
drivers/isdn/hardware/eicon/mntfunc.c | 2 +-
drivers/isdn/hardware/eicon/s_4bri.c | 2 +-
drivers/isdn/hardware/eicon/um_idi.c | 7 ++-----
8 files changed, 16 insertions(+), 30 deletions(-)

diff --git a/drivers/isdn/hardware/eicon/capifunc.c b/drivers/isdn/hardware/eicon/capifunc.c
index 4d425c6..7027547 100644
--- a/drivers/isdn/hardware/eicon/capifunc.c
+++ b/drivers/isdn/hardware/eicon/capifunc.c
@@ -1072,7 +1072,7 @@ static int divacapi_connect_didd(void)
req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc =
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
- req.didd_notify.info.callback = (void *)didd_callback;
+ req.didd_notify.info.callback = didd_callback;
req.didd_notify.info.context = NULL;
DAdapter.request((ENTITY *) & req);
if (req.didd_notify.e.Rc != 0xff) {
diff --git a/drivers/isdn/hardware/eicon/diddfunc.c b/drivers/isdn/hardware/eicon/diddfunc.c
index 3029234..d97bfba 100644
--- a/drivers/isdn/hardware/eicon/diddfunc.c
+++ b/drivers/isdn/hardware/eicon/diddfunc.c
@@ -63,7 +63,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc =
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
- req.didd_notify.info.callback = (void *)didd_callback;
+ req.didd_notify.info.callback = didd_callback;
req.didd_notify.info.context = NULL;
_DAdapter.request((ENTITY *) & req);
if (req.didd_notify.e.Rc != 0xff)
diff --git a/drivers/isdn/hardware/eicon/divasfunc.c b/drivers/isdn/hardware/eicon/divasfunc.c
index d36a4c0..2616a22 100644
--- a/drivers/isdn/hardware/eicon/divasfunc.c
+++ b/drivers/isdn/hardware/eicon/divasfunc.c
@@ -170,7 +170,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc =
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
- req.didd_notify.info.callback = (void *)didd_callback;
+ req.didd_notify.info.callback = didd_callback;
req.didd_notify.info.context = NULL;
DAdapter.request((ENTITY *) & req);
if (req.didd_notify.e.Rc != 0xff) {
diff --git a/drivers/isdn/hardware/eicon/divasi.c b/drivers/isdn/hardware/eicon/divasi.c
index 69e71eb..9021581 100644
--- a/drivers/isdn/hardware/eicon/divasi.c
+++ b/drivers/isdn/hardware/eicon/divasi.c
@@ -238,8 +238,7 @@ um_idi_read(struct file *file, char __user *buf, size_t count, loff_t * offset)
}

if (!
- (p_os =
- (diva_um_idi_os_context_t *) diva_um_id_get_os_context(file->
+ (p_os = diva_um_id_get_os_context(file->
private_data)))
{
return (-ENODEV);
@@ -296,7 +295,7 @@ static int um_idi_open_adapter(struct file *file, int adapter_nr)
if (!(file->private_data = e)) {
return (0);
}
- p_os = (diva_um_idi_os_context_t *) diva_um_id_get_os_context(e);
+ p_os = diva_um_id_get_os_context(e);
init_waitqueue_head(&p_os->read_wait);
init_waitqueue_head(&p_os->close_wait);
init_timer(&p_os->diva_timer_id);
@@ -329,8 +328,7 @@ um_idi_write(struct file *file, const char __user *buf, size_t count,
return (-ENODEV);
}

- if (!(p_os =
- (diva_um_idi_os_context_t *) diva_um_id_get_os_context(file->
+ if (!(p_os = diva_um_id_get_os_context(file->
private_data)))
{
return (-ENODEV);
@@ -374,9 +372,7 @@ static unsigned int um_idi_poll(struct file *file, poll_table * wait)
return (POLLERR);
}

- if ((!(p_os =
- (diva_um_idi_os_context_t *)
- diva_um_id_get_os_context(file->private_data)))
+ if ((!(p_os = diva_um_id_get_os_context(file->private_data)))
|| p_os->aborted) {
return (POLLERR);
}
@@ -416,8 +412,7 @@ static int um_idi_release(struct inode *inode, struct file *file)
goto out;
}

- if (!(p_os =
- (diva_um_idi_os_context_t *) diva_um_id_get_os_context(file->private_data))) {
+ if (!(p_os = diva_um_id_get_os_context(file->private_data))) {
ret = -ENODEV;
goto out;
}
@@ -484,9 +479,7 @@ static int remove_entity(void *entity)
return (0);
}

- if (!(p_os =
- (diva_um_idi_os_context_t *)
- diva_um_id_get_os_context(entity))) {
+ if (!(p_os = diva_um_id_get_os_context(entity))) {
DBG_FTL(("Zero entity os context on remove"))
return (0);
}
@@ -557,9 +550,7 @@ void diva_um_idi_start_wdog(void *entity)
diva_um_idi_os_context_t *p_os;

if (entity &&
- ((p_os =
- (diva_um_idi_os_context_t *)
- diva_um_id_get_os_context(entity)))) {
+ ((p_os = diva_um_id_get_os_context(entity)))) {
mod_timer(&p_os->diva_timer_id, jiffies + 10 * HZ);
}
}
@@ -569,9 +560,7 @@ void diva_um_idi_stop_wdog(void *entity)
diva_um_idi_os_context_t *p_os;

if (entity &&
- ((p_os =
- (diva_um_idi_os_context_t *)
- diva_um_id_get_os_context(entity)))) {
+ ((p_os = diva_um_id_get_os_context(entity)))) {
del_timer(&p_os->diva_timer_id);
}
}
diff --git a/drivers/isdn/hardware/eicon/idifunc.c b/drivers/isdn/hardware/eicon/idifunc.c
index db87d51..5399cc1 100644
--- a/drivers/isdn/hardware/eicon/idifunc.c
+++ b/drivers/isdn/hardware/eicon/idifunc.c
@@ -197,7 +197,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc =
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
- req.didd_notify.info.callback = (void *)didd_callback;
+ req.didd_notify.info.callback = didd_callback;
req.didd_notify.info.context = NULL;
DAdapter.request((ENTITY *) & req);
if (req.didd_notify.e.Rc != 0xff) {
diff --git a/drivers/isdn/hardware/eicon/mntfunc.c b/drivers/isdn/hardware/eicon/mntfunc.c
index a564b75..2251662 100644
--- a/drivers/isdn/hardware/eicon/mntfunc.c
+++ b/drivers/isdn/hardware/eicon/mntfunc.c
@@ -88,7 +88,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc =
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
- req.didd_notify.info.callback = (void *)didd_callback;
+ req.didd_notify.info.callback = didd_callback;
req.didd_notify.info.context = NULL;
DAdapter.request((ENTITY *) & req);
if (req.didd_notify.e.Rc != 0xff)
diff --git a/drivers/isdn/hardware/eicon/s_4bri.c b/drivers/isdn/hardware/eicon/s_4bri.c
index 25c5d7f..28e8410 100644
--- a/drivers/isdn/hardware/eicon/s_4bri.c
+++ b/drivers/isdn/hardware/eicon/s_4bri.c
@@ -189,7 +189,7 @@ static byte * qBri_check_FPGAsrc (PISDN_ADAPTER IoAdapter, char *FileName,
char *fpgaFile, *fpgaType, *fpgaDate, *fpgaTime ;
dword fpgaFlen, fpgaTlen, fpgaDlen, cnt, year, i ;

- if (!(File = (byte *)xdiLoadFile (FileName, Length, 0))) {
+ if (!(File = xdiLoadFile (FileName, Length, 0))) {
return (NULL) ;
}
/*
diff --git a/drivers/isdn/hardware/eicon/um_idi.c b/drivers/isdn/hardware/eicon/um_idi.c
index 6563db9..55eb212 100644
--- a/drivers/isdn/hardware/eicon/um_idi.c
+++ b/drivers/isdn/hardware/eicon/um_idi.c
@@ -679,9 +679,7 @@ static int process_idi_ind(divas_um_idi_entity_t * e, byte ind)
int do_wakeup = 0;

if (e->e.complete != 0x02) {
- diva_um_idi_ind_hdr_t *pind =
- (diva_um_idi_ind_hdr_t *)
- diva_data_q_get_segment4write(&e->data);
+ diva_um_idi_ind_hdr_t *pind = diva_data_q_get_segment4write(&e->data);
if (pind) {
e->e.RNum = 1;
e->e.R->P = (byte *) & pind[1];
@@ -734,8 +732,7 @@ static int write_return_code(divas_um_idi_entity_t * e, byte rc)
{
diva_um_idi_ind_hdr_t *prc;

- if (!(prc =
- (diva_um_idi_ind_hdr_t *) diva_data_q_get_segment4write(&e->rc)))
+ if (!(prc = diva_data_q_get_segment4write(&e->rc)))
{
DBG_ERR(("A: A(%d) E(%08x) rc(%02x) lost",
e->adapter->adapter_nr, e, rc));
--
1.5.4.3

2009-04-08 11:32:03

by Jack Stone

[permalink] [raw]
Subject: [PATCH 19/56] kvm: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
virt/kvm/kvm_main.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 605697e..95f915a 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -795,8 +795,7 @@ static struct kvm *kvm_create_vm(void)
kfree(kvm);
return ERR_PTR(-ENOMEM);
}
- kvm->coalesced_mmio_ring =
- (struct kvm_coalesced_mmio_ring *)page_address(page);
+ kvm->coalesced_mmio_ring = page_address(page);
#endif

#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
--
1.5.4.3

2009-04-08 11:32:32

by Jack Stone

[permalink] [raw]
Subject: [PATCH 20/56] inflate: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
lib/inflate.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/inflate.c b/lib/inflate.c
index 1a8e8a9..4b672f9 100644
--- a/lib/inflate.c
+++ b/lib/inflate.c
@@ -249,7 +249,7 @@ static void *malloc(int size)

malloc_ptr = (malloc_ptr + 3) & ~3; /* Align */

- p = (void *)malloc_ptr;
+ p = malloc_ptr;
malloc_ptr += size;

if (free_mem_end_ptr && malloc_ptr >= free_mem_end_ptr)
@@ -481,7 +481,7 @@ DEBG1("3 ");
z = 1 << j; /* table entries for j-bit table */

/* allocate and link in new table */
- if ((q = (struct huft *)malloc((z + 1)*sizeof(struct huft))) ==
+ if ((q = malloc((z + 1)*sizeof(struct huft))) ==
(struct huft *)NULL)
{
if (h)
--
1.5.4.3

2009-04-08 11:33:31

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 04/56] befs: Remove void casts

On Wed, Apr 8, 2009 at 13:21, Jack Stone <[email protected]> wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>  fs/befs/linuxvfs.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
> index 76afd0d..cfd9698 100644
> --- a/fs/befs/linuxvfs.c
> +++ b/fs/befs/linuxvfs.c
> @@ -277,7 +277,7 @@ static struct inode *
>  befs_alloc_inode(struct super_block *sb)
>  {
>         struct befs_inode_info *bi;
> -        bi = (struct befs_inode_info *)kmem_cache_alloc(befs_inode_cachep,
> +        bi = kmem_cache_alloc(befs_inode_cachep,
>                                                        GFP_KERNEL);
^^^^^^^^^^^^
This can now be one line up.

Bert
>         if (!bi)
>                 return NULL;
> --
> 1.5.4.3

2009-04-08 11:33:54

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 06/56] cifs: Remove void casts

On Wed, Apr 8, 2009 at 13:21, Jack Stone <[email protected]> wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>  fs/cifs/transport.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
> index 0ad3e2d..fb3bd00 100644
> --- a/fs/cifs/transport.c
> +++ b/fs/cifs/transport.c
> @@ -111,7 +111,7 @@ AllocOplockQEntry(struct inode *pinode, __u16 fid, struct cifsTconInfo *tcon)
>                cERROR(1, ("Null parms passed to AllocOplockQEntry"));
>                return NULL;
>        }
> -       temp = (struct oplock_q_entry *) kmem_cache_alloc(cifs_oplock_cachep,
> +       temp = kmem_cache_alloc(cifs_oplock_cachep,
>                                                       GFP_KERNEL);
^^^^^^^^^^^^
Again.

Bert
>        if (temp == NULL)
>                return temp;
> --
> 1.5.4.3

2009-04-08 11:34:31

by Jack Stone

[permalink] [raw]
Subject: [PATCH 21/56] md: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/md/bitmap.c | 8 ++++----
drivers/md/dm-table.c | 4 ++--
drivers/md/md.c | 19 +++++++++----------
3 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index f8a9f7a..2a11c90 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -493,7 +493,7 @@ void bitmap_update_sb(struct bitmap *bitmap)
return;
}
spin_unlock_irqrestore(&bitmap->lock, flags);
- sb = (bitmap_super_t *)kmap_atomic(bitmap->sb_page, KM_USER0);
+ sb = kmap_atomic(bitmap->sb_page, KM_USER0);
sb->events = cpu_to_le64(bitmap->mddev->events);
if (bitmap->mddev->events < bitmap->events_cleared) {
/* rocking back to read-only */
@@ -511,7 +511,7 @@ void bitmap_print_sb(struct bitmap *bitmap)

if (!bitmap || !bitmap->sb_page)
return;
- sb = (bitmap_super_t *)kmap_atomic(bitmap->sb_page, KM_USER0);
+ sb = kmap_atomic(bitmap->sb_page, KM_USER0);
printk(KERN_DEBUG "%s: bitmap file superblock:\n", bmname(bitmap));
printk(KERN_DEBUG " magic: %08x\n", le32_to_cpu(sb->magic));
printk(KERN_DEBUG " version: %d\n", le32_to_cpu(sb->version));
@@ -559,7 +559,7 @@ static int bitmap_read_sb(struct bitmap *bitmap)
return err;
}

- sb = (bitmap_super_t *)kmap_atomic(bitmap->sb_page, KM_USER0);
+ sb = kmap_atomic(bitmap->sb_page, KM_USER0);

chunksize = le32_to_cpu(sb->chunksize);
daemon_sleep = le32_to_cpu(sb->daemon_sleep);
@@ -646,7 +646,7 @@ static int bitmap_mask_state(struct bitmap *bitmap, enum bitmap_state bits,
return 0;
}
spin_unlock_irqrestore(&bitmap->lock, flags);
- sb = (bitmap_super_t *)kmap_atomic(bitmap->sb_page, KM_USER0);
+ sb = kmap_atomic(bitmap->sb_page, KM_USER0);
old = le32_to_cpu(sb->state) & bits;
switch (op) {
case MASK_SET: sb->state |= cpu_to_le32(bits);
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index e8361b1..6e57fe2 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -211,7 +211,7 @@ static int alloc_targets(struct dm_table *t, unsigned int num)
* Append an empty entry to catch sectors beyond the end of
* the device.
*/
- n_highs = (sector_t *) dm_vcalloc(num + 1, sizeof(struct dm_target) +
+ n_highs = dm_vcalloc(num + 1, sizeof(struct dm_target) +
sizeof(sector_t));
if (!n_highs)
return -ENOMEM;
@@ -775,7 +775,7 @@ static int setup_indexes(struct dm_table *t)
total += t->counts[i];
}

- indexes = (sector_t *) dm_vcalloc(total, (unsigned long) NODE_SIZE);
+ indexes = dm_vcalloc(total, (unsigned long) NODE_SIZE);
if (!indexes)
return -ENOMEM;

diff --git a/drivers/md/md.c b/drivers/md/md.c
index ed5727c..22cd6b3 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -767,7 +767,7 @@ static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version
ret = -EINVAL;

bdevname(rdev->bdev, b);
- sb = (mdp_super_t*)page_address(rdev->sb_page);
+ sb = page_address(rdev->sb_page);

if (sb->md_magic != MD_SB_MAGIC) {
printk(KERN_ERR "md: invalid raid superblock magic on %s\n",
@@ -817,7 +817,7 @@ static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version
ret = 1;
} else {
__u64 ev1, ev2;
- mdp_super_t *refsb = (mdp_super_t*)page_address(refdev->sb_page);
+ mdp_super_t *refsb = page_address(refdev->sb_page);
if (!uuid_equal(refsb, sb)) {
printk(KERN_WARNING "md: %s has different UUID to %s\n",
b, bdevname(refdev->bdev,b2));
@@ -852,7 +852,7 @@ static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version
static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev)
{
mdp_disk_t *desc;
- mdp_super_t *sb = (mdp_super_t *)page_address(rdev->sb_page);
+ mdp_super_t *sb = page_address(rdev->sb_page);
__u64 ev1 = md_event(sb);

rdev->raid_disk = -1;
@@ -972,7 +972,7 @@ static void super_90_sync(mddev_t *mddev, mdk_rdev_t *rdev)

rdev->sb_size = MD_SB_BYTES;

- sb = (mdp_super_t*)page_address(rdev->sb_page);
+ sb = page_address(rdev->sb_page);

memset(sb, 0, sizeof(*sb));

@@ -1166,7 +1166,7 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
if (ret) return ret;


- sb = (struct mdp_superblock_1*)page_address(rdev->sb_page);
+ sb = page_address(rdev->sb_page);

if (sb->magic != cpu_to_le32(MD_SB_MAGIC) ||
sb->major_version != cpu_to_le32(1) ||
@@ -1219,8 +1219,7 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
ret = 1;
} else {
__u64 ev1, ev2;
- struct mdp_superblock_1 *refsb =
- (struct mdp_superblock_1*)page_address(refdev->sb_page);
+ struct mdp_superblock_1 *refsb = page_address(refdev->sb_page);

if (memcmp(sb->set_uuid, refsb->set_uuid, 16) != 0 ||
sb->level != refsb->level ||
@@ -1258,7 +1257,7 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)

static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev)
{
- struct mdp_superblock_1 *sb = (struct mdp_superblock_1*)page_address(rdev->sb_page);
+ struct mdp_superblock_1 *sb = page_address(rdev->sb_page);
__u64 ev1 = le64_to_cpu(sb->events);

rdev->raid_disk = -1;
@@ -1355,7 +1354,7 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)
int max_dev, i;
/* make rdev->sb match mddev and rdev data. */

- sb = (struct mdp_superblock_1*)page_address(rdev->sb_page);
+ sb = page_address(rdev->sb_page);

sb->feature_map = 0;
sb->pad0 = 0;
@@ -1453,7 +1452,7 @@ super_1_rdev_size_change(mdk_rdev_t *rdev, sector_t num_sectors)
num_sectors = max_sectors;
rdev->sb_start = sb_start;
}
- sb = (struct mdp_superblock_1 *) page_address(rdev->sb_page);
+ sb = page_address(rdev->sb_page);
sb->data_size = cpu_to_le64(num_sectors);
sb->super_offset = rdev->sb_start;
sb->sb_csum = calc_sb_1_csum(sb);
--
1.5.4.3

2009-04-08 11:34:59

by Jack Stone

[permalink] [raw]
Subject: [PATCH 22/56] message/fusion: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/message/fusion/mptbase.c | 6 +++---
drivers/message/fusion/mptctl.c | 4 ++--
drivers/message/fusion/mptfc.c | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index d0d126c..656f15f 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -4666,7 +4666,7 @@ GetLanConfigPages(MPT_ADAPTER *ioc)

if (hdr.PageLength > 0) {
data_sz = hdr.PageLength * 4;
- ppage0_alloc = (LANPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
+ ppage0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
rc = -ENOMEM;
if (ppage0_alloc) {
memset((u8 *)ppage0_alloc, 0, data_sz);
@@ -4712,7 +4712,7 @@ GetLanConfigPages(MPT_ADAPTER *ioc)

data_sz = hdr.PageLength * 4;
rc = -ENOMEM;
- ppage1_alloc = (LANPage1_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page1_dma);
+ ppage1_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page1_dma);
if (ppage1_alloc) {
memset((u8 *)ppage1_alloc, 0, data_sz);
cfg.physAddr = page1_dma;
@@ -4986,7 +4986,7 @@ GetIoUnitPage2(MPT_ADAPTER *ioc)
/* Read the config page */
data_sz = hdr.PageLength * 4;
rc = -ENOMEM;
- ppage_alloc = (IOUnitPage2_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma);
+ ppage_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma);
if (ppage_alloc) {
memset((u8 *)ppage_alloc, 0, data_sz);
cfg.physAddr = page_dma;
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
index c638171..fbcd791 100644
--- a/drivers/message/fusion/mptctl.c
+++ b/drivers/message/fusion/mptctl.c
@@ -2603,7 +2603,7 @@ mptctl_hp_targetinfo(unsigned long arg)
/* Get the data transfer speeds
*/
data_sz = ioc->spi_data.sdp0length * 4;
- pg0_alloc = (SCSIDevicePage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma);
+ pg0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma);
if (pg0_alloc) {
hdr.PageVersion = ioc->spi_data.sdp0version;
hdr.PageLength = data_sz;
@@ -2667,7 +2667,7 @@ mptctl_hp_targetinfo(unsigned long arg)
/* Issue the second config page request */
cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
data_sz = (int) cfg.cfghdr.hdr->PageLength * 4;
- pg3_alloc = (SCSIDevicePage3_t *) pci_alloc_consistent(
+ pg3_alloc = pci_alloc_consistent(
ioc->pcidev, data_sz, &page_dma);
if (pg3_alloc) {
cfg.physAddr = page_dma;
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index c3c24fd..d22acfd 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -766,7 +766,7 @@ mptfc_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)

data_sz = hdr.PageLength * 4;
rc = -ENOMEM;
- ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
+ ppage0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
if (ppage0_alloc) {

try_again:
@@ -907,7 +907,7 @@ start_over:
if (data_sz < sizeof(FCPortPage1_t))
data_sz = sizeof(FCPortPage1_t);

- page1_alloc = (FCPortPage1_t *) pci_alloc_consistent(ioc->pcidev,
+ page1_alloc = pci_alloc_consistent(ioc->pcidev,
data_sz,
&page1_dma);
if (!page1_alloc)
--
1.5.4.3

2009-04-08 11:35:37

by Jack Stone

[permalink] [raw]
Subject: [PATCH 23/56] minix: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/minix/dir.c | 8 ++++----
fs/minix/inode.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/minix/dir.c b/fs/minix/dir.c
index d4946c4..e17634c 100644
--- a/fs/minix/dir.c
+++ b/fs/minix/dir.c
@@ -114,7 +114,7 @@ static int minix_readdir(struct file * filp, void * dirent, filldir_t filldir)

if (IS_ERR(page))
continue;
- kaddr = (char *)page_address(page);
+ kaddr = page_address(page);
p = kaddr+offset;
limit = kaddr + minix_last_byte(inode, n) - chunk_size;
for ( ; p <= limit; p = minix_next_entry(p, sbi)) {
@@ -189,7 +189,7 @@ minix_dirent *minix_find_entry(struct dentry *dentry, struct page **res_page)
if (IS_ERR(page))
continue;

- kaddr = (char*)page_address(page);
+ kaddr = page_address(page);
limit = kaddr + minix_last_byte(dir, n) - sbi->s_dirsize;
for (p = kaddr; p <= limit; p = minix_next_entry(p, sbi)) {
if (sbi->s_version == MINIX_V3) {
@@ -246,7 +246,7 @@ int minix_add_link(struct dentry *dentry, struct inode *inode)
if (IS_ERR(page))
goto out;
lock_page(page);
- kaddr = (char*)page_address(page);
+ kaddr = page_address(page);
dir_end = kaddr + minix_last_byte(dir, n);
limit = kaddr + PAGE_CACHE_SIZE - sbi->s_dirsize;
for (p = kaddr; p <= limit; p = minix_next_entry(p, sbi)) {
@@ -392,7 +392,7 @@ int minix_empty_dir(struct inode * inode)
if (IS_ERR(page))
continue;

- kaddr = (char *)page_address(page);
+ kaddr = page_address(page);
limit = kaddr + minix_last_byte(inode, i) - sbi->s_dirsize;
for (p = kaddr; p <= limit; p = minix_next_entry(p, sbi)) {
if (sbi->s_version == MINIX_V3) {
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index daad3c2..eb74488 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -57,7 +57,7 @@ static struct kmem_cache * minix_inode_cachep;
static struct inode *minix_alloc_inode(struct super_block *sb)
{
struct minix_inode_info *ei;
- ei = (struct minix_inode_info *)kmem_cache_alloc(minix_inode_cachep, GFP_KERNEL);
+ ei = kmem_cache_alloc(minix_inode_cachep, GFP_KERNEL);
if (!ei)
return NULL;
return &ei->vfs_inode;
--
1.5.4.3

2009-04-08 11:36:06

by Jack Stone

[permalink] [raw]
Subject: [PATCH 25/56] mm: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
mm/shmem.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/shmem.c b/mm/shmem.c
index d94d2e9..4febea9 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2357,7 +2357,7 @@ static struct kmem_cache *shmem_inode_cachep;
static struct inode *shmem_alloc_inode(struct super_block *sb)
{
struct shmem_inode_info *p;
- p = (struct shmem_inode_info *)kmem_cache_alloc(shmem_inode_cachep, GFP_KERNEL);
+ p = kmem_cache_alloc(shmem_inode_cachep, GFP_KERNEL);
if (!p)
return NULL;
return &p->vfs_inode;
--
1.5.4.3

2009-04-08 11:36:34

by Jack Stone

[permalink] [raw]
Subject: [PATCH 26/56] ncpfs: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/ncpfs/inode.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index d642f0e..7d33658 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -53,7 +53,7 @@ static struct kmem_cache * ncp_inode_cachep;
static struct inode *ncp_alloc_inode(struct super_block *sb)
{
struct ncp_inode_info *ei;
- ei = (struct ncp_inode_info *)kmem_cache_alloc(ncp_inode_cachep, GFP_KERNEL);
+ ei = kmem_cache_alloc(ncp_inode_cachep, GFP_KERNEL);
if (!ei)
return NULL;
return &ei->vfs_inode;
--
1.5.4.3

2009-04-08 11:37:01

by Jack Stone

[permalink] [raw]
Subject: [PATCH 32/56] sunrpc: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
net/sunrpc/rpc_pipe.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 9ced062..b8e401a 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -154,7 +154,7 @@ static struct inode *
rpc_alloc_inode(struct super_block *sb)
{
struct rpc_inode *rpci;
- rpci = (struct rpc_inode *)kmem_cache_alloc(rpc_inode_cachep, GFP_KERNEL);
+ rpci = kmem_cache_alloc(rpc_inode_cachep, GFP_KERNEL);
if (!rpci)
return NULL;
return &rpci->vfs_inode;
--
1.5.4.3

2009-04-08 11:37:42

by Jack Stone

[permalink] [raw]
Subject: [PATCH 33/56] tipc: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
net/tipc/port.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/tipc/port.c b/net/tipc/port.c
index e70d27e..0804ae2 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -1528,7 +1528,7 @@ int tipc_forward_buf2name(u32 ref,
u32 destport = 0;
int res;

- p_ptr = (struct port *)tipc_ref_deref(ref);
+ p_ptr = tipc_ref_deref(ref);
if (!p_ptr || p_ptr->publ.connected)
return -EINVAL;

@@ -1656,7 +1656,7 @@ int tipc_forward_buf2port(u32 ref,
struct tipc_msg *msg;
int res;

- p_ptr = (struct port *)tipc_ref_deref(ref);
+ p_ptr = tipc_ref_deref(ref);
if (!p_ptr || p_ptr->publ.connected)
return -EINVAL;

--
1.5.4.3

2009-04-08 11:38:13

by Jack Stone

[permalink] [raw]
Subject: [PATCH 37/56] oss: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
sound/oss/msnd.c | 2 +-
sound/oss/pss.c | 6 +++---
sound/oss/sequencer.c | 4 ++--
sound/oss/sscape.c | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/sound/oss/msnd.c b/sound/oss/msnd.c
index e4282d9..21eb6dc 100644
--- a/sound/oss/msnd.c
+++ b/sound/oss/msnd.c
@@ -100,7 +100,7 @@ void msnd_fifo_free(msnd_fifo *f)
int msnd_fifo_alloc(msnd_fifo *f, size_t n)
{
msnd_fifo_free(f);
- f->data = (char *)vmalloc(n);
+ f->data = vmalloc(n);
f->n = n;
f->tail = 0;
f->head = 0;
diff --git a/sound/oss/pss.c b/sound/oss/pss.c
index 83f5ee2..82f4d5a 100644
--- a/sound/oss/pss.c
+++ b/sound/oss/pss.c
@@ -859,7 +859,7 @@ static int pss_coproc_ioctl(void *dev_info, unsigned int cmd, void __user *arg,
return 0;

case SNDCTL_COPR_LOAD:
- buf = (copr_buffer *) vmalloc(sizeof(copr_buffer));
+ buf = vmalloc(sizeof(copr_buffer));
if (buf == NULL)
return -ENOSPC;
if (copy_from_user(buf, arg, sizeof(copr_buffer))) {
@@ -871,7 +871,7 @@ static int pss_coproc_ioctl(void *dev_info, unsigned int cmd, void __user *arg,
return err;

case SNDCTL_COPR_SENDMSG:
- mbuf = (copr_msg *)vmalloc(sizeof(copr_msg));
+ mbuf = vmalloc(sizeof(copr_msg));
if (mbuf == NULL)
return -ENOSPC;
if (copy_from_user(mbuf, arg, sizeof(copr_msg))) {
@@ -895,7 +895,7 @@ static int pss_coproc_ioctl(void *dev_info, unsigned int cmd, void __user *arg,

case SNDCTL_COPR_RCVMSG:
err = 0;
- mbuf = (copr_msg *)vmalloc(sizeof(copr_msg));
+ mbuf = vmalloc(sizeof(copr_msg));
if (mbuf == NULL)
return -ENOSPC;
data = (unsigned short *)mbuf->data;
diff --git a/sound/oss/sequencer.c b/sound/oss/sequencer.c
index c798746..31c01ba 100644
--- a/sound/oss/sequencer.c
+++ b/sound/oss/sequencer.c
@@ -1648,13 +1648,13 @@ void sequencer_init(void)
{
if (sequencer_ok)
return;
- queue = (unsigned char *)vmalloc(SEQ_MAX_QUEUE * EV_SZ);
+ queue = vmalloc(SEQ_MAX_QUEUE * EV_SZ);
if (queue == NULL)
{
printk(KERN_ERR "sequencer: Can't allocate memory for sequencer output queue\n");
return;
}
- iqueue = (unsigned char *)vmalloc(SEQ_MAX_QUEUE * IEV_SZ);
+ iqueue = vmalloc(SEQ_MAX_QUEUE * IEV_SZ);
if (iqueue == NULL)
{
printk(KERN_ERR "sequencer: Can't allocate memory for sequencer input queue\n");
diff --git a/sound/oss/sscape.c b/sound/oss/sscape.c
index 30c36d1..9d6b9b0 100644
--- a/sound/oss/sscape.c
+++ b/sound/oss/sscape.c
@@ -573,7 +573,7 @@ static int sscape_coproc_ioctl(void *dev_info, unsigned int cmd, void __user *ar
return 0;

case SNDCTL_COPR_LOAD:
- buf = (copr_buffer *) vmalloc(sizeof(copr_buffer));
+ buf = vmalloc(sizeof(copr_buffer));
if (buf == NULL)
return -ENOSPC;
if (copy_from_user(buf, arg, sizeof(copr_buffer)))
--
1.5.4.3

2009-04-08 11:38:38

by Jack Stone

[permalink] [raw]
Subject: [PATCH 39/56] powerpc: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
arch/powerpc/sysdev/fsl_soc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index afe8dbc..f63d668 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -186,7 +186,7 @@ static int __init of_add_fixed_phys(void)
struct fixed_phy_status status = {};

for_each_node_by_name(np, "ethernet") {
- fixed_link = (u32 *)of_get_property(np, "fixed-link", NULL);
+ fixed_link = of_get_property(np, "fixed-link", NULL);
if (!fixed_link)
continue;

--
1.5.4.3

2009-04-08 11:39:12

by Jack Stone

[permalink] [raw]
Subject: [PATCH 40/56] proc: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/proc/inode.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index d78ade3..2e18f67 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -74,7 +74,7 @@ static struct inode *proc_alloc_inode(struct super_block *sb)
struct proc_inode *ei;
struct inode *inode;

- ei = (struct proc_inode *)kmem_cache_alloc(proc_inode_cachep, GFP_KERNEL);
+ ei = kmem_cache_alloc(proc_inode_cachep, GFP_KERNEL);
if (!ei)
return NULL;
ei->pid = NULL;
--
1.5.4.3

2009-04-08 11:40:30

by Jack Stone

[permalink] [raw]
Subject: [PATCH 47/56] sh: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
arch/sh/mm/ioremap_64.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/sh/mm/ioremap_64.c b/arch/sh/mm/ioremap_64.c
index 31e1bb5..52dd1cf 100644
--- a/arch/sh/mm/ioremap_64.c
+++ b/arch/sh/mm/ioremap_64.c
@@ -277,19 +277,19 @@ static void shmedia_mapioaddr(unsigned long pa, unsigned long va)

pgdp = pgd_offset_k(va);
if (pgd_none(*pgdp) || !pgd_present(*pgdp)) {
- pudp = (pud_t *)sh64_get_page();
+ pudp = sh64_get_page();
set_pgd(pgdp, __pgd((unsigned long)pudp | _KERNPG_TABLE));
}

pudp = pud_offset(pgdp, va);
if (pud_none(*pudp) || !pud_present(*pudp)) {
- pmdp = (pmd_t *)sh64_get_page();
+ pmdp = sh64_get_page();
set_pud(pudp, __pud((unsigned long)pmdp | _KERNPG_TABLE));
}

pmdp = pmd_offset(pudp, va);
if (pmd_none(*pmdp) || !pmd_present(*pmdp) ) {
- ptep = (pte_t *)sh64_get_page();
+ ptep = sh64_get_page();
set_pmd(pmdp, __pmd((unsigned long)ptep + _PAGE_TABLE));
}

--
1.5.4.3

2009-04-08 11:39:49

by Jack Stone

[permalink] [raw]
Subject: [PATCH 42/56] drivers/s390: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/s390/net/qeth_core_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index c827d69..454e181 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -1037,7 +1037,7 @@ static int qeth_is_1920_device(struct qeth_card *card)
QETH_DBF_TEXT(SETUP, 2, "chk_1920");

ccwdev = card->data.ccwdev;
- chp_dsc = (struct channelPath_dsc *)ccw_device_get_chp_desc(ccwdev, 0);
+ chp_dsc = ccw_device_get_chp_desc(ccwdev, 0);
if (chp_dsc != NULL) {
/* CHPP field bit 6 == 1 -> single queue */
single_queue = ((chp_dsc->chpp & 0x02) == 0x02);
--
1.5.4.3

2009-04-08 11:40:56

by Jack Stone

[permalink] [raw]
Subject: [PATCH 48/56] smbfs: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/smbfs/inode.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/smbfs/inode.c b/fs/smbfs/inode.c
index fc27fbf..8892e62 100644
--- a/fs/smbfs/inode.c
+++ b/fs/smbfs/inode.c
@@ -56,7 +56,7 @@ static struct kmem_cache *smb_inode_cachep;
static struct inode *smb_alloc_inode(struct super_block *sb)
{
struct smb_inode_info *ei;
- ei = (struct smb_inode_info *)kmem_cache_alloc(smb_inode_cachep, GFP_KERNEL);
+ ei = kmem_cache_alloc(smb_inode_cachep, GFP_KERNEL);
if (!ei)
return NULL;
return &ei->vfs_inode;
--
1.5.4.3

2009-04-08 11:42:01

by Jack Stone

[permalink] [raw]
Subject: [PATCH 45/56] scsi: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/scsi/aic7xxx/aic79xx_core.c | 4 ++--
drivers/scsi/aic7xxx/aic7xxx_core.c | 7 +++----
drivers/scsi/aic7xxx/aicasm/aicasm.c | 10 +++++-----
drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c | 4 ++--
drivers/scsi/aic7xxx_old.c | 3 +--
drivers/scsi/ibmvscsi/ibmvscsi.c | 3 +--
drivers/scsi/ibmvscsi/ibmvstgt.c | 2 +-
drivers/scsi/lpfc/lpfc_hbadisc.c | 3 +--
drivers/scsi/lpfc/lpfc_init.c | 4 ++--
drivers/scsi/lpfc/lpfc_nportdisc.c | 4 ++--
drivers/scsi/lpfc/lpfc_sli.c | 8 ++++----
drivers/scsi/osst.c | 6 +++---
drivers/scsi/scsi_debug.c | 2 +-
13 files changed, 28 insertions(+), 32 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
index 63b521d..01f6d6f 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -6932,12 +6932,12 @@ ahd_alloc_scbs(struct ahd_softc *ahd)
int error;
#endif

- next_scb = (struct scb *)malloc(sizeof(*next_scb),
+ next_scb = malloc(sizeof(*next_scb),
M_DEVBUF, M_NOWAIT);
if (next_scb == NULL)
break;

- pdata = (struct scb_platform_data *)malloc(sizeof(*pdata),
+ pdata = malloc(sizeof(*pdata),
M_DEVBUF, M_NOWAIT);
if (pdata == NULL) {
free(next_scb, M_DEVBUF);
diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
index e6f2bb7..a46800d 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -2152,7 +2152,7 @@ ahc_alloc_tstate(struct ahc_softc *ahc, u_int scsi_id, char channel)
&& ahc->enabled_targets[scsi_id] != master_tstate)
panic("%s: ahc_alloc_tstate - Target already allocated",
ahc_name(ahc));
- tstate = (struct ahc_tmode_tstate*)malloc(sizeof(*tstate),
+ tstate = malloc(sizeof(*tstate),
M_DEVBUF, M_NOWAIT);
if (tstate == NULL)
return (NULL);
@@ -4783,8 +4783,7 @@ ahc_init_scbdata(struct ahc_softc *ahc)
SLIST_INIT(&scb_data->sg_maps);

/* Allocate SCB resources */
- scb_data->scbarray =
- (struct scb *)malloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC,
+ scb_data->scbarray = malloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC,
M_DEVBUF, M_NOWAIT);
if (scb_data->scbarray == NULL)
return (ENOMEM);
@@ -5014,7 +5013,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc)
#ifndef __linux__
int error;
#endif
- pdata = (struct scb_platform_data *)malloc(sizeof(*pdata),
+ pdata = malloc(sizeof(*pdata),
M_DEVBUF, M_NOWAIT);
if (pdata == NULL)
break;
diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm.c b/drivers/scsi/aic7xxx/aicasm/aicasm.c
index e4a7787..38e1690 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm.c
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm.c
@@ -497,7 +497,7 @@ emit_patch(scope_t *scope, int patch)
/* No-Op patch */
return;

- new_patch = (patch_t *)malloc(sizeof(*new_patch));
+ new_patch = malloc(sizeof(*new_patch));

if (new_patch == NULL)
stop("Could not malloc patch structure", EX_OSERR);
@@ -550,7 +550,7 @@ output_listing(char *ifilename)

func_values = NULL;
if (func_count != 0) {
- func_values = (int *)malloc(func_count * sizeof(int));
+ func_values = malloc(func_count * sizeof(int));

if (func_values == NULL)
stop("Could not malloc", EX_OSERR);
@@ -734,7 +734,7 @@ seq_alloc()
{
struct instruction *new_instr;

- new_instr = (struct instruction *)malloc(sizeof(struct instruction));
+ new_instr = malloc(sizeof(struct instruction));
if (new_instr == NULL)
stop("Unable to malloc instruction object", EX_SOFTWARE);
memset(new_instr, 0, sizeof(*new_instr));
@@ -748,7 +748,7 @@ cs_alloc()
{
critical_section_t *new_cs;

- new_cs= (critical_section_t *)malloc(sizeof(critical_section_t));
+ new_cs= malloc(sizeof(critical_section_t));
if (new_cs == NULL)
stop("Unable to malloc critical_section object", EX_SOFTWARE);
memset(new_cs, 0, sizeof(*new_cs));
@@ -762,7 +762,7 @@ scope_alloc()
{
scope_t *new_scope;

- new_scope = (scope_t *)malloc(sizeof(scope_t));
+ new_scope = malloc(sizeof(scope_t));
if (new_scope == NULL)
stop("Unable to malloc scope object", EX_SOFTWARE);
memset(new_scope, 0, sizeof(*new_scope));
diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c b/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
index 078ed60..c7c5812 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
@@ -67,7 +67,7 @@ symbol_create(char *name)
{
symbol_t *new_symbol;

- new_symbol = (symbol_t *)malloc(sizeof(symbol_t));
+ new_symbol = malloc(sizeof(symbol_t));
if (new_symbol == NULL) {
perror("Unable to create new symbol");
exit(EX_SOFTWARE);
@@ -227,7 +227,7 @@ symlist_add(symlist_t *symlist, symbol_t *symbol, int how)
{
symbol_node_t *newnode;

- newnode = (symbol_node_t *)malloc(sizeof(symbol_node_t));
+ newnode = malloc(sizeof(symbol_node_t));
if (newnode == NULL) {
stop("symlist_add: Unable to malloc symbol_node", EX_SOFTWARE);
/* NOTREACHED */
diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c
index 93984c9..96c2f92 100644
--- a/drivers/scsi/aic7xxx_old.c
+++ b/drivers/scsi/aic7xxx_old.c
@@ -2569,8 +2569,7 @@ aic7xxx_allocate_scb(struct aic7xxx_host *p)
if (scb_ap == NULL)
return(0);
scb_dma = (struct aic7xxx_scb_dma *)&scb_ap[scb_count];
- hsgp = (struct hw_scatterlist *)
- pci_alloc_consistent(p->pdev, scb_size * scb_count,
+ hsgp = pci_alloc_consistent(p->pdev, scb_size * scb_count,
&scb_dma->dma_address);
if (hsgp == NULL)
{
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index c9aa761..7a90d4c 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -423,8 +423,7 @@ static int map_sg_data(struct scsi_cmnd *cmd,

/* get indirect table */
if (!evt_struct->ext_list) {
- evt_struct->ext_list = (struct srp_direct_buf *)
- dma_alloc_coherent(dev,
+ evt_struct->ext_list = dma_alloc_coherent(dev,
SG_ALL * sizeof(struct srp_direct_buf),
&evt_struct->ext_list_token, 0);
if (!evt_struct->ext_list) {
diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c
index e2dd6a4..8d52a03 100644
--- a/drivers/scsi/ibmvscsi/ibmvstgt.c
+++ b/drivers/scsi/ibmvscsi/ibmvstgt.c
@@ -852,7 +852,7 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id)
if (err)
goto put_host;

- dma = (unsigned int *) vio_get_attribute(dev, "ibm,my-dma-window",
+ dma = vio_get_attribute(dev, "ibm,my-dma-window",
&dma_size);
if (!dma || dma_size != 40) {
eprintk("Couldn't get window property %d\n", dma_size);
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index 311ed6d..dabe99d 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -2441,8 +2441,7 @@ lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did)
if ((vport->fc_flag & FC_RSCN_MODE) != 0 &&
lpfc_rscn_payload_check(vport, did) == 0)
return NULL;
- ndlp = (struct lpfc_nodelist *)
- mempool_alloc(vport->phba->nlp_mem_pool, GFP_KERNEL);
+ ndlp = mempool_alloc(vport->phba->nlp_mem_pool, GFP_KERNEL);
if (!ndlp)
return NULL;
lpfc_nlp_init(vport, ndlp, did);
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 06874e6..808a66b 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -992,7 +992,7 @@ lpfc_handle_latt(struct lpfc_hba *phba)
struct lpfc_dmabuf *mp;
int rc = 0;

- pmb = (LPFC_MBOXQ_t *)mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
+ pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
if (!pmb) {
rc = 1;
goto lpfc_handle_latt_err_exit;
@@ -2322,7 +2322,7 @@ lpfc_enable_msix(struct lpfc_hba *phba)
/*
* Configure HBA MSI-X attention conditions to messages
*/
- pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
+ pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);

if (!pmb) {
rc = -ENOMEM;
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c
index 8f548ad..0ab2616 100644
--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
@@ -1082,7 +1082,7 @@ lpfc_cmpl_adisc_adisc_issue(struct lpfc_vport *vport,
cmdiocb = (struct lpfc_iocbq *) arg;
rspiocb = cmdiocb->context_un.rsp_iocb;

- ap = (ADISC *)lpfc_check_elscmpl_iocb(phba, cmdiocb, rspiocb);
+ ap = lpfc_check_elscmpl_iocb(phba, cmdiocb, rspiocb);
irsp = &rspiocb->iocb;

if ((irsp->ulpStatus) ||
@@ -1420,7 +1420,7 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,

cmdiocb = (struct lpfc_iocbq *) arg;
rspiocb = cmdiocb->context_un.rsp_iocb;
- npr = (PRLI *)lpfc_check_elscmpl_iocb(phba, cmdiocb, rspiocb);
+ npr = lpfc_check_elscmpl_iocb(phba, cmdiocb, rspiocb);

irsp = &rspiocb->iocb;
if (irsp->ulpStatus) {
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index a36a120..966fcc5 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -313,7 +313,7 @@ lpfc_sli_ring_map(struct lpfc_hba *phba)
MAILBOX_t *pmbox;
int i, rc, ret = 0;

- pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
+ pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
if (!pmb)
return -ENOMEM;
pmbox = &pmb->mb;
@@ -2591,7 +2591,7 @@ lpfc_sli_brdkill(struct lpfc_hba *phba)
"0329 Kill HBA Data: x%x x%x\n",
phba->pport->port_state, psli->sli_flag);

- pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
+ pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
if (!pmb)
return 1;

@@ -2939,7 +2939,7 @@ lpfc_sli_hbq_setup(struct lpfc_hba *phba)
/* Get a Mailbox buffer to setup mailbox
* commands for HBA initialization
*/
- pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
+ pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);

if (!pmb)
return -ENOMEM;
@@ -3006,7 +3006,7 @@ lpfc_sli_config_port(struct lpfc_hba *phba, int sli_mode)
LPFC_MBOXQ_t *pmb;
uint32_t resetcount = 0, rc = 0, done = 0;

- pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
+ pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
if (!pmb) {
phba->link_state = LPFC_HBA_ERROR;
return -ENOMEM;
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index acb8358..bd6c3a3 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -1482,7 +1482,7 @@ static int osst_read_back_buffer_and_rewrite(struct osst_tape * STp, struct osst
int dbg = debugging;
#endif

- if ((buffer = (unsigned char *)vmalloc((nframes + 1) * OS_DATA_SIZE)) == NULL)
+ if ((buffer = vmalloc((nframes + 1) * OS_DATA_SIZE)) == NULL)
return (-EIO);

printk(KERN_INFO "%s:I: Reading back %d frames from drive buffer%s\n",
@@ -2294,7 +2294,7 @@ static int osst_write_header(struct osst_tape * STp, struct osst_request ** aSRp
if (STp->raw) return 0;

if (STp->header_cache == NULL) {
- if ((STp->header_cache = (os_header_t *)vmalloc(sizeof(os_header_t))) == NULL) {
+ if ((STp->header_cache = vmalloc(sizeof(os_header_t))) == NULL) {
printk(KERN_ERR "%s:E: Failed to allocate header cache\n", name);
return (-ENOMEM);
}
@@ -2482,7 +2482,7 @@ static int __osst_analyze_headers(struct osst_tape * STp, struct osst_request **
name, ppos, update_frame_cntr);
#endif
if (STp->header_cache == NULL) {
- if ((STp->header_cache = (os_header_t *)vmalloc(sizeof(os_header_t))) == NULL) {
+ if ((STp->header_cache = vmalloc(sizeof(os_header_t))) == NULL) {
printk(KERN_ERR "%s:E: Failed to allocate header cache\n", name);
return 0;
}
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 213123b..379fa35 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -1947,7 +1947,7 @@ static int resp_xdwriteread(struct scsi_cmnd *scp, unsigned long long lba,

offset = 0;
for_each_sg(sdb->table.sgl, sg, sdb->table.nents, i) {
- kaddr = (unsigned char *)kmap_atomic(sg_page(sg), KM_USER0);
+ kaddr = kmap_atomic(sg_page(sg), KM_USER0);
if (!kaddr)
goto out;

--
1.5.4.3

2009-04-08 11:41:33

by Jack Stone

[permalink] [raw]
Subject: [PATCH 46/56] serial: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/serial/bfin_5xx.c | 2 +-
drivers/serial/cpm_uart/cpm_uart_cpm1.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index 18ba812..f1d39cf 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -591,7 +591,7 @@ static int bfin_serial_startup(struct uart_port *port)
set_dma_callback(uart->rx_dma_channel, bfin_serial_dma_rx_int, uart);
set_dma_callback(uart->tx_dma_channel, bfin_serial_dma_tx_int, uart);

- uart->rx_dma_buf.buf = (unsigned char *)dma_alloc_coherent(NULL, PAGE_SIZE, &dma_handle, GFP_DMA);
+ uart->rx_dma_buf.buf = dma_alloc_coherent(NULL, PAGE_SIZE, &dma_handle, GFP_DMA);
uart->rx_dma_buf.head = 0;
uart->rx_dma_buf.tail = 0;
uart->rx_dma_nrows = 0;
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
index 1b94c56..ad3a876 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -97,7 +97,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
if (is_con) {
/* was hostalloc but changed cause it blows away the */
/* large tlb mapping when pinning the kernel area */
- mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8));
+ mem_addr = cpm_dpram_addr(cpm_dpalloc(memsz, 8));
dma_addr = (u32)cpm_dpram_phys(mem_addr);
} else
mem_addr = dma_alloc_coherent(pinfo->port.dev, memsz, &dma_addr,
--
1.5.4.3

2009-04-08 11:42:40

by Jack Stone

[permalink] [raw]
Subject: [PATCH 49/56] sparc: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
arch/sparc/kernel/iommu.c | 2 +-
arch/sparc/kernel/signal32.c | 6 ++----
arch/sparc/kernel/signal_32.c | 6 ++----
arch/sparc/kernel/signal_64.c | 3 +--
4 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c
index d8900e1..792c0e8 100644
--- a/arch/sparc/kernel/iommu.c
+++ b/arch/sparc/kernel/iommu.c
@@ -220,7 +220,7 @@ int iommu_table_init(struct iommu *iommu, int tsbsize,
printk(KERN_ERR "IOMMU: Error, gfp(tsb) failed.\n");
goto out_free_dummy_page;
}
- iommu->page_table = (iopte_t *)page_address(page);
+ iommu->page_table = page_address(page);

for (i = 0; i < num_tsb_entries; i++)
iopte_make_dummy(iommu, &iommu->page_table[i]);
diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c
index ba5b09a..432a0ad 100644
--- a/arch/sparc/kernel/signal32.c
+++ b/arch/sparc/kernel/signal32.c
@@ -468,8 +468,7 @@ static void setup_frame32(struct k_sigaction *ka, struct pt_regs *regs,
if (!(current_thread_info()->fpsaved[0] & FPRS_FEF))
sigframe_size -= sizeof(__siginfo_fpu_t);

- sf = (struct signal_frame32 __user *)
- get_sigframe(&ka->sa, regs, sigframe_size);
+ sf = get_sigframe(&ka->sa, regs, sigframe_size);

if (invalid_frame_pointer(sf, sigframe_size))
goto sigill;
@@ -603,8 +602,7 @@ static void setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs,
if (!(current_thread_info()->fpsaved[0] & FPRS_FEF))
sigframe_size -= sizeof(__siginfo_fpu_t);

- sf = (struct rt_signal_frame32 __user *)
- get_sigframe(&ka->sa, regs, sigframe_size);
+ sf = get_sigframe(&ka->sa, regs, sigframe_size);

if (invalid_frame_pointer(sf, sigframe_size))
goto sigill;
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c
index 181d069..45ef48e 100644
--- a/arch/sparc/kernel/signal_32.c
+++ b/arch/sparc/kernel/signal_32.c
@@ -326,8 +326,7 @@ static void setup_frame(struct k_sigaction *ka, struct pt_regs *regs,
if (!used_math())
sigframe_size -= sizeof(__siginfo_fpu_t);

- sf = (struct signal_frame __user *)
- get_sigframe(&ka->sa, regs, sigframe_size);
+ sf = get_sigframe(&ka->sa, regs, sigframe_size);

if (invalid_frame_pointer(sf, sigframe_size))
goto sigill_and_return;
@@ -402,8 +401,7 @@ static void setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
sigframe_size = RT_ALIGNEDSZ;
if (!used_math())
sigframe_size -= sizeof(__siginfo_fpu_t);
- sf = (struct rt_signal_frame __user *)
- get_sigframe(&ka->sa, regs, sigframe_size);
+ sf = get_sigframe(&ka->sa, regs, sigframe_size);
if (invalid_frame_pointer(sf, sigframe_size))
goto sigill;
if (current_thread_info()->w_saved != 0)
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c
index ec82d76..638bfe6 100644
--- a/arch/sparc/kernel/signal_64.c
+++ b/arch/sparc/kernel/signal_64.c
@@ -422,8 +422,7 @@ setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
if (!(current_thread_info()->fpsaved[0] & FPRS_FEF))
sigframe_size -= sizeof(__siginfo_fpu_t);

- sf = (struct rt_signal_frame __user *)
- get_sigframe(ka, regs, sigframe_size);
+ sf = get_sigframe(ka, regs, sigframe_size);

if (invalid_frame_pointer (sf, sigframe_size))
goto sigill;
--
1.5.4.3

2009-04-08 11:43:45

by Jack Stone

[permalink] [raw]
Subject: [PATCH 44/56] scripts: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
scripts/pnmtologo.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/pnmtologo.c b/scripts/pnmtologo.c
index 6aa2a24..1c34675 100644
--- a/scripts/pnmtologo.c
+++ b/scripts/pnmtologo.c
@@ -154,7 +154,7 @@ static void read_image(void)
logo_height = get_number(fp);

/* allocate image data */
- logo_data = (struct color **)malloc(logo_height*sizeof(struct color *));
+ logo_data = malloc(logo_height*sizeof(struct color *));
if (!logo_data)
die("%s\n", strerror(errno));
for (i = 0; i < logo_height; i++) {
--
1.5.4.3

2009-04-08 11:43:20

by Jack Stone

[permalink] [raw]
Subject: [PATCH 51/56] sysv: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/sysv/dir.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c
index 56f6552..8a9f5a7 100644
--- a/fs/sysv/dir.c
+++ b/fs/sysv/dir.c
@@ -87,7 +87,7 @@ static int sysv_readdir(struct file * filp, void * dirent, filldir_t filldir)

if (IS_ERR(page))
continue;
- kaddr = (char *)page_address(page);
+ kaddr = page_address(page);
de = (struct sysv_dir_entry *)(kaddr+offset);
limit = kaddr + PAGE_CACHE_SIZE - SYSV_DIRSIZE;
for ( ;(char*)de <= limit; de++) {
@@ -157,7 +157,7 @@ struct sysv_dir_entry *sysv_find_entry(struct dentry *dentry, struct page **res_
char *kaddr;
page = dir_get_page(dir, n);
if (!IS_ERR(page)) {
- kaddr = (char*)page_address(page);
+ kaddr = page_address(page);
de = (struct sysv_dir_entry *) kaddr;
kaddr += PAGE_CACHE_SIZE - SYSV_DIRSIZE;
for ( ; (char *) de <= kaddr ; de++) {
@@ -201,7 +201,7 @@ int sysv_add_link(struct dentry *dentry, struct inode *inode)
err = PTR_ERR(page);
if (IS_ERR(page))
goto out;
- kaddr = (char*)page_address(page);
+ kaddr = page_address(page);
de = (struct sysv_dir_entry *)kaddr;
kaddr += PAGE_CACHE_SIZE - SYSV_DIRSIZE;
while ((char *)de <= kaddr) {
@@ -244,7 +244,7 @@ int sysv_delete_entry(struct sysv_dir_entry *de, struct page *page)
{
struct address_space *mapping = page->mapping;
struct inode *inode = (struct inode*)mapping->host;
- char *kaddr = (char*)page_address(page);
+ char *kaddr = page_address(page);
loff_t pos = page_offset(page) + (char *)de - kaddr;
int err;

@@ -278,7 +278,7 @@ int sysv_make_empty(struct inode *inode, struct inode *dir)
}
kmap(page);

- base = (char*)page_address(page);
+ base = page_address(page);
memset(base, 0, PAGE_CACHE_SIZE);

de = (struct sysv_dir_entry *) base;
@@ -312,7 +312,7 @@ int sysv_empty_dir(struct inode * inode)
if (IS_ERR(page))
continue;

- kaddr = (char *)page_address(page);
+ kaddr = page_address(page);
de = (struct sysv_dir_entry *)kaddr;
kaddr += PAGE_CACHE_SIZE-SYSV_DIRSIZE;

@@ -367,7 +367,7 @@ struct sysv_dir_entry * sysv_dotdot (struct inode *dir, struct page **p)
struct sysv_dir_entry *de = NULL;

if (!IS_ERR(page)) {
- de = (struct sysv_dir_entry*) page_address(page) + 1;
+ de = page_address(page) + 1;
*p = page;
}
return de;
--
1.5.4.3

2009-04-08 11:44:22

by Jack Stone

[permalink] [raw]
Subject: [PATCH 50/56] drivers/staging: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/staging/altpciechdma/altpciechdma.c | 4 ++--
drivers/staging/epl/EplApiLinuxKernel.c | 8 ++------
drivers/staging/et131x/et1310_rx.c | 2 +-
drivers/staging/rtl8187se/r8180_core.c | 10 +++++-----
drivers/staging/slicoss/slicoss.c | 3 +--
5 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/altpciechdma/altpciechdma.c b/drivers/staging/altpciechdma/altpciechdma.c
index 5869e14..f613a1d 100644
--- a/drivers/staging/altpciechdma/altpciechdma.c
+++ b/drivers/staging/altpciechdma/altpciechdma.c
@@ -535,7 +535,7 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev)

/* allocate and map coherently-cached memory for a DMA-able buffer */
/* @see Documentation/PCI/PCI-DMA-mapping.txt, near line 318 */
- buffer_virt = (u8 *)pci_alloc_consistent(dev, PAGE_SIZE * 4, &buffer_bus);
+ buffer_virt = pci_alloc_consistent(dev, PAGE_SIZE * 4, &buffer_bus);
if (!buffer_virt) {
printk(KERN_DEBUG "Could not allocate coherent DMA buffer.\n");
goto fail;
@@ -793,7 +793,7 @@ static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id)

/* allocate and map coherently-cached memory for a descriptor table */
/* @see LDD3 page 446 */
- ape->table_virt = (struct ape_chdma_table *)pci_alloc_consistent(dev,
+ ape->table_virt = pci_alloc_consistent(dev,
APE_CHDMA_TABLE_SIZE, &ape->table_bus);
/* could not allocate table? */
if (!ape->table_virt) {
diff --git a/drivers/staging/epl/EplApiLinuxKernel.c b/drivers/staging/epl/EplApiLinuxKernel.c
index cb3e275..4c5dfcd 100644
--- a/drivers/staging/epl/EplApiLinuxKernel.c
+++ b/drivers/staging/epl/EplApiLinuxKernel.c
@@ -655,9 +655,7 @@ static int EplLinIoctl(struct inode *pDeviceFile_p, // information about the dev
goto Exit;
}

- pBufHeader =
- (tEplLinSdoBufHeader *)
- vmalloc(sizeof(tEplLinSdoBufHeader) +
+ pBufHeader = vmalloc(sizeof(tEplLinSdoBufHeader) +
SdoObject.m_uiSize);
if (pBufHeader == NULL) { // no memory available
iRet = -ENOMEM;
@@ -751,9 +749,7 @@ static int EplLinIoctl(struct inode *pDeviceFile_p, // information about the dev
goto Exit;
}

- pBufHeader =
- (tEplLinSdoBufHeader *)
- vmalloc(sizeof(tEplLinSdoBufHeader) +
+ pBufHeader = vmalloc(sizeof(tEplLinSdoBufHeader) +
SdoObject.m_uiSize);
if (pBufHeader == NULL) { // no memory available
iRet = -ENOMEM;
diff --git a/drivers/staging/et131x/et1310_rx.c b/drivers/staging/et131x/et1310_rx.c
index 8dc559a..4b1ace6 100644
--- a/drivers/staging/et131x/et1310_rx.c
+++ b/drivers/staging/et131x/et1310_rx.c
@@ -610,7 +610,7 @@ int et131x_init_recv(struct et131x_adapter *adapter)

/* Setup each RFD */
for (RfdCount = 0; RfdCount < rx_ring->NumRfd; RfdCount++) {
- pMpRfd = (MP_RFD *) kmem_cache_alloc(rx_ring->RecvLookaside,
+ pMpRfd = kmem_cache_alloc(rx_ring->RecvLookaside,
GFP_ATOMIC | GFP_DMA);

if (!pMpRfd) {
diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c
index 6ecd12d..6223371 100644
--- a/drivers/staging/rtl8187se/r8180_core.c
+++ b/drivers/staging/rtl8187se/r8180_core.c
@@ -1691,7 +1691,7 @@ int alloc_tx_beacon_desc_ring(struct net_device *dev, int count)
u32 *tmp;
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);

- priv->txbeaconring = (u32*)pci_alloc_consistent(priv->pdev,
+ priv->txbeaconring = pci_alloc_consistent(priv->pdev,
sizeof(u32)*8*count,
&priv->txbeaconringdma);
if (!priv->txbeaconring) return -1;
@@ -1727,7 +1727,7 @@ short alloc_tx_desc_ring(struct net_device *dev, int bufsize, int count,
DMESGE ("TX buffer allocation too large");
return 0;
}
- desc = (u32*)pci_alloc_consistent(pdev,
+ desc = pci_alloc_consistent(pdev,
sizeof(u32)*8*count+256, &dma_desc);
if(desc==NULL) return -1;
if(dma_desc & 0xff){
@@ -1751,7 +1751,7 @@ short alloc_tx_desc_ring(struct net_device *dev, int bufsize, int count,
tmp=desc;
for (i=0;i<count;i++)
{
- buf = (void*)pci_alloc_consistent(pdev,bufsize,&dma_tmp);
+ buf = pci_alloc_consistent(pdev,bufsize,&dma_tmp);
if (buf == NULL) return -ENOMEM;

switch(addr) {
@@ -1975,7 +1975,7 @@ short alloc_rx_desc_ring(struct net_device *dev, u16 bufsize, int count)
return -1;
}

- desc = (u32*)pci_alloc_consistent(pdev,sizeof(u32)*rx_desc_size*count+256,
+ desc = pci_alloc_consistent(pdev,sizeof(u32)*rx_desc_size*count+256,
&dma_desc);

if(dma_desc & 0xff){
@@ -2017,7 +2017,7 @@ short alloc_rx_desc_ring(struct net_device *dev, u16 bufsize, int count)
for(j=0;j<bufsize;j++) ((u8*)buf)[i] = 0;
#endif

- //buf = (void*)pci_alloc_consistent(pdev,bufsize,&dma_tmp);
+ //buf = pci_alloc_consistent(pdev,bufsize,&dma_tmp);
if(-1 == buffer_add(&(priv->rxbuffer), buf,dma_tmp,
&(priv->rxbufferhead))){
DMESGE("Unable to allocate mem RX buf");
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index 9481563..746034c 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -333,8 +333,7 @@ static void slic_init_adapter(struct net_device *netdev,
pslic_handle->next = adapter->pfree_slic_handles;
adapter->pfree_slic_handles = pslic_handle;
}
- adapter->pshmem = (struct slic_shmem *)
- pci_alloc_consistent(adapter->pcidev,
+ adapter->pshmem = pci_alloc_consistent(adapter->pcidev,
sizeof(struct slic_shmem),
&adapter->
phys_shmem);
--
1.5.4.3

2009-04-08 11:44:48

by Jack Stone

[permalink] [raw]
Subject: [PATCH 53/56] usb: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/usb/host/ehci-dbg.c | 2 +-
drivers/usb/host/ehci-mem.c | 6 ++----
2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
index 7f4ace7..abfc31f 100644
--- a/drivers/usb/host/ehci-dbg.c
+++ b/drivers/usb/host/ehci-dbg.c
@@ -832,7 +832,7 @@ static int fill_buffer(struct debug_buffer *buf)
int ret = 0;

if (!buf->output_buf)
- buf->output_buf = (char *)vmalloc(buf->alloc_size);
+ buf->output_buf = vmalloc(buf->alloc_size);

if (!buf->output_buf) {
ret = -ENOMEM;
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c
index 10d5291..c128491 100644
--- a/drivers/usb/host/ehci-mem.c
+++ b/drivers/usb/host/ehci-mem.c
@@ -83,8 +83,7 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags)
struct ehci_qh *qh;
dma_addr_t dma;

- qh = (struct ehci_qh *)
- dma_pool_alloc (ehci->qh_pool, flags, &dma);
+ qh = dma_pool_alloc (ehci->qh_pool, flags, &dma);
if (!qh)
return qh;

@@ -212,8 +211,7 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags)
}

/* Hardware periodic table */
- ehci->periodic = (__le32 *)
- dma_alloc_coherent (ehci_to_hcd(ehci)->self.controller,
+ ehci->periodic = dma_alloc_coherent (ehci_to_hcd(ehci)->self.controller,
ehci->periodic_size * sizeof(__le32),
&ehci->periodic_dma, 0);
if (ehci->periodic == NULL) {
--
1.5.4.3

2009-04-08 11:45:37

by Jack Stone

[permalink] [raw]
Subject: [PATCH 27/56] ipv4: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
net/ipv4/route.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index c40debe..3699077 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2707,8 +2707,7 @@ static struct dst_ops ipv4_dst_blackhole_ops = {
static int ipv4_dst_blackhole(struct net *net, struct rtable **rp, struct flowi *flp)
{
struct rtable *ort = *rp;
- struct rtable *rt = (struct rtable *)
- dst_alloc(&ipv4_dst_blackhole_ops);
+ struct rtable *rt = dst_alloc(&ipv4_dst_blackhole_ops);

if (rt) {
struct dst_entry *new = &rt->u.dst;
--
1.5.4.3

2009-04-08 11:46:09

by Jack Stone

[permalink] [raw]
Subject: [PATCH 55/56] xen: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/xen/manage.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 0d61db1..89310fb 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -149,7 +149,7 @@ static void shutdown_handler(struct xenbus_watch *watch,
if (err)
return;

- str = (char *)xenbus_read(xbt, "control", "shutdown", NULL);
+ str = xenbus_read(xbt, "control", "shutdown", NULL);
/* Ignore read errors and empty reads. */
if (XENBUS_IS_ERR_READ(str)) {
xenbus_transaction_end(xbt, 1);
--
1.5.4.3

2009-04-08 11:46:41

by Jack Stone

[permalink] [raw]
Subject: [PATCH 56/56] xfs: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/xfs/quota/xfs_dquot_item.c | 2 +-
fs/xfs/support/ktrace.c | 6 +++---
fs/xfs/xfs_attr_leaf.c | 2 +-
fs/xfs/xfs_buf_item.c | 6 +++---
fs/xfs/xfs_extfree_item.c | 8 ++++----
fs/xfs/xfs_inode.c | 5 ++---
fs/xfs/xfs_log_recover.c | 9 ++++-----
fs/xfs/xfs_trans.c | 2 +-
fs/xfs/xfs_trans_inode.c | 3 +--
fs/xfs/xfs_trans_item.c | 6 ++----
10 files changed, 22 insertions(+), 27 deletions(-)

diff --git a/fs/xfs/quota/xfs_dquot_item.c b/fs/xfs/quota/xfs_dquot_item.c
index 1728f6a..a4d970a 100644
--- a/fs/xfs/quota/xfs_dquot_item.c
+++ b/fs/xfs/quota/xfs_dquot_item.c
@@ -648,7 +648,7 @@ xfs_qm_qoff_logitem_init(
{
xfs_qoff_logitem_t *qf;

- qf = (xfs_qoff_logitem_t*) kmem_zalloc(sizeof(xfs_qoff_logitem_t), KM_SLEEP);
+ qf = kmem_zalloc(sizeof(xfs_qoff_logitem_t), KM_SLEEP);

qf->qql_item.li_type = XFS_LI_QUOTAOFF;
if (start)
diff --git a/fs/xfs/support/ktrace.c b/fs/xfs/support/ktrace.c
index 2d494c2..3982acf 100644
--- a/fs/xfs/support/ktrace.c
+++ b/fs/xfs/support/ktrace.c
@@ -58,7 +58,7 @@ ktrace_alloc(int nentries, unsigned int __nocast sleep)
ktrace_entry_t *ktep;
int entries;

- ktp = (ktrace_t*)kmem_zone_alloc(ktrace_hdr_zone, sleep);
+ ktp = kmem_zone_alloc(ktrace_hdr_zone, sleep);

if (ktp == (ktrace_t*)NULL) {
/*
@@ -75,10 +75,10 @@ ktrace_alloc(int nentries, unsigned int __nocast sleep)
*/
entries = roundup_pow_of_two(nentries);
if (entries == ktrace_zentries) {
- ktep = (ktrace_entry_t*)kmem_zone_zalloc(ktrace_ent_zone,
+ ktep = kmem_zone_zalloc(ktrace_ent_zone,
sleep);
} else {
- ktep = (ktrace_entry_t*)kmem_zalloc((entries * sizeof(*ktep)),
+ ktep = kmem_zalloc((entries * sizeof(*ktep)),
sleep | KM_LARGE);
}

diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
index afdc891..688e894 100644
--- a/fs/xfs/xfs_attr_leaf.c
+++ b/fs/xfs/xfs_attr_leaf.c
@@ -2869,7 +2869,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp)
* Allocate storage for a list of all the "remote" value extents.
*/
size = count * sizeof(xfs_attr_inactive_list_t);
- list = (xfs_attr_inactive_list_t *)kmem_alloc(size, KM_SLEEP);
+ list = kmem_alloc(size, KM_SLEEP);

/*
* Identify each of the "remote" value extents.
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index 92af409..431755a 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -726,7 +726,7 @@ xfs_buf_item_init(
chunks = (int)((XFS_BUF_COUNT(bp) + (XFS_BLI_CHUNK - 1)) >> XFS_BLI_SHIFT);
map_size = (int)((chunks + NBWORD) >> BIT_TO_WORD_SHIFT);

- bip = (xfs_buf_log_item_t*)kmem_zone_zalloc(xfs_buf_item_zone,
+ bip = kmem_zone_zalloc(xfs_buf_item_zone,
KM_SLEEP);
bip->bli_item.li_type = XFS_LI_BUF;
bip->bli_item.li_ops = &xfs_buf_item_ops;
@@ -751,9 +751,9 @@ xfs_buf_item_init(
* the buffer to indicate which bytes the callers have asked
* to have logged.
*/
- bip->bli_orig = (char *)kmem_alloc(XFS_BUF_COUNT(bp), KM_SLEEP);
+ bip->bli_orig = kmem_alloc(XFS_BUF_COUNT(bp), KM_SLEEP);
memcpy(bip->bli_orig, XFS_BUF_PTR(bp), XFS_BUF_COUNT(bp));
- bip->bli_logged = (char *)kmem_zalloc(XFS_BUF_COUNT(bp) / NBBY, KM_SLEEP);
+ bip->bli_logged = kmem_zalloc(XFS_BUF_COUNT(bp) / NBBY, KM_SLEEP);
#endif

/*
diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c
index 05a4bdd..53ccdc4 100644
--- a/fs/xfs/xfs_extfree_item.c
+++ b/fs/xfs/xfs_extfree_item.c
@@ -253,9 +253,9 @@ xfs_efi_init(xfs_mount_t *mp,
if (nextents > XFS_EFI_MAX_FAST_EXTENTS) {
size = (uint)(sizeof(xfs_efi_log_item_t) +
((nextents - 1) * sizeof(xfs_extent_t)));
- efip = (xfs_efi_log_item_t*)kmem_zalloc(size, KM_SLEEP);
+ efip = kmem_zalloc(size, KM_SLEEP);
} else {
- efip = (xfs_efi_log_item_t*)kmem_zone_zalloc(xfs_efi_zone,
+ efip = kmem_zone_zalloc(xfs_efi_zone,
KM_SLEEP);
}

@@ -548,9 +548,9 @@ xfs_efd_init(xfs_mount_t *mp,
if (nextents > XFS_EFD_MAX_FAST_EXTENTS) {
size = (uint)(sizeof(xfs_efd_log_item_t) +
((nextents - 1) * sizeof(xfs_extent_t)));
- efdp = (xfs_efd_log_item_t*)kmem_zalloc(size, KM_SLEEP);
+ efdp = kmem_zalloc(size, KM_SLEEP);
} else {
- efdp = (xfs_efd_log_item_t*)kmem_zone_zalloc(xfs_efd_zone,
+ efdp = kmem_zone_zalloc(xfs_efd_zone,
KM_SLEEP);
}

diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index e7ae08d..5ab6e3d 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -3453,7 +3453,7 @@ xfs_iext_add_indirect_multi(
* (all extents past */
if (nex2) {
byte_diff = nex2 * sizeof(xfs_bmbt_rec_t);
- nex2_ep = (xfs_bmbt_rec_t *) kmem_alloc(byte_diff, KM_NOFS);
+ nex2_ep = kmem_alloc(byte_diff, KM_NOFS);
memmove(nex2_ep, &erp->er_extbuf[idx], byte_diff);
erp->er_extcount -= nex2;
xfs_iext_irec_update_extoffs(ifp, erp_idx + 1, -nex2);
@@ -3842,8 +3842,7 @@ xfs_iext_realloc_indirect(
if (new_size == 0) {
xfs_iext_destroy(ifp);
} else {
- ifp->if_u1.if_ext_irec = (xfs_ext_irec_t *)
- kmem_realloc(ifp->if_u1.if_ext_irec,
+ ifp->if_u1.if_ext_irec = kmem_realloc(ifp->if_u1.if_ext_irec,
new_size, size, KM_NOFS);
}
}
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 7ba4501..3037920 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -1670,7 +1670,7 @@ xlog_recover_do_buffer_pass1(
* the bucket.
*/
if (*bucket == NULL) {
- bcp = (xfs_buf_cancel_t *)kmem_alloc(sizeof(xfs_buf_cancel_t),
+ bcp = kmem_alloc(sizeof(xfs_buf_cancel_t),
KM_SLEEP);
bcp->bc_blkno = blkno;
bcp->bc_len = len;
@@ -1696,7 +1696,7 @@ xlog_recover_do_buffer_pass1(
nextp = nextp->bc_next;
}
ASSERT(prevp != NULL);
- bcp = (xfs_buf_cancel_t *)kmem_alloc(sizeof(xfs_buf_cancel_t),
+ bcp = kmem_alloc(sizeof(xfs_buf_cancel_t),
KM_SLEEP);
bcp->bc_blkno = blkno;
bcp->bc_len = len;
@@ -2316,7 +2316,7 @@ xlog_recover_do_inode_trans(
if (item->ri_buf[0].i_len == sizeof(xfs_inode_log_format_t)) {
in_f = (xfs_inode_log_format_t *)item->ri_buf[0].i_addr;
} else {
- in_f = (xfs_inode_log_format_t *)kmem_alloc(
+ in_f = kmem_alloc(
sizeof(xfs_inode_log_format_t), KM_SLEEP);
need_free = 1;
error = xfs_inode_item_format_convert(&item->ri_buf[0], in_f);
@@ -3778,8 +3778,7 @@ xlog_do_log_recovery(
* First do a pass to find all of the cancelled buf log items.
* Store them in the buf_cancel_table for use in the second pass.
*/
- log->l_buf_cancel_table =
- (xfs_buf_cancel_t **)kmem_zalloc(XLOG_BC_TABLE_SIZE *
+ log->l_buf_cancel_table = kmem_zalloc(XLOG_BC_TABLE_SIZE *
sizeof(xfs_buf_cancel_t*),
KM_SLEEP);
error = xlog_do_recovery_pass(log, head_blk, tail_blk,
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 8570b82..44d039d 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -868,7 +868,7 @@ shut_us_down:
} else if (nvec <= XFS_TRANS_LOGVEC_COUNT) {
log_vector = log_vector_fast;
} else {
- log_vector = (xfs_log_iovec_t *)kmem_alloc(nvec *
+ log_vector = kmem_alloc(nvec *
sizeof(xfs_log_iovec_t),
KM_SLEEP);
}
diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c
index 23d276a..e1b90f0 100644
--- a/fs/xfs/xfs_trans_inode.c
+++ b/fs/xfs/xfs_trans_inode.c
@@ -271,8 +271,7 @@ xfs_trans_inode_broot_debug(
ASSERT((ip->i_df.if_broot != NULL) &&
(ip->i_df.if_broot_bytes > 0));
iip->ili_root_size = ip->i_df.if_broot_bytes;
- iip->ili_orig_root =
- (char*)kmem_alloc(iip->ili_root_size, KM_SLEEP);
+ iip->ili_orig_root = kmem_alloc(iip->ili_root_size, KM_SLEEP);
memcpy(iip->ili_orig_root, (char*)(ip->i_df.if_broot),
iip->ili_root_size);
}
diff --git a/fs/xfs/xfs_trans_item.c b/fs/xfs/xfs_trans_item.c
index eb3fc57..49615dd 100644
--- a/fs/xfs/xfs_trans_item.c
+++ b/fs/xfs/xfs_trans_item.c
@@ -54,8 +54,7 @@ xfs_trans_add_item(xfs_trans_t *tp, xfs_log_item_t *lip)
* of them and put it at the front of the chunk list.
*/
if (tp->t_items_free == 0) {
- licp = (xfs_log_item_chunk_t*)
- kmem_alloc(sizeof(xfs_log_item_chunk_t), KM_SLEEP);
+ licp = kmem_alloc(sizeof(xfs_log_item_chunk_t), KM_SLEEP);
ASSERT(licp != NULL);
/*
* Initialize the chunk, and then
@@ -460,8 +459,7 @@ xfs_trans_add_busy(xfs_trans_t *tp, xfs_agnumber_t ag, xfs_extlen_t idx)
* of them and put it at the front of the chunk list.
*/
if (tp->t_busy_free == 0) {
- lbcp = (xfs_log_busy_chunk_t*)
- kmem_alloc(sizeof(xfs_log_busy_chunk_t), KM_SLEEP);
+ lbcp = kmem_alloc(sizeof(xfs_log_busy_chunk_t), KM_SLEEP);
ASSERT(lbcp != NULL);
/*
* Initialize the chunk, and then
--
1.5.4.3

2009-04-08 11:47:08

by Jack Stone

[permalink] [raw]
Subject: [PATCH 54/56] x86: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
arch/x86/kernel/machine_kexec_64.c | 8 ++++----
arch/x86/kernel/microcode_amd.c | 2 +-
arch/x86/mm/fault.c | 2 +-
arch/x86/mm/init_32.c | 4 ++--
arch/x86/mm/init_64.c | 10 +++++-----
arch/x86/mm/pageattr.c | 4 ++--
6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 89cea4d..1c5b3c9 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -33,7 +33,7 @@ static int init_one_level2_page(struct kimage *image, pgd_t *pgd,
page = kimage_alloc_control_pages(image, 0);
if (!page)
goto out;
- pud = (pud_t *)page_address(page);
+ pud = page_address(page);
memset(pud, 0, PAGE_SIZE);
set_pgd(pgd, __pgd(__pa(pud) | _KERNPG_TABLE));
}
@@ -42,7 +42,7 @@ static int init_one_level2_page(struct kimage *image, pgd_t *pgd,
page = kimage_alloc_control_pages(image, 0);
if (!page)
goto out;
- pmd = (pmd_t *)page_address(page);
+ pmd = page_address(page);
memset(pmd, 0, PAGE_SIZE);
set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE));
}
@@ -84,7 +84,7 @@ static int init_level3_page(struct kimage *image, pud_t *level3p,
result = -ENOMEM;
goto out;
}
- level2p = (pmd_t *)page_address(page);
+ level2p = page_address(page);
init_level2_page(level2p, addr);
set_pud(level3p++, __pud(__pa(level2p) | _KERNPG_TABLE));
addr += PUD_SIZE;
@@ -117,7 +117,7 @@ static int init_level4_page(struct kimage *image, pgd_t *level4p,
result = -ENOMEM;
goto out;
}
- level3p = (pud_t *)page_address(page);
+ level3p = page_address(page);
result = init_level3_page(image, level3p, addr, last_addr);
if (result)
goto out;
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index 453b579..8624d69 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -239,7 +239,7 @@ static int install_equiv_cpu_table(const u8 *buf)
return 0;
}

- equiv_cpu_table = (struct equiv_cpu_entry *) vmalloc(size);
+ equiv_cpu_table = vmalloc(size);
if (!equiv_cpu_table) {
printk(KERN_ERR "microcode: failed to allocate "
"equivalent CPU table\n");
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index a03b727..025e4ac 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -368,7 +368,7 @@ void vmalloc_sync_all(void)
spin_lock_irqsave(&pgd_lock, flags);
list_for_each_entry(page, &pgd_list, lru) {
pgd_t *pgd;
- pgd = (pgd_t *)page_address(page) + pgd_index(address);
+ pgd = page_address(page) + pgd_index(address);
if (pgd_none(*pgd))
set_pgd(pgd, *pgd_ref);
else
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 749559e..64f1a30 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -89,7 +89,7 @@ static pmd_t * __init one_md_table_init(pgd_t *pgd)
if (after_bootmem)
pmd_table = (pmd_t *)alloc_bootmem_low_pages(PAGE_SIZE);
else
- pmd_table = (pmd_t *)alloc_low_page();
+ pmd_table = alloc_low_page();
paravirt_alloc_pmd(&init_mm, __pa(pmd_table) >> PAGE_SHIFT);
set_pgd(pgd, __pgd(__pa(pmd_table) | _PAGE_PRESENT));
pud = pud_offset(pgd, 0);
@@ -121,7 +121,7 @@ static pte_t * __init one_page_table_init(pmd_t *pmd)
page_table =
(pte_t *)alloc_bootmem_low_pages(PAGE_SIZE);
} else
- page_table = (pte_t *)alloc_low_page();
+ page_table = alloc_low_page();

paravirt_alloc_pte(&init_mm, __pa(page_table) >> PAGE_SHIFT);
set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE));
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 1753e80..bd08334 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -164,7 +164,7 @@ static __ref void *spp_getpage(void)
static pud_t *fill_pud(pgd_t *pgd, unsigned long vaddr)
{
if (pgd_none(*pgd)) {
- pud_t *pud = (pud_t *)spp_getpage();
+ pud_t *pud = spp_getpage();
pgd_populate(&init_mm, pgd, pud);
if (pud != pud_offset(pgd, 0))
printk(KERN_ERR "PAGETABLE BUG #00! %p <-> %p\n",
@@ -176,7 +176,7 @@ static pud_t *fill_pud(pgd_t *pgd, unsigned long vaddr)
static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr)
{
if (pud_none(*pud)) {
- pmd_t *pmd = (pmd_t *) spp_getpage();
+ pmd_t *pmd = spp_getpage();
pud_populate(&init_mm, pud, pmd);
if (pmd != pmd_offset(pud, 0))
printk(KERN_ERR "PAGETABLE BUG #01! %p <-> %p\n",
@@ -188,7 +188,7 @@ static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr)
static pte_t *fill_pte(pmd_t *pmd, unsigned long vaddr)
{
if (pmd_none(*pmd)) {
- pte_t *pte = (pte_t *) spp_getpage();
+ pte_t *pte = spp_getpage();
pmd_populate_kernel(&init_mm, pmd, pte);
if (pte != pte_offset_kernel(pmd, 0))
printk(KERN_ERR "PAGETABLE BUG #02!\n");
@@ -264,13 +264,13 @@ static void __init __init_extra_mapping(unsigned long phys, unsigned long size,
for (; size; phys += PMD_SIZE, size -= PMD_SIZE) {
pgd = pgd_offset_k((unsigned long)__va(phys));
if (pgd_none(*pgd)) {
- pud = (pud_t *) spp_getpage();
+ pud = spp_getpage();
set_pgd(pgd, __pgd(__pa(pud) | _KERNPG_TABLE |
_PAGE_USER));
}
pud = pud_offset(pgd, (unsigned long)__va(phys));
if (pud_none(*pud)) {
- pmd = (pmd_t *) spp_getpage();
+ pmd = spp_getpage();
set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE |
_PAGE_USER));
}
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index d71e1b6..55d3c7c 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -343,7 +343,7 @@ static void __set_pmd_pte(pte_t *kpte, unsigned long address, pte_t pte)
pud_t *pud;
pmd_t *pmd;

- pgd = (pgd_t *)page_address(page) + pgd_index(address);
+ pgd = page_address(page) + pgd_index(address);
pud = pud_offset(pgd, address);
pmd = pmd_offset(pud, address);
set_pte_atomic((pte_t *)pmd, pte);
@@ -490,7 +490,7 @@ static int split_large_page(pte_t *kpte, unsigned long address)
if (tmp != kpte)
goto out_unlock;

- pbase = (pte_t *)page_address(base);
+ pbase = page_address(base);
paravirt_alloc_pte(&init_mm, page_to_pfn(base));
ref_prot = pte_pgprot(pte_clrhuge(*kpte));
/*
--
1.5.4.3

2009-04-08 11:47:38

by Jack Stone

[permalink] [raw]
Subject: [PATCH 24/56] mips: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
arch/mips/boot/elf2ecoff.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/boot/elf2ecoff.c b/arch/mips/boot/elf2ecoff.c
index c5a7f30..0a4cbf0 100644
--- a/arch/mips/boot/elf2ecoff.c
+++ b/arch/mips/boot/elf2ecoff.c
@@ -136,7 +136,7 @@ static char *saveRead(int file, off_t offset, off_t len, char *name)
fprintf(stderr, "%s: fseek: %s\n", name, strerror(errno));
exit(1);
}
- if (!(tmp = (char *) malloc(len))) {
+ if (!(tmp = malloc(len))) {
fprintf(stderr, "%s: Can't allocate %ld bytes.\n", name,
len);
exit(1);
--
1.5.4.3

2009-04-08 11:48:09

by Jack Stone

[permalink] [raw]
Subject: [PATCH 52/56] ufs: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/ufs/dir.c | 2 +-
fs/ufs/super.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c
index dbbbc46..17898e3 100644
--- a/fs/ufs/dir.c
+++ b/fs/ufs/dir.c
@@ -585,7 +585,7 @@ int ufs_make_empty(struct inode * inode, struct inode *dir)
}

kmap(page);
- base = (char*)page_address(page);
+ base = page_address(page);
memset(base, 0, PAGE_CACHE_SIZE);

de = (struct ufs_dir_entry *) base;
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 6035929..2488b6d 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -1304,7 +1304,7 @@ static struct kmem_cache * ufs_inode_cachep;
static struct inode *ufs_alloc_inode(struct super_block *sb)
{
struct ufs_inode_info *ei;
- ei = (struct ufs_inode_info *)kmem_cache_alloc(ufs_inode_cachep, GFP_KERNEL);
+ ei = kmem_cache_alloc(ufs_inode_cachep, GFP_KERNEL);
if (!ei)
return NULL;
ei->vfs_inode.i_version = 1;
--
1.5.4.3

2009-04-08 11:48:35

by Jack Stone

[permalink] [raw]
Subject: [PATCH 43/56] s390: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
arch/s390/math-emu/math.c | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/s390/math-emu/math.c b/arch/s390/math-emu/math.c
index 3ee78cc..c1d43c9 100644
--- a/arch/s390/math-emu/math.c
+++ b/arch/s390/math-emu/math.c
@@ -1917,7 +1917,7 @@ int math_emu_ed(__u8 *opcode, struct pt_regs * regs) {

emu_store_regd((opcode[1] >> 4) & 15);
opc = *((__u32 *) opcode);
- dxb = (__u64 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
+ dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
mathemu_copy_from_user(&temp, dxb, 8);
/* call the emulation function */
_fex = ((int (*)(struct pt_regs *, int, double *))
@@ -1932,7 +1932,7 @@ int math_emu_ed(__u8 *opcode, struct pt_regs * regs) {

emu_store_rege((opcode[1] >> 4) & 15);
opc = *((__u32 *) opcode);
- dxb = (__u32 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
+ dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
mathemu_get_user(temp, dxb);
/* call the emulation function */
_fex = ((int (*)(struct pt_regs *, int, float *))
@@ -1948,7 +1948,7 @@ int math_emu_ed(__u8 *opcode, struct pt_regs * regs) {
emu_store_regd((opcode[1] >> 4) & 15);
emu_store_regd((opcode[4] >> 4) & 15);
opc = *((__u32 *) opcode);
- dxb = (__u64 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
+ dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
mathemu_copy_from_user(&temp, dxb, 8);
/* call the emulation function */
_fex = ((int (*)(struct pt_regs *, int, double *, int))
@@ -1964,7 +1964,7 @@ int math_emu_ed(__u8 *opcode, struct pt_regs * regs) {
emu_store_rege((opcode[1] >> 4) & 15);
emu_store_rege((opcode[4] >> 4) & 15);
opc = *((__u32 *) opcode);
- dxb = (__u32 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
+ dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
mathemu_get_user(temp, dxb);
/* call the emulation function */
_fex = ((int (*)(struct pt_regs *, int, float *, int))
@@ -1982,7 +1982,7 @@ int math_emu_ed(__u8 *opcode, struct pt_regs * regs) {
return SIGILL;
emu_store_regd((opcode[1] >> 4) & 15);
opc = *((__u32 *) opcode);
- dxb = (__u64 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
+ dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
mathemu_copy_from_user(&temp, dxb, 8);
/* call the emulation function */
_fex = ((int (*)(struct pt_regs *, int, double *))
@@ -1999,7 +1999,7 @@ int math_emu_ed(__u8 *opcode, struct pt_regs * regs) {
__u32 opc;
emu_store_rege((opcode[1] >> 4) & 15);
opc = *((__u32 *) opcode);
- dxb = (__u32 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
+ dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
mathemu_get_user(temp, dxb);
/* call the emulation function */
_fex = ((int (*)(struct pt_regs *, int, float *))
@@ -2017,7 +2017,7 @@ int math_emu_ed(__u8 *opcode, struct pt_regs * regs) {
return SIGILL;
emu_store_rege((opcode[1] >> 4) & 15);
opc = *((__u32 *) opcode);
- dxb = (__u32 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
+ dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
mathemu_get_user(temp, dxb);
/* call the emulation function */
_fex = ((int (*)(struct pt_regs *, int, float *))
@@ -2148,7 +2148,7 @@ int math_emu_ld(__u8 *opcode, struct pt_regs * regs) {
__u32 opc = *((__u32 *) opcode);
__u64 *dxb;

- dxb = (__u64 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
+ dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
mathemu_copy_from_user(&fp_regs->fprs[(opc >> 20) & 0xf].d, dxb, 8);
return 0;
}
@@ -2161,7 +2161,7 @@ int math_emu_le(__u8 *opcode, struct pt_regs * regs) {
__u32 opc = *((__u32 *) opcode);
__u32 *mem, *dxb;

- dxb = (__u32 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
+ dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
mem = (__u32 *) (&fp_regs->fprs[(opc >> 20) & 0xf].f);
mathemu_get_user(mem[0], dxb);
return 0;
@@ -2175,7 +2175,7 @@ int math_emu_std(__u8 *opcode, struct pt_regs * regs) {
__u32 opc = *((__u32 *) opcode);
__u64 *dxb;

- dxb = (__u64 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
+ dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
mathemu_copy_to_user(dxb, &fp_regs->fprs[(opc >> 20) & 0xf].d, 8);
return 0;
}
@@ -2188,7 +2188,7 @@ int math_emu_ste(__u8 *opcode, struct pt_regs * regs) {
__u32 opc = *((__u32 *) opcode);
__u32 *mem, *dxb;

- dxb = (__u32 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
+ dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
mem = (__u32 *) (&fp_regs->fprs[(opc >> 20) & 0xf].f);
mathemu_put_user(mem[0], dxb);
return 0;
@@ -2201,7 +2201,7 @@ int math_emu_lfpc(__u8 *opcode, struct pt_regs *regs) {
__u32 opc = *((__u32 *) opcode);
__u32 *dxb, temp;

- dxb= (__u32 *) calc_addr(regs, 0, opc>>12, opc);
+ dxb= calc_addr(regs, 0, opc>>12, opc);
mathemu_get_user(temp, dxb);
if ((temp & ~FPC_VALID_MASK) != 0)
return SIGILL;
@@ -2216,7 +2216,7 @@ int math_emu_stfpc(__u8 *opcode, struct pt_regs *regs) {
__u32 opc = *((__u32 *) opcode);
__u32 *dxb;

- dxb= (__u32 *) calc_addr(regs, 0, opc>>12, opc);
+ dxb= calc_addr(regs, 0, opc>>12, opc);
mathemu_put_user(current->thread.fp_regs.fpc, dxb);
return 0;
}
--
1.5.4.3

2009-04-08 11:49:08

by Jack Stone

[permalink] [raw]
Subject: [PATCH 41/56] reiserfs: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/reiserfs/inode.c | 2 +-
fs/reiserfs/super.c | 3 +--
fs/reiserfs/tail_conversion.c | 2 +-
3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 6fd0f47..b304e16 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -349,7 +349,7 @@ static int _get_block_create_0(struct inode *inode, sector_t block,
** kmap schedules
*/
if (!p) {
- p = (char *)kmap(bh_result->b_page);
+ p = kmap(bh_result->b_page);
if (fs_changed(fs_gen, inode->i_sb)
&& item_moved(&tmp_ih, &path)) {
goto research;
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 0ae6486..ada745d 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -510,8 +510,7 @@ static struct kmem_cache *reiserfs_inode_cachep;
static struct inode *reiserfs_alloc_inode(struct super_block *sb)
{
struct reiserfs_inode_info *ei;
- ei = (struct reiserfs_inode_info *)
- kmem_cache_alloc(reiserfs_inode_cachep, GFP_KERNEL);
+ ei = kmem_cache_alloc(reiserfs_inode_cachep, GFP_KERNEL);
if (!ei)
return NULL;
return &ei->vfs_inode;
diff --git a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c
index d7f6e51..2916393 100644
--- a/fs/reiserfs/tail_conversion.c
+++ b/fs/reiserfs/tail_conversion.c
@@ -211,7 +211,7 @@ int indirect2direct(struct reiserfs_transaction_handle *th,
// append can be done either
// we are in truncate or packing tail in file_release

- tail = (char *)kmap(page); /* this can schedule */
+ tail = kmap(page); /* this can schedule */

if (path_changed(&s_ih, path)) {
/* re-search indirect item */
--
1.5.4.3

2009-04-08 11:49:46

by Jack Stone

[permalink] [raw]
Subject: [PATCH 38/56] pci: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/pci/intel-iommu.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index fb3a3f3..c0dd267 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -519,7 +519,7 @@ static struct context_entry * device_to_context_entry(struct intel_iommu *iommu,
root = &iommu->root_entry[bus];
context = get_context_addr_from_root(root);
if (!context) {
- context = (struct context_entry *)alloc_pgtable_page();
+ context = alloc_pgtable_page();
if (!context) {
spin_unlock_irqrestore(&iommu->lock, flags);
return NULL;
@@ -789,7 +789,7 @@ static int iommu_alloc_root_entry(struct intel_iommu *iommu)
struct root_entry *root;
unsigned long flags;

- root = (struct root_entry *)alloc_pgtable_page();
+ root = alloc_pgtable_page();
if (!root)
return -ENOMEM;

@@ -1290,7 +1290,7 @@ static int domain_init(struct dmar_domain *domain, int guest_width)
domain->iommu_count = 1;

/* always allocate the top pgd */
- domain->pgd = (struct dma_pte *)alloc_pgtable_page();
+ domain->pgd = alloc_pgtable_page();
if (!domain->pgd)
return -ENOMEM;
__iommu_flush_cache(iommu, domain->pgd, PAGE_SIZE);
@@ -3019,7 +3019,7 @@ static int vm_domain_init(struct dmar_domain *domain, int guest_width)
domain->max_addr = 0;

/* always allocate the top pgd */
- domain->pgd = (struct dma_pte *)alloc_pgtable_page();
+ domain->pgd = alloc_pgtable_page();
if (!domain->pgd)
return -ENOMEM;
domain_flush_cache(domain, domain->pgd, PAGE_SIZE);
--
1.5.4.3

2009-04-08 11:50:26

by Jack Stone

[permalink] [raw]
Subject: [PATCH 36/56] ocfs2: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/ocfs2/dlm/dlmmaster.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index f8b653f..e4c2f5b 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -758,8 +758,7 @@ lookup:
spin_unlock(&dlm->spinlock);
mlog(0, "allocating a new resource\n");
/* nothing found and we need to allocate one. */
- alloc_mle = (struct dlm_master_list_entry *)
- kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
+ alloc_mle = kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
if (!alloc_mle)
goto leave;
res = dlm_new_lockres(dlm, lockid, namelen);
@@ -1543,8 +1542,7 @@ way_up_top:
spin_unlock(&dlm->master_lock);
spin_unlock(&dlm->spinlock);

- mle = (struct dlm_master_list_entry *)
- kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
+ mle = kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
if (!mle) {
response = DLM_MASTER_RESP_ERROR;
mlog_errno(-ENOMEM);
@@ -2455,7 +2453,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
goto leave;
}

- mle = (struct dlm_master_list_entry *) kmem_cache_alloc(dlm_mle_cache,
+ mle = kmem_cache_alloc(dlm_mle_cache,
GFP_NOFS);
if (!mle) {
mlog_errno(ret);
@@ -3036,7 +3034,7 @@ int dlm_migrate_request_handler(struct o2net_msg *msg, u32 len, void *data,
hash = dlm_lockid_hash(name, namelen);

/* preallocate.. if this fails, abort */
- mle = (struct dlm_master_list_entry *) kmem_cache_alloc(dlm_mle_cache,
+ mle = kmem_cache_alloc(dlm_mle_cache,
GFP_NOFS);

if (!mle) {
--
1.5.4.3

2009-04-08 11:50:56

by Jack Stone

[permalink] [raw]
Subject: [PATCH 35/56] ntfs: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/ntfs/compress.c | 2 +-
fs/ntfs/dir.c | 8 ++++----
fs/ntfs/index.c | 2 +-
fs/ntfs/logfile.c | 2 +-
fs/ntfs/mft.c | 4 ++--
fs/ntfs/super.c | 8 ++++----
fs/ntfs/usnjrnl.c | 2 +-
7 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/fs/ntfs/compress.c b/fs/ntfs/compress.c
index 9669541..12297ee 100644
--- a/fs/ntfs/compress.c
+++ b/fs/ntfs/compress.c
@@ -280,7 +280,7 @@ return_error:
}

/* We have a valid destination page. Setup the destination pointers. */
- dp_addr = (u8*)page_address(dp) + do_sb_start;
+ dp_addr = page_address(dp) + do_sb_start;

/* Now, we are ready to process the current sub-block (sb). */
if (!(le16_to_cpup((le16*)cb) & NTFS_SB_IS_COMPRESSED)) {
diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c
index 5a9e344..c373301 100644
--- a/fs/ntfs/dir.c
+++ b/fs/ntfs/dir.c
@@ -326,7 +326,7 @@ descend_into_child_node:
goto err_out;
}
lock_page(page);
- kaddr = (u8*)page_address(page);
+ kaddr = page_address(page);
fast_descend_into_child_node:
/* Get to the index allocation block. */
ia = (INDEX_ALLOCATION*)(kaddr + ((vcn <<
@@ -804,7 +804,7 @@ descend_into_child_node:
goto err_out;
}
lock_page(page);
- kaddr = (u8*)page_address(page);
+ kaddr = page_address(page);
fast_descend_into_child_node:
/* Get to the index allocation block. */
ia = (INDEX_ALLOCATION*)(kaddr + ((vcn <<
@@ -1279,7 +1279,7 @@ get_next_bmp_page:
bmp_page = NULL;
goto iput_err_out;
}
- bmp = (u8*)page_address(bmp_page);
+ bmp = page_address(bmp_page);
/* Find next index block in use. */
while (!(bmp[cur_bmp_pos >> 3] & (1 << (cur_bmp_pos & 7)))) {
find_next_index_buffer:
@@ -1322,7 +1322,7 @@ find_next_index_buffer:
goto err_out;
}
lock_page(ia_page);
- kaddr = (u8*)page_address(ia_page);
+ kaddr = page_address(ia_page);
}
/* Get the current index buffer. */
ia = (INDEX_ALLOCATION*)(kaddr + (ia_pos & ~PAGE_CACHE_MASK &
diff --git a/fs/ntfs/index.c b/fs/ntfs/index.c
index 2194eff..16a8b2e 100644
--- a/fs/ntfs/index.c
+++ b/fs/ntfs/index.c
@@ -282,7 +282,7 @@ descend_into_child_node:
goto err_out;
}
lock_page(page);
- kaddr = (u8*)page_address(page);
+ kaddr = page_address(page);
fast_descend_into_child_node:
/* Get to the index allocation block. */
ia = (INDEX_ALLOCATION*)(kaddr + ((vcn <<
diff --git a/fs/ntfs/logfile.c b/fs/ntfs/logfile.c
index d7932e9..b6be7c4 100644
--- a/fs/ntfs/logfile.c
+++ b/fs/ntfs/logfile.c
@@ -549,7 +549,7 @@ bool ntfs_check_logfile(struct inode *log_vi, RESTART_PAGE_HEADER **rp)
goto err_out;
}
}
- kaddr = (u8*)page_address(page) + (pos & ~PAGE_CACHE_MASK);
+ kaddr = page_address(page) + (pos & ~PAGE_CACHE_MASK);
/*
* A non-empty block means the logfile is not empty while an
* empty block after a non-empty block has been encountered
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c
index 23bf684..552f91b 100644
--- a/fs/ntfs/mft.c
+++ b/fs/ntfs/mft.c
@@ -1196,7 +1196,7 @@ static int ntfs_mft_bitmap_find_and_alloc_free_rec_nolock(ntfs_volume *vol,
"bitmap, aborting.");
return PTR_ERR(page);
}
- buf = (u8*)page_address(page) + page_ofs;
+ buf = page_address(page) + page_ofs;
bit = data_pos & 7;
data_pos &= ~7ull;
ntfs_debug("Before inner for loop: size 0x%x, "
@@ -1334,7 +1334,7 @@ static int ntfs_mft_bitmap_extend_allocation_nolock(ntfs_volume *vol)
ntfs_error(vol->sb, "Failed to read from lcn bitmap.");
return PTR_ERR(page);
}
- b = (u8*)page_address(page) + (ll & ~PAGE_CACHE_MASK);
+ b = page_address(page) + (ll & ~PAGE_CACHE_MASK);
tb = 1 << (lcn & 7ull);
down_write(&vol->lcnbmp_lock);
if (*b != 0xff && !(*b & tb)) {
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index f76951d..d05bccf 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -1295,7 +1295,7 @@ static int check_windows_hibernation_status(ntfs_volume *vol)
ret = PTR_ERR(page);
goto iput_out;
}
- kaddr = (u32*)page_address(page);
+ kaddr = page_address(page);
if (*(le32*)kaddr == cpu_to_le32(0x72626968)/*'hibr'*/) {
ntfs_debug("Magic \"hibr\" found in hiberfil.sys. Windows is "
"hibernated on the volume. This is the "
@@ -1515,7 +1515,7 @@ not_enabled:
"attribute.");
return false;
}
- uh = (USN_HEADER*)page_address(page);
+ uh = page_address(page);
/* Sanity check the $Max. */
if (unlikely(sle64_to_cpu(uh->allocation_delta) >
sle64_to_cpu(uh->maximum_size))) {
@@ -2501,7 +2501,7 @@ static s64 get_nr_free_clusters(ntfs_volume *vol)
nr_free -= PAGE_CACHE_SIZE * 8;
continue;
}
- kaddr = (u32*)kmap_atomic(page, KM_USER0);
+ kaddr = kmap_atomic(page, KM_USER0);
/*
* For each 4 bytes, subtract the number of set bits. If this
* is the last page and it is partial we don't really care as
@@ -2572,7 +2572,7 @@ static unsigned long __get_nr_free_mft_records(ntfs_volume *vol,
nr_free -= PAGE_CACHE_SIZE * 8;
continue;
}
- kaddr = (u32*)kmap_atomic(page, KM_USER0);
+ kaddr = kmap_atomic(page, KM_USER0);
/*
* For each 4 bytes, subtract the number of set bits. If this
* is the last page and it is partial we don't really care as
diff --git a/fs/ntfs/usnjrnl.c b/fs/ntfs/usnjrnl.c
index b2bc0d5..5c8fdd7 100644
--- a/fs/ntfs/usnjrnl.c
+++ b/fs/ntfs/usnjrnl.c
@@ -58,7 +58,7 @@ bool ntfs_stamp_usnjrnl(ntfs_volume *vol)
"$UsnJrnl/$DATA/$Max attribute.");
return false;
}
- uh = (USN_HEADER*)page_address(page);
+ uh = page_address(page);
stamp = get_current_ntfs_time();
ntfs_debug("Stamping transaction log ($UsnJrnl): old "
"journal_id 0x%llx, old lowest_valid_usn "
--
1.5.4.3

2009-04-08 11:51:26

by Jack Stone

[permalink] [raw]
Subject: [PATCH 34/56] nfs: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
fs/nfs/inode.c | 2 +-
fs/nfs/nfs2xdr.c | 2 +-
fs/nfs/nfs3xdr.c | 2 +-
fs/nfs/nfs4xdr.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 64f8719..c6aceaf 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1342,7 +1342,7 @@ void nfs4_clear_inode(struct inode *inode)
struct inode *nfs_alloc_inode(struct super_block *sb)
{
struct nfs_inode *nfsi;
- nfsi = (struct nfs_inode *)kmem_cache_alloc(nfs_inode_cachep, GFP_KERNEL);
+ nfsi = kmem_cache_alloc(nfs_inode_cachep, GFP_KERNEL);
if (!nfsi)
return NULL;
nfsi->flags = 0UL;
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index c862c93..a9017a6 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -627,7 +627,7 @@ nfs_xdr_readlinkres(struct rpc_rqst *req, __be32 *p, void *dummy)
}

/* NULL terminate the string we got */
- kaddr = (char *)kmap_atomic(rcvbuf->pages[0], KM_USER0);
+ kaddr = kmap_atomic(rcvbuf->pages[0], KM_USER0);
kaddr[len+rcvbuf->page_base] = '\0';
kunmap_atomic(kaddr, KM_USER0);
return 0;
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index e6a1932..48ccc17 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -859,7 +859,7 @@ nfs3_xdr_readlinkres(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr)
}

/* NULL terminate the string we got */
- kaddr = (char*)kmap_atomic(rcvbuf->pages[0], KM_USER0);
+ kaddr = kmap_atomic(rcvbuf->pages[0], KM_USER0);
kaddr[len+rcvbuf->page_base] = '\0';
kunmap_atomic(kaddr, KM_USER0);
return 0;
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 1690f0e..a283caa 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -3565,7 +3565,7 @@ static int decode_readlink(struct xdr_stream *xdr, struct rpc_rqst *req)
* and and null-terminate the text (the VFS expects
* null-termination).
*/
- kaddr = (char *)kmap_atomic(rcvbuf->pages[0], KM_USER0);
+ kaddr = kmap_atomic(rcvbuf->pages[0], KM_USER0);
kaddr[len+rcvbuf->page_base] = '\0';
kunmap_atomic(kaddr, KM_USER0);
return 0;
--
1.5.4.3

2009-04-08 11:51:51

by Jack Stone

[permalink] [raw]
Subject: [PATCH 31/56] sctp: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
net/sctp/socket.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 5fb3a8c..3ed4b4d 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -227,7 +227,7 @@ struct sctp_association *sctp_id2assoc(struct sock *sk, sctp_assoc_t id)
return NULL;

spin_lock_bh(&sctp_assocs_id_lock);
- asoc = (struct sctp_association *)idr_find(&sctp_assocs_id, (int)id);
+ asoc = idr_find(&sctp_assocs_id, (int)id);
spin_unlock_bh(&sctp_assocs_id_lock);

if (!asoc || (asoc->base.sk != sk) || asoc->base.dead)
--
1.5.4.3

2009-04-08 11:52:30

by Jack Stone

[permalink] [raw]
Subject: [PATCH 29/56] irda: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
net/irda/discovery.c | 4 ++--
net/irda/ircomm/ircomm_lmp.c | 2 +-
net/irda/iriap.c | 2 +-
net/irda/irnet/irnet_irda.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/irda/discovery.c b/net/irda/discovery.c
index a6f99b5..7fdc346 100644
--- a/net/irda/discovery.c
+++ b/net/irda/discovery.c
@@ -130,11 +130,11 @@ void irlmp_add_discovery_log(hashbin_t *cachelog, hashbin_t *log)
* no need to lock it.
* We just need to lock the global log in irlmp_add_discovery().
*/
- discovery = (discovery_t *) hashbin_remove_first(log);
+ discovery = hashbin_remove_first(log);
while (discovery != NULL) {
irlmp_add_discovery(cachelog, discovery);

- discovery = (discovery_t *) hashbin_remove_first(log);
+ discovery = hashbin_remove_first(log);
}

/* Delete the now empty log */
diff --git a/net/irda/ircomm/ircomm_lmp.c b/net/irda/ircomm/ircomm_lmp.c
index 67c99d2..6245b45 100644
--- a/net/irda/ircomm/ircomm_lmp.c
+++ b/net/irda/ircomm/ircomm_lmp.c
@@ -152,7 +152,7 @@ static void ircomm_lmp_flow_control(struct sk_buff *skb)

line = cb->line;

- self = (struct ircomm_cb *) hashbin_lock_find(ircomm, line, NULL);
+ self = hashbin_lock_find(ircomm, line, NULL);
if (!self) {
IRDA_DEBUG(2, "%s(), didn't find myself\n", __func__ );
return;
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index 4a105dc..12cb0e9 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -251,7 +251,7 @@ void iriap_close(struct iriap_cb *self)
self->lsap = NULL;
}

- entry = (struct iriap_cb *) hashbin_remove(iriap, (long) self, NULL);
+ entry = hashbin_remove(iriap, (long) self, NULL);
IRDA_ASSERT(entry == self, return;);

__iriap_close(self);
diff --git a/net/irda/irnet/irnet_irda.c b/net/irda/irnet/irnet_irda.c
index cf9a4b5..213f207 100644
--- a/net/irda/irnet/irnet_irda.c
+++ b/net/irda/irnet/irnet_irda.c
@@ -766,7 +766,7 @@ irnet_find_socket(irnet_socket * self)
* requested that nickname */
if(err == 0)
{
- new = (irnet_socket *) hashbin_find(irnet_server.list,
+ new = hashbin_find(irnet_server.list,
0, self->rname);
if(new)
DEBUG(IRDA_SERV_INFO, "Socket 0x%p matches rname ``%s''.\n",
--
1.5.4.3

2009-04-08 11:53:02

by Jack Stone

[permalink] [raw]
Subject: [PATCH 28/56] ipv6: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
net/ipv6/route.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 1394ddb..9c70a88 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -834,8 +834,7 @@ EXPORT_SYMBOL(ip6_route_output);
int ip6_dst_blackhole(struct sock *sk, struct dst_entry **dstp, struct flowi *fl)
{
struct rt6_info *ort = (struct rt6_info *) *dstp;
- struct rt6_info *rt = (struct rt6_info *)
- dst_alloc(&ip6_dst_blackhole_ops);
+ struct rt6_info *rt = dst_alloc(&ip6_dst_blackhole_ops);
struct dst_entry *new = NULL;

if (rt) {
--
1.5.4.3

2009-04-08 11:53:32

by Jack Stone

[permalink] [raw]
Subject: [PATCH 30/56] net: Remove void casts

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---
drivers/net/arm/at91_ether.c | 2 +-
drivers/net/cassini.c | 3 +--
drivers/net/fs_enet/mac-fcc.c | 2 +-
drivers/net/fs_enet/mac-fec.c | 2 +-
drivers/net/fs_enet/mac-scc.c | 3 +--
drivers/net/gianfar.c | 2 +-
drivers/net/ibmveth.c | 4 ++--
drivers/net/irda/au1k_ir.c | 3 +--
drivers/net/netxen/netxen_nic_init.c | 6 ++----
drivers/net/skfp/ess.c | 20 ++++++++++----------
drivers/net/skfp/hwmtm.c | 7 +++----
drivers/net/skfp/pmf.c | 4 ++--
drivers/net/skfp/smt.c | 3 +--
drivers/net/sungem.c | 3 +--
drivers/net/sunhme.c | 3 +--
drivers/net/typhoon.c | 2 +-
drivers/net/via-velocity.c | 2 +-
drivers/net/wan/dscc4.c | 6 +++---
drivers/net/wireless/ipw2x00/ipw2100.c | 3 +--
19 files changed, 35 insertions(+), 45 deletions(-)

diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c
index 442938d..c389b66 100644
--- a/drivers/net/arm/at91_ether.c
+++ b/drivers/net/arm/at91_ether.c
@@ -992,7 +992,7 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add

/* Allocate memory for DMA Receive descriptors */
lp = netdev_priv(dev);
- lp->dlist = (struct recv_desc_bufs *) dma_alloc_coherent(NULL, sizeof(struct recv_desc_bufs), (dma_addr_t *) &lp->dlist_phys, GFP_KERNEL);
+ lp->dlist = dma_alloc_coherent(NULL, sizeof(struct recv_desc_bufs), (dma_addr_t *) &lp->dlist_phys, GFP_KERNEL);
if (lp->dlist == NULL) {
free_irq(dev->irq, dev);
free_netdev(dev);
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index f522276..620b783 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -5162,8 +5162,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
if (cas_saturn_firmware_init(cp))
goto err_out_iounmap;

- cp->init_block = (struct cas_init_block *)
- pci_alloc_consistent(pdev, sizeof(struct cas_init_block),
+ cp->init_block = pci_alloc_consistent(pdev, sizeof(struct cas_init_block),
&cp->block_dvma);
if (!cp->init_block) {
dev_err(&pdev->dev, "Cannot allocate init block, aborting.\n");
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c
index 22e5a84..47b307c 100644
--- a/drivers/net/fs_enet/mac-fcc.c
+++ b/drivers/net/fs_enet/mac-fcc.c
@@ -148,7 +148,7 @@ static int allocate_bd(struct net_device *dev)
struct fs_enet_private *fep = netdev_priv(dev);
const struct fs_platform_info *fpi = fep->fpi;

- fep->ring_base = (void __iomem __force *)dma_alloc_coherent(fep->dev,
+ fep->ring_base = dma_alloc_coherent(fep->dev,
(fpi->tx_ring + fpi->rx_ring) *
sizeof(cbd_t), &fep->ring_mem_addr,
GFP_KERNEL);
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c
index 14e5753..166854a 100644
--- a/drivers/net/fs_enet/mac-fec.c
+++ b/drivers/net/fs_enet/mac-fec.c
@@ -138,7 +138,7 @@ static int allocate_bd(struct net_device *dev)
struct fs_enet_private *fep = netdev_priv(dev);
const struct fs_platform_info *fpi = fep->fpi;

- fep->ring_base = (void __force __iomem *)dma_alloc_coherent(fep->dev,
+ fep->ring_base = dma_alloc_coherent(fep->dev,
(fpi->tx_ring + fpi->rx_ring) *
sizeof(cbd_t), &fep->ring_mem_addr,
GFP_KERNEL);
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c
index 008cdd9..430634c 100644
--- a/drivers/net/fs_enet/mac-scc.c
+++ b/drivers/net/fs_enet/mac-scc.c
@@ -148,8 +148,7 @@ static int allocate_bd(struct net_device *dev)
if (IS_ERR_VALUE(fep->ring_mem_addr))
return -ENOMEM;

- fep->ring_base = (void __iomem __force*)
- cpm_dpram_addr(fep->ring_mem_addr);
+ fep->ring_base = cpm_dpram_addr(fep->ring_mem_addr);

return 0;
}
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 65f5587..7a8885e 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -268,7 +268,7 @@ static int gfar_of_init(struct net_device *dev)
if (ph == NULL) {
u32 *fixed_link;

- fixed_link = (u32 *)of_get_property(np, "fixed-link", NULL);
+ fixed_link = of_get_property(np, "fixed-link", NULL);
if (!fixed_link) {
err = -ENODEV;
goto err_out;
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index 5c6315d..d3c58fe 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -1218,7 +1218,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
ibmveth_debug_printk_no_adapter("entering ibmveth_probe for UA 0x%x\n",
dev->unit_address);

- mac_addr_p = (unsigned char *) vio_get_attribute(dev,
+ mac_addr_p = vio_get_attribute(dev,
VETH_MAC_ADDR, NULL);
if(!mac_addr_p) {
printk(KERN_ERR "(%s:%3.3d) ERROR: Can't find VETH_MAC_ADDR "
@@ -1226,7 +1226,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
return 0;
}

- mcastFilterSize_p = (unsigned int *) vio_get_attribute(dev,
+ mcastFilterSize_p = vio_get_attribute(dev,
VETH_MCAST_FILTER_SIZE, NULL);
if(!mcastFilterSize_p) {
printk(KERN_ERR "(%s:%3.3d) ERROR: Can't find "
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c
index 9411640..b4a6ad8 100644
--- a/drivers/net/irda/au1k_ir.c
+++ b/drivers/net/irda/au1k_ir.c
@@ -234,8 +234,7 @@ static int au1k_irda_net_init(struct net_device *dev)
goto out2;

/* allocate the data buffers */
- aup->db[0].vaddr =
- (void *)dma_alloc(MAX_BUF_SIZE * 2*NUM_IR_DESC, &temp);
+ aup->db[0].vaddr = dma_alloc(MAX_BUF_SIZE * 2*NUM_IR_DESC, &temp);
if (!aup->db[0].vaddr)
goto out3;

diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 0759c35..9b56b37 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -230,8 +230,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
struct netxen_cmd_buffer *cmd_buf_arr;
struct net_device *netdev = adapter->netdev;

- cmd_buf_arr =
- (struct netxen_cmd_buffer *)vmalloc(TX_BUFF_RINGSIZE(adapter));
+ cmd_buf_arr = vmalloc(TX_BUFF_RINGSIZE(adapter));
if (cmd_buf_arr == NULL) {
printk(KERN_ERR "%s: Failed to allocate cmd buffer ring\n",
netdev->name);
@@ -277,8 +276,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
break;

}
- rds_ring->rx_buf_arr = (struct netxen_rx_buffer *)
- vmalloc(RCV_BUFF_RINGSIZE(rds_ring));
+ rds_ring->rx_buf_arr = vmalloc(RCV_BUFF_RINGSIZE(rds_ring));
if (rds_ring->rx_buf_arr == NULL) {
printk(KERN_ERR "%s: Failed to allocate "
"rx buffer ring %d\n",
diff --git a/drivers/net/skfp/ess.c b/drivers/net/skfp/ess.c
index a85efcf..5ec0413 100644
--- a/drivers/net/skfp/ess.c
+++ b/drivers/net/skfp/ess.c
@@ -133,7 +133,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
/*
* get the resource type
*/
- if (!(p = (void *) sm_to_para(smc,sm,SMT_P0015))) {
+ if (!(p = sm_to_para(smc,sm,SMT_P0015))) {
DB_ESS("ESS: RAF frame error, parameter type not found\n",0,0) ;
return(fs) ;
}
@@ -142,7 +142,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
/*
* get the pointer to the ESS command
*/
- if (!(cmd = (struct smt_p_0016 *) sm_to_para(smc,sm,SMT_P0016))) {
+ if (!(cmd = sm_to_para(smc,sm,SMT_P0016))) {
/*
* error in frame: para ESS command was not found
*/
@@ -177,7 +177,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
if (!local || smc->mib.fddiESSPayload)
return(fs) ;

- p = (void *) sm_to_para(smc,sm,SMT_P0019) ;
+ p = sm_to_para(smc,sm,SMT_P0019) ;
for (i = 0; i < 5; i++) {
if (((struct smt_p_0019 *)p)->alloc_addr.a[i]) {
return(fs) ;
@@ -190,10 +190,10 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
*/
smc->ess.alloc_trans_id = sm->smt_tid ;
DB_ESS("ESS: save Alloc Req Trans ID %lx\n",sm->smt_tid,0);
- p = (void *) sm_to_para(smc,sm,SMT_P320F) ;
+ p = sm_to_para(smc,sm,SMT_P320F) ;
((struct smt_p_320f *)p)->mib_payload =
smc->mib.a[PATH0].fddiPATHSbaPayload ;
- p = (void *) sm_to_para(smc,sm,SMT_P3210) ;
+ p = sm_to_para(smc,sm,SMT_P3210) ;
((struct smt_p_3210 *)p)->mib_overhead =
smc->mib.a[PATH0].fddiPATHSbaOverhead ;
sm->smt_dest = smt_sba_da ;
@@ -248,13 +248,13 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
/*
* Extract message parameters
*/
- p = (void *) sm_to_para(smc,sm,SMT_P320F) ;
+ p = sm_to_para(smc,sm,SMT_P320F) ;
if (!p) {
printk(KERN_ERR "ESS: sm_to_para failed");
return fs;
}
payload = ((struct smt_p_320f *)p)->mib_payload ;
- p = (void *) sm_to_para(smc,sm,SMT_P3210) ;
+ p = sm_to_para(smc,sm,SMT_P3210) ;
if (!p) {
printk(KERN_ERR "ESS: sm_to_para failed");
return fs;
@@ -306,9 +306,9 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
/*
* Extract message queue parameters
*/
- p = (void *) sm_to_para(smc,sm,SMT_P320F) ;
+ p = sm_to_para(smc,sm,SMT_P320F) ;
payload = ((struct smt_p_320f *)p)->mib_payload ;
- p = (void *) sm_to_para(smc,sm,SMT_P3210) ;
+ p = sm_to_para(smc,sm,SMT_P3210) ;
overhead = ((struct smt_p_3210 *)p)->mib_overhead ;

DB_ESSN(2,"ESS: Change Request from %s\n",
@@ -529,7 +529,7 @@ static void ess_send_response(struct s_smc *smc, struct smt_header *sm,
/* set P1A */
chg->cat.para.p_type = SMT_P001A ;
chg->cat.para.p_len = sizeof(struct smt_p_001a) - PARA_LEN ;
- p = (void *) sm_to_para(smc,sm,SMT_P001A) ;
+ p = sm_to_para(smc,sm,SMT_P001A) ;
chg->cat.category = ((struct smt_p_001a *)p)->category ;
}
dump_smt(smc,(struct smt_header *)chg,"RAF") ;
diff --git a/drivers/net/skfp/hwmtm.c b/drivers/net/skfp/hwmtm.c
index d322f1b..1b8d418 100644
--- a/drivers/net/skfp/hwmtm.c
+++ b/drivers/net/skfp/hwmtm.c
@@ -268,8 +268,7 @@ int mac_drv_init(struct s_smc *smc)
/*
* get the required memory for the RxDs and TxDs
*/
- if (!(smc->os.hwm.descr_p = (union s_fp_descr volatile *)
- mac_drv_get_desc_mem(smc,(u_int)
+ if (!(smc->os.hwm.descr_p = mac_drv_get_desc_mem(smc,(u_int)
(RXD_TXD_COUNT+1)*sizeof(struct s_smt_fp_txd)))) {
return(1) ; /* no space the hwm modul can't work */
}
@@ -281,13 +280,13 @@ int mac_drv_init(struct s_smc *smc)
smc->os.hwm.mbuf_pool.mb_start=(SMbuf *)(&smc->os.hwm.mbuf_pool.mb[0]) ;
#else
#ifndef COMMON_MB_POOL
- if (!(smc->os.hwm.mbuf_pool.mb_start = (SMbuf *) mac_drv_get_space(smc,
+ if (!(smc->os.hwm.mbuf_pool.mb_start = mac_drv_get_space(smc,
MAX_MBUF*sizeof(SMbuf)))) {
return(1) ; /* no space the hwm modul can't work */
}
#else
if (!mb_start) {
- if (!(mb_start = (SMbuf *) mac_drv_get_space(smc,
+ if (!(mb_start = mac_drv_get_space(smc,
MAX_MBUF*sizeof(SMbuf)))) {
return(1) ; /* no space the hwm modul can't work */
}
diff --git a/drivers/net/skfp/pmf.c b/drivers/net/skfp/pmf.c
index 79e665e..87613b7 100644
--- a/drivers/net/skfp/pmf.c
+++ b/drivers/net/skfp/pmf.c
@@ -520,7 +520,7 @@ static int smt_authorize(struct s_smc *smc, struct smt_header *sm)
for (i = 0 ; i < 8 && !p[i] ; i++)
;
if (i != 8) {
- pa = (struct smt_para *) sm_to_para(smc,sm,SMT_P_AUTHOR) ;
+ pa = sm_to_para(smc,sm,SMT_P_AUTHOR) ;
if (!pa)
return(1) ;
if (pa->p_len != 8)
@@ -536,7 +536,7 @@ static int smt_check_set_count(struct s_smc *smc, struct smt_header *sm)
struct smt_para *pa ;
struct smt_p_setcount *sc ;

- pa = (struct smt_para *) sm_to_para(smc,sm,SMT_P1035) ;
+ pa = sm_to_para(smc,sm,SMT_P1035) ;
if (pa) {
sc = (struct smt_p_setcount *) pa ;
if ((smc->mib.fddiSMTSetCount.count != sc->count) ||
diff --git a/drivers/net/skfp/smt.c b/drivers/net/skfp/smt.c
index 83d16fe..a4acc6c 100644
--- a/drivers/net/skfp/smt.c
+++ b/drivers/net/skfp/smt.c
@@ -603,8 +603,7 @@ void smt_received_pack(struct s_smc *smc, SMbuf *mb, int fs)
smt_echo_test(smc,0) ;
}
smc->sm.smt_tvu = smt_get_time() ;
- st = (struct smt_p_state *)
- sm_to_para(smc,sm,SMT_P_STATE) ;
+ st = sm_to_para(smc,sm,SMT_P_STATE) ;
if (st) {
smc->mib.m[MAC0].fddiMACUNDA_Flag =
(st->st_dupl_addr & SMT_ST_MY_DUPA) ?
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index d2dfe0a..4de10ce 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -3145,8 +3145,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
/* It is guaranteed that the returned buffer will be at least
* PAGE_SIZE aligned.
*/
- gp->init_block = (struct gem_init_block *)
- pci_alloc_consistent(pdev, sizeof(struct gem_init_block),
+ gp->init_block = pci_alloc_consistent(pdev, sizeof(struct gem_init_block),
&gp->gblock_dvma);
if (!gp->init_block) {
printk(KERN_ERR PFX "Cannot allocate init block, "
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index 4e9bd38..814ea78 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -3091,8 +3091,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
hp->happy_bursts = DMA_BURSTBITS;
#endif

- hp->happy_block = (struct hmeal_init_block *)
- dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &hp->hblock_dvma, GFP_KERNEL);
+ hp->happy_block = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &hp->hblock_dvma, GFP_KERNEL);

err = -ENODEV;
if (!hp->happy_block) {
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index cf25eb4..eb01dd9 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -872,7 +872,7 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
typhoon_inc_tx_index(&txRing->lastWrite, 1);

len = frag->size;
- frag_addr = (void *) page_address(frag->page) +
+ frag_addr = page_address(frag->page) +
frag->page_offset;
skb_dma = pci_map_single(tp->tx_pdev, frag_addr, len,
PCI_DMA_TODEVICE);
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index fb53ef8..58c1dd8 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -2136,7 +2136,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)

for (i = 0; i < nfrags; i++) {
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
- void *addr = (void *)page_address(frag->page) + frag->page_offset;
+ void *addr = page_address(frag->page) + frag->page_offset;

tdinfo->skb_dma[i + 1] = pci_map_single(vptr->pdev, addr, frag->size, PCI_DMA_TODEVICE);

diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index 8face5d..83a9489 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -771,7 +771,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,
}
/* Global interrupt queue */
writel((u32)(((IRQ_RING_SIZE >> 5) - 1) << 20), ioaddr + IQLENR1);
- priv->iqcfg = (__le32 *) pci_alloc_consistent(pdev,
+ priv->iqcfg = pci_alloc_consistent(pdev,
IRQ_RING_SIZE*sizeof(__le32), &priv->iqcfg_dma);
if (!priv->iqcfg)
goto err_free_irq_5;
@@ -785,7 +785,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,
*/
for (i = 0; i < dev_per_card; i++) {
dpriv = priv->root + i;
- dpriv->iqtx = (__le32 *) pci_alloc_consistent(pdev,
+ dpriv->iqtx = pci_alloc_consistent(pdev,
IRQ_RING_SIZE*sizeof(u32), &dpriv->iqtx_dma);
if (!dpriv->iqtx)
goto err_free_iqtx_6;
@@ -793,7 +793,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,
}
for (i = 0; i < dev_per_card; i++) {
dpriv = priv->root + i;
- dpriv->iqrx = (__le32 *) pci_alloc_consistent(pdev,
+ dpriv->iqrx = pci_alloc_consistent(pdev,
IRQ_RING_SIZE*sizeof(u32), &dpriv->iqrx_dma);
if (!dpriv->iqrx)
goto err_free_iqrx_7;
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 97e5647..71335a8 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -4301,8 +4301,7 @@ static int status_queue_allocate(struct ipw2100_priv *priv, int entries)
IPW_DEBUG_INFO("enter\n");

q->size = entries * sizeof(struct ipw2100_status);
- q->drv =
- (struct ipw2100_status *)pci_alloc_consistent(priv->pci_dev,
+ q->drv = pci_alloc_consistent(priv->pci_dev,
q->size, &q->nic);
if (!q->drv) {
IPW_DEBUG_WARNING("Can not allocate status queue.\n");
--
1.5.4.3

2009-04-08 11:56:16

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 05/56] block: Remove void casts

On Wed, Apr 8, 2009 at 13:21, Jack Stone <[email protected]> wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>  drivers/block/amiflop.c    |    2 +-
>  drivers/block/cciss.c      |   11 ++++-------
>  drivers/block/cciss_scsi.c |    3 +--
>  drivers/block/cpqarray.c   |    2 +-
>  drivers/block/sx8.c        |    2 +-
>  drivers/block/viodasd.c    |    3 +--
>  6 files changed, 9 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
> index 8df436f..702667b 100644
> --- a/drivers/block/amiflop.c
> +++ b/drivers/block/amiflop.c
> @@ -1727,7 +1727,7 @@ static int __init amiga_floppy_init(void)
>        }
>
>        ret = -ENOMEM;
> -       if ((raw_buf = (char *)amiga_chip_alloc (RAW_BUF_SIZE, "Floppy")) ==
> +       if ((raw_buf = amiga_chip_alloc (RAW_BUF_SIZE, "Floppy")) ==
^
Could you feed the patches through checkpatch.pl to find and fix these
style issues.

>            NULL) {
This line could be fit now at the previous line.


>                printk("fd: cannot get chip mem buffer\n");
>                goto out_memregion;
> diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
> index 0ef6f08..0c4747a 100644
> --- a/drivers/block/cciss.c
> +++ b/drivers/block/cciss.c
> @@ -452,7 +452,7 @@ static CommandList_struct *cmd_alloc(ctlr_info_t *h, int get_from_pool)
>        dma_addr_t cmd_dma_handle, err_dma_handle;
>
>        if (!get_from_pool) {
> -               c = (CommandList_struct *) pci_alloc_consistent(h->pdev,
> +               c = pci_alloc_consistent(h->pdev,
>                        sizeof(CommandList_struct), &cmd_dma_handle);
If typeof(c) == CommandList_struct*, that you could replace
sizeof(CommandList_struct) with sizeof(*c) to make the expression
shorter and fit into one line.

Bert

2009-04-08 11:58:56

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 18/56] isdn: Remove void casts

On Wed, Apr 8, 2009 at 13:21, Jack Stone <[email protected]> wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>  drivers/isdn/hardware/eicon/capifunc.c  |    2 +-
>  drivers/isdn/hardware/eicon/diddfunc.c  |    2 +-
>  drivers/isdn/hardware/eicon/divasfunc.c |    2 +-
>  drivers/isdn/hardware/eicon/divasi.c    |   27 ++++++++-------------------
>  drivers/isdn/hardware/eicon/idifunc.c   |    2 +-
>  drivers/isdn/hardware/eicon/mntfunc.c   |    2 +-
>  drivers/isdn/hardware/eicon/s_4bri.c    |    2 +-
>  drivers/isdn/hardware/eicon/um_idi.c    |    7 ++-----
>  8 files changed, 16 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/isdn/hardware/eicon/divasi.c b/drivers/isdn/hardware/eicon/divasi.c
> index 69e71eb..9021581 100644
> --- a/drivers/isdn/hardware/eicon/divasi.c
> +++ b/drivers/isdn/hardware/eicon/divasi.c
> @@ -238,8 +238,7 @@ um_idi_read(struct file *file, char __user *buf, size_t count, loff_t * offset)
>        }
>
>        if (!
> -           (p_os =
> -            (diva_um_idi_os_context_t *) diva_um_id_get_os_context(file->
> +           (p_os = diva_um_id_get_os_context(file->
>                                                                    private_data)))
Move this line up.

>        {
And this brace too (or remove the brace all together, because its one
line statement body).

>                return (-ENODEV);
> @@ -329,8 +328,7 @@ um_idi_write(struct file *file, const char __user *buf, size_t count,
>                        return (-ENODEV);
>        }
>
> -       if (!(p_os =
> -            (diva_um_idi_os_context_t *) diva_um_id_get_os_context(file->
> +       if (!(p_os = diva_um_id_get_os_context(file->
>                                                                    private_data)))
Dito.

>        {
Dito.

>                return (-ENODEV);

Bert

2009-04-08 11:59:58

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 05/56] block: Remove void casts

Bert Wesarg wrote:
> Could you feed the patches through checkpatch.pl to find and fix these
> style issues.
>
> (...)
>
> If typeof(c) == CommandList_struct*, that you could replace
> sizeof(CommandList_struct) with sizeof(*c) to make the expression
> shorter and fit into one line.
>
I was trying to avoid any changes beyond removing the void casts.

I can go through and fix all these if people don't think thats too much to
review in one go.

I'll fix the line issues you've flagged up and resend the affected patched.

Thanks,

Jack

2009-04-08 12:00:58

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 20/56] inflate: Remove void casts

On Wed, Apr 8, 2009 at 13:21, Jack Stone <[email protected]> wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>  lib/inflate.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/inflate.c b/lib/inflate.c
> index 1a8e8a9..4b672f9 100644
> --- a/lib/inflate.c
> +++ b/lib/inflate.c
> @@ -249,7 +249,7 @@ static void *malloc(int size)
>
>        malloc_ptr = (malloc_ptr + 3) & ~3;     /* Align */
>
> -       p = (void *)malloc_ptr;
> +       p = malloc_ptr;
>        malloc_ptr += size;
>
>        if (free_mem_end_ptr && malloc_ptr >= free_mem_end_ptr)
> @@ -481,7 +481,7 @@ DEBG1("3 ");
>         z = 1 << j;             /* table entries for j-bit table */
>
>         /* allocate and link in new table */
> -        if ((q = (struct huft *)malloc((z + 1)*sizeof(struct huft))) ==
> +        if ((q = malloc((z + 1)*sizeof(struct huft))) ==
>             (struct huft *)NULL)
Thats an unneeded cast too. (After that, the NULL can move up one line.)

Bert
>         {
>           if (h)

2009-04-08 12:02:58

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 22/56] message/fusion: Remove void casts

On Wed, Apr 8, 2009 at 13:21, Jack Stone <[email protected]> wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>  drivers/message/fusion/mptbase.c |    6 +++---
>  drivers/message/fusion/mptctl.c  |    4 ++--
>  drivers/message/fusion/mptfc.c   |    4 ++--
>  3 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
> index c638171..fbcd791 100644
> --- a/drivers/message/fusion/mptctl.c
> +++ b/drivers/message/fusion/mptctl.c
> @@ -2667,7 +2667,7 @@ mptctl_hp_targetinfo(unsigned long arg)
>                /* Issue the second config page request */
>                cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
>                data_sz = (int) cfg.cfghdr.hdr->PageLength * 4;
> -               pg3_alloc = (SCSIDevicePage3_t *) pci_alloc_consistent(
> +               pg3_alloc = pci_alloc_consistent(
>                                                        ioc->pcidev, data_sz, &page_dma);
Dito. (Sorry for being lazy in typing from this point up).

>                if (pg3_alloc) {
>                        cfg.physAddr = page_dma;
> diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
> index c3c24fd..d22acfd 100644
> --- a/drivers/message/fusion/mptfc.c
> +++ b/drivers/message/fusion/mptfc.c
> @@ -766,7 +766,7 @@ mptfc_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)
>
>        data_sz = hdr.PageLength * 4;
>        rc = -ENOMEM;
> -       ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
> +       ppage0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
>        if (ppage0_alloc) {
>
>  try_again:
> @@ -907,7 +907,7 @@ start_over:
>                if (data_sz < sizeof(FCPortPage1_t))
>                        data_sz = sizeof(FCPortPage1_t);
>
> -               page1_alloc = (FCPortPage1_t *) pci_alloc_consistent(ioc->pcidev,
> +               page1_alloc = pci_alloc_consistent(ioc->pcidev,
>                                                data_sz,
>                                                &page1_dma);
Please check.

>                if (!page1_alloc)

Bert

2009-04-08 12:03:34

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 05/56] block: Remove void casts

On Wed, Apr 8, 2009 at 13:38, Jack Stone <[email protected]> wrote:
> Bert Wesarg wrote:
>> Could you feed the patches through checkpatch.pl to find and fix these
>> style issues.
>>
>> (...)
>>
>> If typeof(c) == CommandList_struct*, that you could replace
>> sizeof(CommandList_struct) with sizeof(*c) to make the expression
>> shorter and fit into one line.
>>
> I was trying to avoid any changes beyond removing the void casts.
>
> I can go through and fix all these if people don't think thats too much to
> review in one go.
Right, thats a balancing act, and I think this change could be too much.

>
> I'll fix the line issues you've flagged up and resend the affected patched.
>

Bert
> Thanks,
>
> Jack
>

2009-04-08 12:05:44

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 45/56] scsi: Remove void casts

On Wed, Apr 8, 2009 at 13:22, Jack Stone <[email protected]> wrote:> Remove uneeded void casts>> Signed-Off-By: Jack Stone <[email protected]>> --->  drivers/scsi/aic7xxx/aic79xx_core.c         |    4 ++-->  drivers/scsi/aic7xxx/aic7xxx_core.c         |    7 +++---->  drivers/scsi/aic7xxx/aicasm/aicasm.c        |   10 +++++----->  drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c |    4 ++-->  drivers/scsi/aic7xxx_old.c                  |    3 +-->  drivers/scsi/ibmvscsi/ibmvscsi.c            |    3 +-->  drivers/scsi/ibmvscsi/ibmvstgt.c            |    2 +->  drivers/scsi/lpfc/lpfc_hbadisc.c            |    3 +-->  drivers/scsi/lpfc/lpfc_init.c               |    4 ++-->  drivers/scsi/lpfc/lpfc_nportdisc.c          |    4 ++-->  drivers/scsi/lpfc/lpfc_sli.c                |    8 ++++---->  drivers/scsi/osst.c                         |    6 +++--->  drivers/scsi/scsi_debug.c                   |    2 +->  13 files changed, 28 insertions(+), 32 deletions(-)>> diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c> index 63b521d..01f6d6f 100644> --- a/drivers/scsi/aic7xxx/aic79xx_core.c> +++ b/drivers/scsi/aic7xxx/aic79xx_core.c> @@ -6932,12 +6932,12 @@ ahd_alloc_scbs(struct ahd_softc *ahd)>                int error;>  #endif>> -               next_scb = (struct scb *)malloc(sizeof(*next_scb),> +               next_scb = malloc(sizeof(*next_scb),>                                                M_DEVBUF, M_NOWAIT);Dito.
>                if (next_scb == NULL)>                        break;>> -               pdata = (struct scb_platform_data *)malloc(sizeof(*pdata),> +               pdata = malloc(sizeof(*pdata),>                                                           M_DEVBUF, M_NOWAIT);Dito.
>                if (pdata == NULL) {>                        free(next_scb, M_DEVBUF);> diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c> index e6f2bb7..a46800d 100644> --- a/drivers/scsi/aic7xxx/aic7xxx_core.c> +++ b/drivers/scsi/aic7xxx/aic7xxx_core.c> @@ -2152,7 +2152,7 @@ ahc_alloc_tstate(struct ahc_softc *ahc, u_int scsi_id, char channel)>         && ahc->enabled_targets[scsi_id] != master_tstate)>                panic("%s: ahc_alloc_tstate - Target already allocated",>                      ahc_name(ahc));> -       tstate = (struct ahc_tmode_tstate*)malloc(sizeof(*tstate),> +       tstate = malloc(sizeof(*tstate),>                                                   M_DEVBUF, M_NOWAIT);Dito.
>        if (tstate == NULL)>                return (NULL);> @@ -5014,7 +5013,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc)>  #ifndef __linux__>                int error;>  #endif> -               pdata = (struct scb_platform_data *)malloc(sizeof(*pdata),> +               pdata = malloc(sizeof(*pdata),>                                                           M_DEVBUF, M_NOWAIT);Dito.
>                if (pdata == NULL)>                        break;> diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c> index e2dd6a4..8d52a03 100644> --- a/drivers/scsi/ibmvscsi/ibmvstgt.c> +++ b/drivers/scsi/ibmvscsi/ibmvstgt.c> @@ -852,7 +852,7 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id)>        if (err)>                goto put_host;>> -       dma = (unsigned int *) vio_get_attribute(dev, "ibm,my-dma-window",> +       dma = vio_get_attribute(dev, "ibm,my-dma-window",>                                                 &dma_size);Dito.
>        if (!dma || dma_size != 40) {>                eprintk("Couldn't get window property %d\n", dma_size);
Bert????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?Ý¢j"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2009-04-08 12:13:41

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 51/56] sysv: Remove void casts

On Wed, Apr 8, 2009 at 13:22, Jack Stone <[email protected]> wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>  fs/sysv/dir.c |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c
> index 56f6552..8a9f5a7 100644
> --- a/fs/sysv/dir.c
> +++ b/fs/sysv/dir.c
> @@ -367,7 +367,7 @@ struct sysv_dir_entry * sysv_dotdot (struct inode *dir, struct page **p)
>        struct sysv_dir_entry *de = NULL;
>
>        if (!IS_ERR(page)) {
> -               de = (struct sysv_dir_entry*) page_address(page) + 1;
> +               de = page_address(page) + 1;
This is probably wrong, because (void* + 1) != (struct sysv_dir_entry* + 1).

>                *p = page;
>        }
>        return de;
> --

Bert

2009-04-08 12:14:19

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 51/56] sysv: Remove void casts

On Wed, Apr 8, 2009 at 14:02, Bert Wesarg <[email protected]> wrote:
> On Wed, Apr 8, 2009 at 13:22, Jack Stone <[email protected]> wrote:
>> Remove uneeded void casts
>>
>> Signed-Off-By: Jack Stone <[email protected]>
>> ---
>>  fs/sysv/dir.c |   14 +++++++-------
>>  1 files changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c
>> index 56f6552..8a9f5a7 100644
>> --- a/fs/sysv/dir.c
>> +++ b/fs/sysv/dir.c
>> @@ -367,7 +367,7 @@ struct sysv_dir_entry * sysv_dotdot (struct inode *dir, struct page **p)
>>        struct sysv_dir_entry *de = NULL;
>>
>>        if (!IS_ERR(page)) {
>> -               de = (struct sysv_dir_entry*) page_address(page) + 1;
>> +               de = page_address(page) + 1;
> This is probably wrong, because (void* + 1) != (struct sysv_dir_entry* + 1).
>
Yeah, with this in mind I need to check all your patches again ;-)

>>                *p = page;
>>        }
>>        return de;
>> --
>
> Bert
>

2009-04-08 12:15:47

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 51/56] sysv: Remove void casts

Bert Wesarg wrote:
> Yeah, with this in mind I need to check all your patches again ;-)
>
Thanks for the review. Not the most interesting series I know. I'll have
a look
through myself.

Jack

2009-04-08 12:16:22

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 50/56] drivers/staging: Remove void casts

On Wed, Apr 8, 2009 at 13:22, Jack Stone <[email protected]> wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>  drivers/staging/altpciechdma/altpciechdma.c |    4 ++--
>  drivers/staging/epl/EplApiLinuxKernel.c     |    8 ++------
>  drivers/staging/et131x/et1310_rx.c          |    2 +-
>  drivers/staging/rtl8187se/r8180_core.c      |   10 +++++-----
>  drivers/staging/slicoss/slicoss.c           |    3 +--
>  5 files changed, 11 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/staging/et131x/et1310_rx.c b/drivers/staging/et131x/et1310_rx.c
> index 8dc559a..4b1ace6 100644
> --- a/drivers/staging/et131x/et1310_rx.c
> +++ b/drivers/staging/et131x/et1310_rx.c
> @@ -610,7 +610,7 @@ int et131x_init_recv(struct et131x_adapter *adapter)
>
>        /* Setup each RFD */
>        for (RfdCount = 0; RfdCount < rx_ring->NumRfd; RfdCount++) {
> -               pMpRfd = (MP_RFD *) kmem_cache_alloc(rx_ring->RecvLookaside,
> +               pMpRfd = kmem_cache_alloc(rx_ring->RecvLookaside,
>                                                     GFP_ATOMIC | GFP_DMA);
Probably realign this the the opening parentheses, like before.

>
>                if (!pMpRfd) {
> diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c
> index 6ecd12d..6223371 100644
> --- a/drivers/staging/rtl8187se/r8180_core.c
> +++ b/drivers/staging/rtl8187se/r8180_core.c
> @@ -1727,7 +1727,7 @@ short alloc_tx_desc_ring(struct net_device *dev, int bufsize, int count,
>                DMESGE ("TX buffer allocation too large");
>                return 0;
>        }
> -       desc = (u32*)pci_alloc_consistent(pdev,
> +       desc = pci_alloc_consistent(pdev,
>                                          sizeof(u32)*8*count+256, &dma_desc);
Please check.

>        if(desc==NULL) return -1;
>        if(dma_desc & 0xff){
> @@ -1975,7 +1975,7 @@ short alloc_rx_desc_ring(struct net_device *dev, u16 bufsize, int count)
>                return -1;
>        }
>
> -       desc = (u32*)pci_alloc_consistent(pdev,sizeof(u32)*rx_desc_size*count+256,
> +       desc = pci_alloc_consistent(pdev,sizeof(u32)*rx_desc_size*count+256,
>                                          &dma_desc);
Probably realign argument.

>
>        if(dma_desc & 0xff){

Bert

2009-04-08 12:16:46

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 53/56] usb: Remove void casts

On Wed, Apr 8, 2009 at 13:22, Jack Stone <[email protected]> wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>  drivers/usb/host/ehci-dbg.c |    2 +-
>  drivers/usb/host/ehci-mem.c |    6 ++----
>  2 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c
> index 10d5291..c128491 100644
> --- a/drivers/usb/host/ehci-mem.c
> +++ b/drivers/usb/host/ehci-mem.c
> @@ -212,8 +211,7 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags)
>        }
>
>        /* Hardware periodic table */
> -       ehci->periodic = (__le32 *)
> -               dma_alloc_coherent (ehci_to_hcd(ehci)->self.controller,
> +       ehci->periodic = dma_alloc_coherent (ehci_to_hcd(ehci)->self.controller,
Hmm, I would leave this in, because of the big endian/little endian
annotation. Else sparse (the static semantic checker) could complain.


>                        ehci->periodic_size * sizeof(__le32),
>                        &ehci->periodic_dma, 0);
>        if (ehci->periodic == NULL) {

Bert

2009-04-08 12:17:18

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 56/56] xfs: Remove void casts

On Wed, Apr 8, 2009 at 13:22, Jack Stone <[email protected]> wrote:> Remove uneeded void casts>> Signed-Off-By: Jack Stone <[email protected]>> --->  fs/xfs/quota/xfs_dquot_item.c |    2 +->  fs/xfs/support/ktrace.c       |    6 +++--->  fs/xfs/xfs_attr_leaf.c        |    2 +->  fs/xfs/xfs_buf_item.c         |    6 +++--->  fs/xfs/xfs_extfree_item.c     |    8 ++++---->  fs/xfs/xfs_inode.c            |    5 ++--->  fs/xfs/xfs_log_recover.c      |    9 ++++----->  fs/xfs/xfs_trans.c            |    2 +->  fs/xfs/xfs_trans_inode.c      |    3 +-->  fs/xfs/xfs_trans_item.c       |    6 ++---->  10 files changed, 22 insertions(+), 27 deletions(-)>> diff --git a/fs/xfs/support/ktrace.c b/fs/xfs/support/ktrace.c> index 2d494c2..3982acf 100644> --- a/fs/xfs/support/ktrace.c> +++ b/fs/xfs/support/ktrace.c> @@ -75,10 +75,10 @@ ktrace_alloc(int nentries, unsigned int __nocast sleep)>         */>        entries = roundup_pow_of_two(nentries);>        if (entries == ktrace_zentries) {> -               ktep = (ktrace_entry_t*)kmem_zone_zalloc(ktrace_ent_zone,> +               ktep = kmem_zone_zalloc(ktrace_ent_zone,>                                                            sleep);Dito.
>        } else {> -               ktep = (ktrace_entry_t*)kmem_zalloc((entries * sizeof(*ktep)),> +               ktep = kmem_zalloc((entries * sizeof(*ktep)),>                                                            sleep | KM_LARGE);Please check.
>        }>> diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c> index 92af409..431755a 100644> --- a/fs/xfs/xfs_buf_item.c> +++ b/fs/xfs/xfs_buf_item.c> @@ -726,7 +726,7 @@ xfs_buf_item_init(>        chunks = (int)((XFS_BUF_COUNT(bp) + (XFS_BLI_CHUNK - 1)) >> XFS_BLI_SHIFT);>        map_size = (int)((chunks + NBWORD) >> BIT_TO_WORD_SHIFT);>> -       bip = (xfs_buf_log_item_t*)kmem_zone_zalloc(xfs_buf_item_zone,> +       bip = kmem_zone_zalloc(xfs_buf_item_zone,>                                                    KM_SLEEP);Dito.
>        bip->bli_item.li_type = XFS_LI_BUF;>        bip->bli_item.li_ops = &xfs_buf_item_ops;> diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c> index 05a4bdd..53ccdc4 100644> --- a/fs/xfs/xfs_extfree_item.c> +++ b/fs/xfs/xfs_extfree_item.c> @@ -253,9 +253,9 @@ xfs_efi_init(xfs_mount_t    *mp,>        if (nextents > XFS_EFI_MAX_FAST_EXTENTS) {>                size = (uint)(sizeof(xfs_efi_log_item_t) +>                        ((nextents - 1) * sizeof(xfs_extent_t)));> -               efip = (xfs_efi_log_item_t*)kmem_zalloc(size, KM_SLEEP);> +               efip = kmem_zalloc(size, KM_SLEEP);>        } else {> -               efip = (xfs_efi_log_item_t*)kmem_zone_zalloc(xfs_efi_zone,> +               efip = kmem_zone_zalloc(xfs_efi_zone,>                                                             KM_SLEEP);Dito.
>        }>> @@ -548,9 +548,9 @@ xfs_efd_init(xfs_mount_t    *mp,>        if (nextents > XFS_EFD_MAX_FAST_EXTENTS) {>                size = (uint)(sizeof(xfs_efd_log_item_t) +>                        ((nextents - 1) * sizeof(xfs_extent_t)));> -               efdp = (xfs_efd_log_item_t*)kmem_zalloc(size, KM_SLEEP);> +               efdp = kmem_zalloc(size, KM_SLEEP);>        } else {> -               efdp = (xfs_efd_log_item_t*)kmem_zone_zalloc(xfs_efd_zone,> +               efdp = kmem_zone_zalloc(xfs_efd_zone,>                                                             KM_SLEEP);Dito.
>        }>> diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c> index 7ba4501..3037920 100644> --- a/fs/xfs/xfs_log_recover.c> +++ b/fs/xfs/xfs_log_recover.c> @@ -1670,7 +1670,7 @@ xlog_recover_do_buffer_pass1(>         * the bucket.>         */>        if (*bucket == NULL) {> -               bcp = (xfs_buf_cancel_t *)kmem_alloc(sizeof(xfs_buf_cancel_t),> +               bcp = kmem_alloc(sizeof(xfs_buf_cancel_t),>                                                     KM_SLEEP);Dito.
>                bcp->bc_blkno = blkno;>                bcp->bc_len = len;> @@ -1696,7 +1696,7 @@ xlog_recover_do_buffer_pass1(>                nextp = nextp->bc_next;>        }>        ASSERT(prevp != NULL);> -       bcp = (xfs_buf_cancel_t *)kmem_alloc(sizeof(xfs_buf_cancel_t),> +       bcp = kmem_alloc(sizeof(xfs_buf_cancel_t),>                                             KM_SLEEP);Dito.
>        bcp->bc_blkno = blkno;>        bcp->bc_len = len;> @@ -2316,7 +2316,7 @@ xlog_recover_do_inode_trans(>        if (item->ri_buf[0].i_len == sizeof(xfs_inode_log_format_t)) {>                in_f = (xfs_inode_log_format_t *)item->ri_buf[0].i_addr;>        } else {> -               in_f = (xfs_inode_log_format_t *)kmem_alloc(> +               in_f = kmem_alloc(>                        sizeof(xfs_inode_log_format_t), KM_SLEEP);Please check.
>                need_free = 1;>                error = xfs_inode_item_format_convert(&item->ri_buf[0], in_f);> diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c> index 8570b82..44d039d 100644> --- a/fs/xfs/xfs_trans.c> +++ b/fs/xfs/xfs_trans.c> @@ -868,7 +868,7 @@ shut_us_down:>        } else if (nvec <= XFS_TRANS_LOGVEC_COUNT) {>                log_vector = log_vector_fast;>        } else {> -               log_vector = (xfs_log_iovec_t *)kmem_alloc(nvec *> +               log_vector = kmem_alloc(nvec *>                                                   sizeof(xfs_log_iovec_t),Move up.
>                                                   KM_SLEEP);Probably realign.
>        }> --
Bert????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?Ý¢j"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2009-04-08 12:18:31

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts

On Wed, Apr 8, 2009 at 13:22, Jack Stone <[email protected]> wrote:> Remove uneeded void casts>> Signed-Off-By: Jack Stone <[email protected]>> --->  arch/x86/kernel/machine_kexec_64.c |    8 ++++---->  arch/x86/kernel/microcode_amd.c    |    2 +->  arch/x86/mm/fault.c                |    2 +->  arch/x86/mm/init_32.c              |    4 ++-->  arch/x86/mm/init_64.c              |   10 +++++----->  arch/x86/mm/pageattr.c             |    4 ++-->  6 files changed, 15 insertions(+), 15 deletions(-)>> diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c> index a03b727..025e4ac 100644> --- a/arch/x86/mm/fault.c> +++ b/arch/x86/mm/fault.c> @@ -368,7 +368,7 @@ void vmalloc_sync_all(void)>                spin_lock_irqsave(&pgd_lock, flags);>                list_for_each_entry(page, &pgd_list, lru) {>                        pgd_t *pgd;> -                       pgd = (pgd_t *)page_address(page) + pgd_index(address);> +                       pgd = page_address(page) + pgd_index(address);Probably wrong again because of math.
>                        if (pgd_none(*pgd))>                                set_pgd(pgd, *pgd_ref);>                        else> diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c> index d71e1b6..55d3c7c 100644> --- a/arch/x86/mm/pageattr.c> +++ b/arch/x86/mm/pageattr.c> @@ -343,7 +343,7 @@ static void __set_pmd_pte(pte_t *kpte, unsigned long address, pte_t pte)>                        pud_t *pud;>                        pmd_t *pmd;>> -                       pgd = (pgd_t *)page_address(page) + pgd_index(address);> +                       pgd = page_address(page) + pgd_index(address);Probably wrong again because of math.
>                        pud = pud_offset(pgd, address);>                        pmd = pmd_offset(pud, address);>                        set_pte_atomic((pte_t *)pmd, pte);> --Bert????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?Ý¢j"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2009-04-08 12:20:11

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 36/56] ocfs2: Remove void casts

On Wed, Apr 8, 2009 at 13:22, Jack Stone <[email protected]> wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>  fs/ocfs2/dlm/dlmmaster.c |   10 ++++------
>  1 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
> index f8b653f..e4c2f5b 100644
> --- a/fs/ocfs2/dlm/dlmmaster.c
> +++ b/fs/ocfs2/dlm/dlmmaster.c
> @@ -2455,7 +2453,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
>                goto leave;
>        }
>
> -       mle = (struct dlm_master_list_entry *) kmem_cache_alloc(dlm_mle_cache,
> +       mle = kmem_cache_alloc(dlm_mle_cache,
>                                                                GFP_NOFS);
Flag.

>        if (!mle) {
>                mlog_errno(ret);
> @@ -3036,7 +3034,7 @@ int dlm_migrate_request_handler(struct o2net_msg *msg, u32 len, void *data,
>        hash = dlm_lockid_hash(name, namelen);
>
>        /* preallocate.. if this fails, abort */
> -       mle = (struct dlm_master_list_entry *) kmem_cache_alloc(dlm_mle_cache,
> +       mle = kmem_cache_alloc(dlm_mle_cache,
>                                                         GFP_NOFS);
Flag.

>
>        if (!mle) {
> --
Bert

2009-04-08 12:23:20

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 35/56] ntfs: Remove void casts

On Wed, Apr 8, 2009 at 13:22, Jack Stone <[email protected]> wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>  fs/ntfs/compress.c |    2 +-
>  fs/ntfs/dir.c      |    8 ++++----
>  fs/ntfs/index.c    |    2 +-
>  fs/ntfs/logfile.c  |    2 +-
>  fs/ntfs/mft.c      |    4 ++--
>  fs/ntfs/super.c    |    8 ++++----
>  fs/ntfs/usnjrnl.c  |    2 +-
>  7 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/fs/ntfs/compress.c b/fs/ntfs/compress.c
> index 9669541..12297ee 100644
> --- a/fs/ntfs/compress.c
> +++ b/fs/ntfs/compress.c
> @@ -280,7 +280,7 @@ return_error:
>        }
>
>        /* We have a valid destination page. Setup the destination pointers. */
> -       dp_addr = (u8*)page_address(dp) + do_sb_start;
> +       dp_addr = page_address(dp) + do_sb_start;
Pointer arithmetic.

>
>        /* Now, we are ready to process the current sub-block (sb). */
>        if (!(le16_to_cpup((le16*)cb) & NTFS_SB_IS_COMPRESSED)) {
> diff --git a/fs/ntfs/logfile.c b/fs/ntfs/logfile.c
> index d7932e9..b6be7c4 100644
> --- a/fs/ntfs/logfile.c
> +++ b/fs/ntfs/logfile.c
> @@ -549,7 +549,7 @@ bool ntfs_check_logfile(struct inode *log_vi, RESTART_PAGE_HEADER **rp)
>                                goto err_out;
>                        }
>                }
> -               kaddr = (u8*)page_address(page) + (pos & ~PAGE_CACHE_MASK);
> +               kaddr = page_address(page) + (pos & ~PAGE_CACHE_MASK);
Pointer arithmetic.

>                /*
>                 * A non-empty block means the logfile is not empty while an
>                 * empty block after a non-empty block has been encountered
> diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c
> index 23bf684..552f91b 100644
> --- a/fs/ntfs/mft.c
> +++ b/fs/ntfs/mft.c
> @@ -1196,7 +1196,7 @@ static int ntfs_mft_bitmap_find_and_alloc_free_rec_nolock(ntfs_volume *vol,
>                                                "bitmap, aborting.");
>                                return PTR_ERR(page);
>                        }
> -                       buf = (u8*)page_address(page) + page_ofs;
> +                       buf = page_address(page) + page_ofs;
Pointer arithmetic.

>                        bit = data_pos & 7;
>                        data_pos &= ~7ull;
>                        ntfs_debug("Before inner for loop: size 0x%x, "
> @@ -1334,7 +1334,7 @@ static int ntfs_mft_bitmap_extend_allocation_nolock(ntfs_volume *vol)
>                ntfs_error(vol->sb, "Failed to read from lcn bitmap.");
>                return PTR_ERR(page);
>        }
> -       b = (u8*)page_address(page) + (ll & ~PAGE_CACHE_MASK);
> +       b = page_address(page) + (ll & ~PAGE_CACHE_MASK);
Pointer arithmetic.

>        tb = 1 << (lcn & 7ull);
>        down_write(&vol->lcnbmp_lock);
>        if (*b != 0xff && !(*b & tb)) {
> --
Bert

2009-04-08 12:30:47

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 30/56] net: Remove void casts

On Wed, Apr 8, 2009 at 13:22, Jack Stone <[email protected]> wrote:> Remove uneeded void casts>> Signed-Off-By: Jack Stone <[email protected]>> --->  drivers/net/arm/at91_ether.c           |    2 +->  drivers/net/cassini.c                  |    3 +-->  drivers/net/fs_enet/mac-fcc.c          |    2 +->  drivers/net/fs_enet/mac-fec.c          |    2 +->  drivers/net/fs_enet/mac-scc.c          |    3 +-->  drivers/net/gianfar.c                  |    2 +->  drivers/net/ibmveth.c                  |    4 ++-->  drivers/net/irda/au1k_ir.c             |    3 +-->  drivers/net/netxen/netxen_nic_init.c   |    6 ++---->  drivers/net/skfp/ess.c                 |   20 ++++++++++---------->  drivers/net/skfp/hwmtm.c               |    7 +++---->  drivers/net/skfp/pmf.c                 |    4 ++-->  drivers/net/skfp/smt.c                 |    3 +-->  drivers/net/sungem.c                   |    3 +-->  drivers/net/sunhme.c                   |    3 +-->  drivers/net/typhoon.c                  |    2 +->  drivers/net/via-velocity.c             |    2 +->  drivers/net/wan/dscc4.c                |    6 +++--->  drivers/net/wireless/ipw2x00/ipw2100.c |    3 +-->  19 files changed, 35 insertions(+), 45 deletions(-)>> diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c> index 5c6315d..d3c58fe 100644> --- a/drivers/net/ibmveth.c> +++ b/drivers/net/ibmveth.c> @@ -1218,7 +1218,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_>        ibmveth_debug_printk_no_adapter("entering ibmveth_probe for UA 0x%x\n",>                                        dev->unit_address);>> -       mac_addr_p = (unsigned char *) vio_get_attribute(dev,> +       mac_addr_p = vio_get_attribute(dev,>                                                VETH_MAC_ADDR, NULL);Please check.
>        if(!mac_addr_p) {>                printk(KERN_ERR "(%s:%3.3d) ERROR: Can't find VETH_MAC_ADDR "> @@ -1226,7 +1226,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_>                return 0;>        }>> -       mcastFilterSize_p = (unsigned int *) vio_get_attribute(dev,> +       mcastFilterSize_p = vio_get_attribute(dev,>                                                VETH_MCAST_FILTER_SIZE, NULL);Please check.
>        if(!mcastFilterSize_p) {>                printk(KERN_ERR "(%s:%3.3d) ERROR: Can't find "> diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c> index cf25eb4..eb01dd9 100644> --- a/drivers/net/typhoon.c> +++ b/drivers/net/typhoon.c> @@ -872,7 +872,7 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)>                        typhoon_inc_tx_index(&txRing->lastWrite, 1);>>                        len = frag->size;> -                       frag_addr = (void *) page_address(frag->page) +> +                       frag_addr = page_address(frag->page) +>                                                frag->page_offset;I think this cast was intentional too, because of the pointer arithmetic.
>                        skb_dma = pci_map_single(tp->tx_pdev, frag_addr, len,>                                         PCI_DMA_TODEVICE);> diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c> index fb53ef8..58c1dd8 100644> --- a/drivers/net/via-velocity.c> +++ b/drivers/net/via-velocity.c> @@ -2136,7 +2136,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)>>                        for (i = 0; i < nfrags; i++) {>                                skb_frag_t *frag = &skb_shinfo(skb)->frags[i];> -                               void *addr = (void *)page_address(frag->page) + frag->page_offset;> +                               void *addr = page_address(frag->page) + frag->page_offset;Dito.
>>                                tdinfo->skb_dma[i + 1] = pci_map_single(vptr->pdev, addr, frag->size, PCI_DMA_TODEVICE);>> diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c> index 8face5d..83a9489 100644> --- a/drivers/net/wan/dscc4.c> +++ b/drivers/net/wan/dscc4.c> @@ -771,7 +771,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,>        }>        /* Global interrupt queue */>        writel((u32)(((IRQ_RING_SIZE >> 5) - 1) << 20), ioaddr + IQLENR1);> -       priv->iqcfg = (__le32 *) pci_alloc_consistent(pdev,> +       priv->iqcfg = pci_alloc_consistent(pdev,Endian annotations.
>                IRQ_RING_SIZE*sizeof(__le32), &priv->iqcfg_dma);>        if (!priv->iqcfg)>                goto err_free_irq_5;> @@ -785,7 +785,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,>         */>        for (i = 0; i < dev_per_card; i++) {>                dpriv = priv->root + i;> -               dpriv->iqtx = (__le32 *) pci_alloc_consistent(pdev,> +               dpriv->iqtx = pci_alloc_consistent(pdev,Dito.
>                        IRQ_RING_SIZE*sizeof(u32), &dpriv->iqtx_dma);>                if (!dpriv->iqtx)>                        goto err_free_iqtx_6;> @@ -793,7 +793,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,>        }>        for (i = 0; i < dev_per_card; i++) {>                dpriv = priv->root + i;> -               dpriv->iqrx = (__le32 *) pci_alloc_consistent(pdev,> +               dpriv->iqrx = pci_alloc_consistent(pdev,Dito.
>                        IRQ_RING_SIZE*sizeof(u32), &dpriv->iqrx_dma);>                if (!dpriv->iqrx)>                        goto err_free_iqrx_7;> diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c> index 97e5647..71335a8 100644> --- a/drivers/net/wireless/ipw2x00/ipw2100.c> +++ b/drivers/net/wireless/ipw2x00/ipw2100.c> @@ -4301,8 +4301,7 @@ static int status_queue_allocate(struct ipw2100_priv *priv, int entries)>        IPW_DEBUG_INFO("enter\n");>>        q->size = entries * sizeof(struct ipw2100_status);> -       q->drv => -           (struct ipw2100_status *)pci_alloc_consistent(priv->pci_dev,> +       q->drv = pci_alloc_consistent(priv->pci_dev,>                                                          q->size, &q->nic);Please check.
>        if (!q->drv) {>                IPW_DEBUG_WARNING("Can not allocate status queue.\n");> --Bert????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?Ý¢j"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2009-04-08 12:31:26

by Bert Wesarg

[permalink] [raw]
Subject: Re: [PATCH 29/56] irda: Remove void casts

On Wed, Apr 8, 2009 at 13:22, Jack Stone <[email protected]> wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>  net/irda/discovery.c         |    4 ++--
>  net/irda/ircomm/ircomm_lmp.c |    2 +-
>  net/irda/iriap.c             |    2 +-
>  net/irda/irnet/irnet_irda.c  |    2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/net/irda/irnet/irnet_irda.c b/net/irda/irnet/irnet_irda.c
> index cf9a4b5..213f207 100644
> --- a/net/irda/irnet/irnet_irda.c
> +++ b/net/irda/irnet/irnet_irda.c
> @@ -766,7 +766,7 @@ irnet_find_socket(irnet_socket *    self)
>    * requested that nickname */
>   if(err == 0)
>     {
> -      new = (irnet_socket *) hashbin_find(irnet_server.list,
> +      new = hashbin_find(irnet_server.list,
>                                          0, self->rname);
Please check.

>       if(new)
>        DEBUG(IRDA_SERV_INFO, "Socket 0x%p matches rname ``%s''.\n",
> --
Bert

2009-04-08 12:34:30

by Bert Wesarg

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

On Wed, Apr 8, 2009 at 13:21, Jack Stone <[email protected]> wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>  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

2009-04-08 12:36:55

by Jesper Nilsson

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

On Wed, Apr 08, 2009 at 01:21:40PM +0200, Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>


Thanks, I'm adding the following patch to the CRIS tree:


From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-off-by: Jack Stone <[email protected]>
Signed-off-by: Jesper Nilsson <[email protected]>

--
cryptocop.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
index 67c61ea..beb914d 100644
--- a/arch/cris/arch-v32/drivers/cryptocop.c
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -2455,7 +2455,8 @@ 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;
tmplen = PAGE_SIZE - *pageoffset;
if (tmplen < map_length){
(*pageoffset) = 0;
@@ -2780,16 +2781,21 @@ 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);
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);
}

iovlen = nooutpages + 6;

A small nit: If you're going to change stylistic issues please
run it through checkpatch and fix them all.

/^JN - Jesper Nilsson
--
Jesper Nilsson -- [email protected]

2009-04-08 13:36:52

by Jack Stone

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

cris: Remove void casts

From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---

arch/cris/arch-v32/drivers/cryptocop.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
index 67c61ea..f2ffabb 100644
--- a/arch/cris/arch-v32/drivers/cryptocop.c
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -2784,7 +2784,7 @@ static int cryptocop_ioctl_process(struct inode *inode, struct file *filp, unsig
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 {


Attachments:
cris-remove-void-casts (906.00 B)

2009-04-08 13:38:08

by Jesper Nilsson

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

On Wed, Apr 08, 2009 at 02:34:12PM +0200, Bert Wesarg wrote:
> On Wed, Apr 8, 2009 at 13:21, Jack Stone <[email protected]> wrote:
> > Remove uneeded void casts
> >
> > Signed-Off-By: Jack Stone <[email protected]>
> > ---
> > ?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).

Good catch. I think I'll drop the patch for now.

/^JN - Jesper Nilsson
--
Jesper Nilsson -- [email protected]

2009-04-08 13:39:25

by Jack Stone

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

Jesper Nilsson wrote:
> Good catch. I think I'll drop the patch for now
Should be fixed in the respin I just sent

Thanks,

Jack

2009-04-08 13:50:21

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 04/56] befs: Remove void casts

Heres the fixed patch

Thanks

Jack

befs: Remove void casts

From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---

fs/befs/linuxvfs.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 76afd0d..e8b56a1 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -277,8 +277,7 @@ static struct inode *
befs_alloc_inode(struct super_block *sb)
{
struct befs_inode_info *bi;
- bi = (struct befs_inode_info *)kmem_cache_alloc(befs_inode_cachep,
- GFP_KERNEL);
+ bi = kmem_cache_alloc(befs_inode_cachep, GFP_KERNEL);
if (!bi)
return NULL;
return &bi->vfs_inode;

2009-04-08 13:51:46

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 06/56] cifs: Remove void casts

Fixed patch

Thanks

Jack

--

cifs: Remove void casts

From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---

fs/cifs/transport.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index 0ad3e2d..86191b0 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -111,8 +111,7 @@ AllocOplockQEntry(struct inode *pinode, __u16 fid,
struct cifsTconInfo *tcon)
cERROR(1, ("Null parms passed to AllocOplockQEntry"));
return NULL;
}
- temp = (struct oplock_q_entry *) kmem_cache_alloc(cifs_oplock_cachep,
- GFP_KERNEL);
+ temp = kmem_cache_alloc(cifs_oplock_cachep, GFP_KERNEL);
if (temp == NULL)
return temp;
else {

2009-04-08 13:53:22

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 18/56] isdn: Remove void casts

Respinned patch

Thanks,

Jack

--

isdn: Remove void casts

From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---

drivers/isdn/hardware/eicon/capifunc.c | 2 +-
drivers/isdn/hardware/eicon/diddfunc.c | 2 +-
drivers/isdn/hardware/eicon/divasfunc.c | 2 +-
drivers/isdn/hardware/eicon/divasi.c | 34
+++++++++----------------------
drivers/isdn/hardware/eicon/idifunc.c | 2 +-
drivers/isdn/hardware/eicon/mntfunc.c | 2 +-
drivers/isdn/hardware/eicon/s_4bri.c | 2 +-
drivers/isdn/hardware/eicon/um_idi.c | 7 ++----
8 files changed, 18 insertions(+), 35 deletions(-)

diff --git a/drivers/isdn/hardware/eicon/capifunc.c
b/drivers/isdn/hardware/eicon/capifunc.c
index 4d425c6..7027547 100644
--- a/drivers/isdn/hardware/eicon/capifunc.c
+++ b/drivers/isdn/hardware/eicon/capifunc.c
@@ -1072,7 +1072,7 @@ static int divacapi_connect_didd(void)
req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc =
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
- req.didd_notify.info.callback = (void *)didd_callback;
+ req.didd_notify.info.callback = didd_callback;
req.didd_notify.info.context = NULL;
DAdapter.request((ENTITY *) & req);
if (req.didd_notify.e.Rc != 0xff) {
diff --git a/drivers/isdn/hardware/eicon/diddfunc.c
b/drivers/isdn/hardware/eicon/diddfunc.c
index 3029234..d97bfba 100644
--- a/drivers/isdn/hardware/eicon/diddfunc.c
+++ b/drivers/isdn/hardware/eicon/diddfunc.c
@@ -63,7 +63,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc =
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
- req.didd_notify.info.callback = (void *)didd_callback;
+ req.didd_notify.info.callback = didd_callback;
req.didd_notify.info.context = NULL;
_DAdapter.request((ENTITY *) & req);
if (req.didd_notify.e.Rc != 0xff)
diff --git a/drivers/isdn/hardware/eicon/divasfunc.c
b/drivers/isdn/hardware/eicon/divasfunc.c
index d36a4c0..2616a22 100644
--- a/drivers/isdn/hardware/eicon/divasfunc.c
+++ b/drivers/isdn/hardware/eicon/divasfunc.c
@@ -170,7 +170,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc =
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
- req.didd_notify.info.callback = (void *)didd_callback;
+ req.didd_notify.info.callback = didd_callback;
req.didd_notify.info.context = NULL;
DAdapter.request((ENTITY *) & req);
if (req.didd_notify.e.Rc != 0xff) {
diff --git a/drivers/isdn/hardware/eicon/divasi.c
b/drivers/isdn/hardware/eicon/divasi.c
index 69e71eb..2510886 100644
--- a/drivers/isdn/hardware/eicon/divasi.c
+++ b/drivers/isdn/hardware/eicon/divasi.c
@@ -237,13 +237,10 @@ um_idi_read(struct file *file, char __user *buf,
size_t count, loff_t * offset)
return (-ENODEV);
}

- if (!
- (p_os =
- (diva_um_idi_os_context_t *) diva_um_id_get_os_context(file->
- private_data)))
- {
+ if (!(p_os = diva_um_id_get_os_context(file-> private_data))) {
return (-ENODEV);
}
+
if (p_os->aborted) {
return (-ENODEV);
}
@@ -296,7 +293,7 @@ static int um_idi_open_adapter(struct file *file,
int adapter_nr)
if (!(file->private_data = e)) {
return (0);
}
- p_os = (diva_um_idi_os_context_t *) diva_um_id_get_os_context(e);
+ p_os = diva_um_id_get_os_context(e);
init_waitqueue_head(&p_os->read_wait);
init_waitqueue_head(&p_os->close_wait);
init_timer(&p_os->diva_timer_id);
@@ -329,12 +326,10 @@ um_idi_write(struct file *file, const char __user
*buf, size_t count,
return (-ENODEV);
}

- if (!(p_os =
- (diva_um_idi_os_context_t *) diva_um_id_get_os_context(file->
- private_data)))
- {
+ if (!(p_os = diva_um_id_get_os_context(file->private_data))) {
return (-ENODEV);
}
+
if (p_os->aborted) {
return (-ENODEV);
}
@@ -374,9 +369,7 @@ static unsigned int um_idi_poll(struct file *file,
poll_table * wait)
return (POLLERR);
}

- if ((!(p_os =
- (diva_um_idi_os_context_t *)
- diva_um_id_get_os_context(file->private_data)))
+ if ((!(p_os = diva_um_id_get_os_context(file->private_data)))
|| p_os->aborted) {
return (POLLERR);
}
@@ -416,8 +409,7 @@ static int um_idi_release(struct inode *inode,
struct file *file)
goto out;
}

- if (!(p_os =
- (diva_um_idi_os_context_t *)
diva_um_id_get_os_context(file->private_data))) {
+ if (!(p_os = diva_um_id_get_os_context(file->private_data))) {
ret = -ENODEV;
goto out;
}
@@ -484,9 +476,7 @@ static int remove_entity(void *entity)
return (0);
}

- if (!(p_os =
- (diva_um_idi_os_context_t *)
- diva_um_id_get_os_context(entity))) {
+ if (!(p_os = diva_um_id_get_os_context(entity))) {
DBG_FTL(("Zero entity os context on remove"))
return (0);
}
@@ -557,9 +547,7 @@ void diva_um_idi_start_wdog(void *entity)
diva_um_idi_os_context_t *p_os;

if (entity &&
- ((p_os =
- (diva_um_idi_os_context_t *)
- diva_um_id_get_os_context(entity)))) {
+ ((p_os = diva_um_id_get_os_context(entity)))) {
mod_timer(&p_os->diva_timer_id, jiffies + 10 * HZ);
}
}
@@ -569,9 +557,7 @@ void diva_um_idi_stop_wdog(void *entity)
diva_um_idi_os_context_t *p_os;

if (entity &&
- ((p_os =
- (diva_um_idi_os_context_t *)
- diva_um_id_get_os_context(entity)))) {
+ ((p_os = diva_um_id_get_os_context(entity)))) {
del_timer(&p_os->diva_timer_id);
}
}
diff --git a/drivers/isdn/hardware/eicon/idifunc.c
b/drivers/isdn/hardware/eicon/idifunc.c
index db87d51..5399cc1 100644
--- a/drivers/isdn/hardware/eicon/idifunc.c
+++ b/drivers/isdn/hardware/eicon/idifunc.c
@@ -197,7 +197,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc =
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
- req.didd_notify.info.callback = (void *)didd_callback;
+ req.didd_notify.info.callback = didd_callback;
req.didd_notify.info.context = NULL;
DAdapter.request((ENTITY *) & req);
if (req.didd_notify.e.Rc != 0xff) {
diff --git a/drivers/isdn/hardware/eicon/mntfunc.c
b/drivers/isdn/hardware/eicon/mntfunc.c
index a564b75..2251662 100644
--- a/drivers/isdn/hardware/eicon/mntfunc.c
+++ b/drivers/isdn/hardware/eicon/mntfunc.c
@@ -88,7 +88,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
req.didd_notify.e.Req = 0;
req.didd_notify.e.Rc =
IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
- req.didd_notify.info.callback = (void *)didd_callback;
+ req.didd_notify.info.callback = didd_callback;
req.didd_notify.info.context = NULL;
DAdapter.request((ENTITY *) & req);
if (req.didd_notify.e.Rc != 0xff)
diff --git a/drivers/isdn/hardware/eicon/s_4bri.c
b/drivers/isdn/hardware/eicon/s_4bri.c
index 25c5d7f..28e8410 100644
--- a/drivers/isdn/hardware/eicon/s_4bri.c
+++ b/drivers/isdn/hardware/eicon/s_4bri.c
@@ -189,7 +189,7 @@ static byte * qBri_check_FPGAsrc (PISDN_ADAPTER
IoAdapter, char *FileName,
char *fpgaFile, *fpgaType, *fpgaDate, *fpgaTime ;
dword fpgaFlen, fpgaTlen, fpgaDlen, cnt, year, i ;

- if (!(File = (byte *)xdiLoadFile (FileName, Length, 0))) {
+ if (!(File = xdiLoadFile (FileName, Length, 0))) {
return (NULL) ;
}
/*
diff --git a/drivers/isdn/hardware/eicon/um_idi.c
b/drivers/isdn/hardware/eicon/um_idi.c
index 6563db9..55eb212 100644
--- a/drivers/isdn/hardware/eicon/um_idi.c
+++ b/drivers/isdn/hardware/eicon/um_idi.c
@@ -679,9 +679,7 @@ static int process_idi_ind(divas_um_idi_entity_t *
e, byte ind)
int do_wakeup = 0;

if (e->e.complete != 0x02) {
- diva_um_idi_ind_hdr_t *pind =
- (diva_um_idi_ind_hdr_t *)
- diva_data_q_get_segment4write(&e->data);
+ diva_um_idi_ind_hdr_t *pind =
diva_data_q_get_segment4write(&e->data);
if (pind) {
e->e.RNum = 1;
e->e.R->P = (byte *) & pind[1];
@@ -734,8 +732,7 @@ static int write_return_code(divas_um_idi_entity_t *
e, byte rc)
{
diva_um_idi_ind_hdr_t *prc;

- if (!(prc =
- (diva_um_idi_ind_hdr_t *) diva_data_q_get_segment4write(&e->rc)))
+ if (!(prc = diva_data_q_get_segment4write(&e->rc)))
{
DBG_ERR(("A: A(%d) E(%08x) rc(%02x) lost",
e->adapter->adapter_nr, e, rc));

2009-04-08 13:54:35

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 20/56] inflate: Remove void casts

Heres the fixed patch

Thanks,

Jack

--

inflate: Remove void casts

From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---

lib/inflate.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/inflate.c b/lib/inflate.c
index 1a8e8a9..1eb0cd8 100644
--- a/lib/inflate.c
+++ b/lib/inflate.c
@@ -249,7 +249,7 @@ static void *malloc(int size)

malloc_ptr = (malloc_ptr + 3) & ~3; /* Align */

- p = (void *)malloc_ptr;
+ p = malloc_ptr;
malloc_ptr += size;

if (free_mem_end_ptr && malloc_ptr >= free_mem_end_ptr)
@@ -481,8 +481,7 @@ DEBG1("3 ");
z = 1 << j; /* table entries for j-bit table */

/* allocate and link in new table */
- if ((q = (struct huft *)malloc((z + 1)*sizeof(struct huft))) ==
- (struct huft *)NULL)
+ if ((q = malloc((z + 1)*sizeof(struct huft))) == NULL)
{
if (h)
huft_free(u[0]);

2009-04-08 13:55:38

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 22/56] message/fusion: Remove void casts

Fixed patch

Thanks,

Jack

--

message/fusion: Remove void casts

From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---

drivers/message/fusion/mptbase.c | 6 +++---
drivers/message/fusion/mptctl.c | 6 +++---
drivers/message/fusion/mptfc.c | 7 +++----
3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/message/fusion/mptbase.c
b/drivers/message/fusion/mptbase.c
index d0d126c..656f15f 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -4666,7 +4666,7 @@ GetLanConfigPages(MPT_ADAPTER *ioc)

if (hdr.PageLength > 0) {
data_sz = hdr.PageLength * 4;
- ppage0_alloc = (LANPage0_t *) pci_alloc_consistent(ioc->pcidev,
data_sz, &page0_dma);
+ ppage0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz,
&page0_dma);
rc = -ENOMEM;
if (ppage0_alloc) {
memset((u8 *)ppage0_alloc, 0, data_sz);
@@ -4712,7 +4712,7 @@ GetLanConfigPages(MPT_ADAPTER *ioc)

data_sz = hdr.PageLength * 4;
rc = -ENOMEM;
- ppage1_alloc = (LANPage1_t *) pci_alloc_consistent(ioc->pcidev,
data_sz, &page1_dma);
+ ppage1_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page1_dma);
if (ppage1_alloc) {
memset((u8 *)ppage1_alloc, 0, data_sz);
cfg.physAddr = page1_dma;
@@ -4986,7 +4986,7 @@ GetIoUnitPage2(MPT_ADAPTER *ioc)
/* Read the config page */
data_sz = hdr.PageLength * 4;
rc = -ENOMEM;
- ppage_alloc = (IOUnitPage2_t *) pci_alloc_consistent(ioc->pcidev,
data_sz, &page_dma);
+ ppage_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma);
if (ppage_alloc) {
memset((u8 *)ppage_alloc, 0, data_sz);
cfg.physAddr = page_dma;
diff --git a/drivers/message/fusion/mptctl.c
b/drivers/message/fusion/mptctl.c
index c638171..7893a2c 100644
--- a/drivers/message/fusion/mptctl.c
+++ b/drivers/message/fusion/mptctl.c
@@ -2603,7 +2603,7 @@ mptctl_hp_targetinfo(unsigned long arg)
/* Get the data transfer speeds
*/
data_sz = ioc->spi_data.sdp0length * 4;
- pg0_alloc = (SCSIDevicePage0_t *) pci_alloc_consistent(ioc->pcidev,
data_sz, &page_dma);
+ pg0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page_dma);
if (pg0_alloc) {
hdr.PageVersion = ioc->spi_data.sdp0version;
hdr.PageLength = data_sz;
@@ -2667,8 +2667,8 @@ mptctl_hp_targetinfo(unsigned long arg)
/* Issue the second config page request */
cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
data_sz = (int) cfg.cfghdr.hdr->PageLength * 4;
- pg3_alloc = (SCSIDevicePage3_t *) pci_alloc_consistent(
- ioc->pcidev, data_sz, &page_dma);
+ pg3_alloc = pci_alloc_consistent(ioc->pcidev, data_sz,
+ &page_dma);
if (pg3_alloc) {
cfg.physAddr = page_dma;
cfg.pageAddr = (karg.hdr.channel << 8) | karg.hdr.id;
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index c3c24fd..baee13b 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -766,7 +766,7 @@ mptfc_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)

data_sz = hdr.PageLength * 4;
rc = -ENOMEM;
- ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev,
data_sz, &page0_dma);
+ ppage0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
if (ppage0_alloc) {

try_again:
@@ -907,9 +907,8 @@ start_over:
if (data_sz < sizeof(FCPortPage1_t))
data_sz = sizeof(FCPortPage1_t);

- page1_alloc = (FCPortPage1_t *) pci_alloc_consistent(ioc->pcidev,
- data_sz,
- &page1_dma);
+ page1_alloc = pci_alloc_consistent(ioc->pcidev, data_sz,
+ &page1_dma);
if (!page1_alloc)
return -ENOMEM;
}

2009-04-08 13:56:55

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 45/56] scsi: Remove void casts

Fixed patch

Thanks,

Jack

--

scsi: Remove void casts

From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---

drivers/scsi/aic7xxx/aic79xx_core.c | 6 ++----
drivers/scsi/aic7xxx/aic7xxx_core.c | 9 +++------
drivers/scsi/aic7xxx/aicasm/aicasm.c | 10 +++++-----
drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c | 4 ++--
drivers/scsi/aic7xxx_old.c | 3 +--
drivers/scsi/ibmvscsi/ibmvscsi.c | 3 +--
drivers/scsi/ibmvscsi/ibmvstgt.c | 3 +--
drivers/scsi/lpfc/lpfc_hbadisc.c | 3 +--
drivers/scsi/lpfc/lpfc_init.c | 4 ++--
drivers/scsi/lpfc/lpfc_nportdisc.c | 4 ++--
drivers/scsi/lpfc/lpfc_sli.c | 8 ++++----
drivers/scsi/osst.c | 6 +++---
drivers/scsi/scsi_debug.c | 2 +-
13 files changed, 28 insertions(+), 37 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c
b/drivers/scsi/aic7xxx/aic79xx_core.c
index 63b521d..b971974 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -6932,13 +6932,11 @@ ahd_alloc_scbs(struct ahd_softc *ahd)
int error;
#endif

- next_scb = (struct scb *)malloc(sizeof(*next_scb),
- M_DEVBUF, M_NOWAIT);
+ next_scb = malloc(sizeof(*next_scb), M_DEVBUF, M_NOWAIT);
if (next_scb == NULL)
break;

- pdata = (struct scb_platform_data *)malloc(sizeof(*pdata),
- M_DEVBUF, M_NOWAIT);
+ pdata = malloc(sizeof(*pdata), M_DEVBUF, M_NOWAIT);
if (pdata == NULL) {
free(next_scb, M_DEVBUF);
break;
diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c
b/drivers/scsi/aic7xxx/aic7xxx_core.c
index e6f2bb7..e17825d 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -2152,8 +2152,7 @@ ahc_alloc_tstate(struct ahc_softc *ahc, u_int
scsi_id, char channel)
&& ahc->enabled_targets[scsi_id] != master_tstate)
panic("%s: ahc_alloc_tstate - Target already allocated",
ahc_name(ahc));
- tstate = (struct ahc_tmode_tstate*)malloc(sizeof(*tstate),
- M_DEVBUF, M_NOWAIT);
+ tstate = malloc(sizeof(*tstate), M_DEVBUF, M_NOWAIT);
if (tstate == NULL)
return (NULL);

@@ -4783,8 +4782,7 @@ ahc_init_scbdata(struct ahc_softc *ahc)
SLIST_INIT(&scb_data->sg_maps);

/* Allocate SCB resources */
- scb_data->scbarray =
- (struct scb *)malloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC,
+ scb_data->scbarray = malloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC,
M_DEVBUF, M_NOWAIT);
if (scb_data->scbarray == NULL)
return (ENOMEM);
@@ -5014,8 +5012,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc)
#ifndef __linux__
int error;
#endif
- pdata = (struct scb_platform_data *)malloc(sizeof(*pdata),
- M_DEVBUF, M_NOWAIT);
+ pdata = malloc(sizeof(*pdata), M_DEVBUF, M_NOWAIT);
if (pdata == NULL)
break;
next_scb->platform_data = pdata;
diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm.c
b/drivers/scsi/aic7xxx/aicasm/aicasm.c
index e4a7787..38e1690 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm.c
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm.c
@@ -497,7 +497,7 @@ emit_patch(scope_t *scope, int patch)
/* No-Op patch */
return;

- new_patch = (patch_t *)malloc(sizeof(*new_patch));
+ new_patch = malloc(sizeof(*new_patch));

if (new_patch == NULL)
stop("Could not malloc patch structure", EX_OSERR);
@@ -550,7 +550,7 @@ output_listing(char *ifilename)

func_values = NULL;
if (func_count != 0) {
- func_values = (int *)malloc(func_count * sizeof(int));
+ func_values = malloc(func_count * sizeof(int));

if (func_values == NULL)
stop("Could not malloc", EX_OSERR);
@@ -734,7 +734,7 @@ seq_alloc()
{
struct instruction *new_instr;

- new_instr = (struct instruction *)malloc(sizeof(struct instruction));
+ new_instr = malloc(sizeof(struct instruction));
if (new_instr == NULL)
stop("Unable to malloc instruction object", EX_SOFTWARE);
memset(new_instr, 0, sizeof(*new_instr));
@@ -748,7 +748,7 @@ cs_alloc()
{
critical_section_t *new_cs;

- new_cs= (critical_section_t *)malloc(sizeof(critical_section_t));
+ new_cs= malloc(sizeof(critical_section_t));
if (new_cs == NULL)
stop("Unable to malloc critical_section object", EX_SOFTWARE);
memset(new_cs, 0, sizeof(*new_cs));
@@ -762,7 +762,7 @@ scope_alloc()
{
scope_t *new_scope;

- new_scope = (scope_t *)malloc(sizeof(scope_t));
+ new_scope = malloc(sizeof(scope_t));
if (new_scope == NULL)
stop("Unable to malloc scope object", EX_SOFTWARE);
memset(new_scope, 0, sizeof(*new_scope));
diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
b/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
index 078ed60..c7c5812 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
@@ -67,7 +67,7 @@ symbol_create(char *name)
{
symbol_t *new_symbol;

- new_symbol = (symbol_t *)malloc(sizeof(symbol_t));
+ new_symbol = malloc(sizeof(symbol_t));
if (new_symbol == NULL) {
perror("Unable to create new symbol");
exit(EX_SOFTWARE);
@@ -227,7 +227,7 @@ symlist_add(symlist_t *symlist, symbol_t *symbol,
int how)
{
symbol_node_t *newnode;

- newnode = (symbol_node_t *)malloc(sizeof(symbol_node_t));
+ newnode = malloc(sizeof(symbol_node_t));
if (newnode == NULL) {
stop("symlist_add: Unable to malloc symbol_node", EX_SOFTWARE);
/* NOTREACHED */
diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c
index 93984c9..96c2f92 100644
--- a/drivers/scsi/aic7xxx_old.c
+++ b/drivers/scsi/aic7xxx_old.c
@@ -2569,8 +2569,7 @@ aic7xxx_allocate_scb(struct aic7xxx_host *p)
if (scb_ap == NULL)
return(0);
scb_dma = (struct aic7xxx_scb_dma *)&scb_ap[scb_count];
- hsgp = (struct hw_scatterlist *)
- pci_alloc_consistent(p->pdev, scb_size * scb_count,
+ hsgp = pci_alloc_consistent(p->pdev, scb_size * scb_count,
&scb_dma->dma_address);
if (hsgp == NULL)
{
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c
b/drivers/scsi/ibmvscsi/ibmvscsi.c
index c9aa761..7a90d4c 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -423,8 +423,7 @@ static int map_sg_data(struct scsi_cmnd *cmd,

/* get indirect table */
if (!evt_struct->ext_list) {
- evt_struct->ext_list = (struct srp_direct_buf *)
- dma_alloc_coherent(dev,
+ evt_struct->ext_list = dma_alloc_coherent(dev,
SG_ALL * sizeof(struct srp_direct_buf),
&evt_struct->ext_list_token, 0);
if (!evt_struct->ext_list) {
diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c
b/drivers/scsi/ibmvscsi/ibmvstgt.c
index e2dd6a4..ceb3737 100644
--- a/drivers/scsi/ibmvscsi/ibmvstgt.c
+++ b/drivers/scsi/ibmvscsi/ibmvstgt.c
@@ -852,8 +852,7 @@ static int ibmvstgt_probe(struct vio_dev *dev, const
struct vio_device_id *id)
if (err)
goto put_host;

- dma = (unsigned int *) vio_get_attribute(dev, "ibm,my-dma-window",
- &dma_size);
+ dma = vio_get_attribute(dev, "ibm,my-dma-window", &dma_size);
if (!dma || dma_size != 40) {
eprintk("Couldn't get window property %d\n", dma_size);
err = -EIO;
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c
b/drivers/scsi/lpfc/lpfc_hbadisc.c
index 311ed6d..dabe99d 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -2441,8 +2441,7 @@ lpfc_setup_disc_node(struct lpfc_vport *vport,
uint32_t did)
if ((vport->fc_flag & FC_RSCN_MODE) != 0 &&
lpfc_rscn_payload_check(vport, did) == 0)
return NULL;
- ndlp = (struct lpfc_nodelist *)
- mempool_alloc(vport->phba->nlp_mem_pool, GFP_KERNEL);
+ ndlp = mempool_alloc(vport->phba->nlp_mem_pool, GFP_KERNEL);
if (!ndlp)
return NULL;
lpfc_nlp_init(vport, ndlp, did);
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 06874e6..808a66b 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -992,7 +992,7 @@ lpfc_handle_latt(struct lpfc_hba *phba)
struct lpfc_dmabuf *mp;
int rc = 0;

- pmb = (LPFC_MBOXQ_t *)mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
+ pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
if (!pmb) {
rc = 1;
goto lpfc_handle_latt_err_exit;
@@ -2322,7 +2322,7 @@ lpfc_enable_msix(struct lpfc_hba *phba)
/*
* Configure HBA MSI-X attention conditions to messages
*/
- pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
+ pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);

if (!pmb) {
rc = -ENOMEM;
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c
b/drivers/scsi/lpfc/lpfc_nportdisc.c
index 8f548ad..0ab2616 100644
--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
@@ -1082,7 +1082,7 @@ lpfc_cmpl_adisc_adisc_issue(struct lpfc_vport *vport,
cmdiocb = (struct lpfc_iocbq *) arg;
rspiocb = cmdiocb->context_un.rsp_iocb;

- ap = (ADISC *)lpfc_check_elscmpl_iocb(phba, cmdiocb, rspiocb);
+ ap = lpfc_check_elscmpl_iocb(phba, cmdiocb, rspiocb);
irsp = &rspiocb->iocb;

if ((irsp->ulpStatus) ||
@@ -1420,7 +1420,7 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport
*vport, struct lpfc_nodelist *ndlp,

cmdiocb = (struct lpfc_iocbq *) arg;
rspiocb = cmdiocb->context_un.rsp_iocb;
- npr = (PRLI *)lpfc_check_elscmpl_iocb(phba, cmdiocb, rspiocb);
+ npr = lpfc_check_elscmpl_iocb(phba, cmdiocb, rspiocb);

irsp = &rspiocb->iocb;
if (irsp->ulpStatus) {
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index a36a120..966fcc5 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -313,7 +313,7 @@ lpfc_sli_ring_map(struct lpfc_hba *phba)
MAILBOX_t *pmbox;
int i, rc, ret = 0;

- pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
+ pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
if (!pmb)
return -ENOMEM;
pmbox = &pmb->mb;
@@ -2591,7 +2591,7 @@ lpfc_sli_brdkill(struct lpfc_hba *phba)
"0329 Kill HBA Data: x%x x%x\n",
phba->pport->port_state, psli->sli_flag);

- pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
+ pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
if (!pmb)
return 1;

@@ -2939,7 +2939,7 @@ lpfc_sli_hbq_setup(struct lpfc_hba *phba)
/* Get a Mailbox buffer to setup mailbox
* commands for HBA initialization
*/
- pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
+ pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);

if (!pmb)
return -ENOMEM;
@@ -3006,7 +3006,7 @@ lpfc_sli_config_port(struct lpfc_hba *phba, int
sli_mode)
LPFC_MBOXQ_t *pmb;
uint32_t resetcount = 0, rc = 0, done = 0;

- pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
+ pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
if (!pmb) {
phba->link_state = LPFC_HBA_ERROR;
return -ENOMEM;
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index acb8358..bd6c3a3 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -1482,7 +1482,7 @@ static int
osst_read_back_buffer_and_rewrite(struct osst_tape * STp, struct osst
int dbg = debugging;
#endif

- if ((buffer = (unsigned char *)vmalloc((nframes + 1) *
OS_DATA_SIZE)) == NULL)
+ if ((buffer = vmalloc((nframes + 1) * OS_DATA_SIZE)) == NULL)
return (-EIO);

printk(KERN_INFO "%s:I: Reading back %d frames from drive buffer%s\n",
@@ -2294,7 +2294,7 @@ static int osst_write_header(struct osst_tape *
STp, struct osst_request ** aSRp
if (STp->raw) return 0;

if (STp->header_cache == NULL) {
- if ((STp->header_cache = (os_header_t
*)vmalloc(sizeof(os_header_t))) == NULL) {
+ if ((STp->header_cache = vmalloc(sizeof(os_header_t))) == NULL) {
printk(KERN_ERR "%s:E: Failed to allocate header cache\n",
name);
return (-ENOMEM);
}
@@ -2482,7 +2482,7 @@ static int __osst_analyze_headers(struct osst_tape
* STp, struct osst_request **
name, ppos, update_frame_cntr);
#endif
if (STp->header_cache == NULL) {
- if ((STp->header_cache = (os_header_t
*)vmalloc(sizeof(os_header_t))) == NULL) {
+ if ((STp->header_cache = vmalloc(sizeof(os_header_t))) ==
NULL) {
printk(KERN_ERR "%s:E: Failed to allocate header
cache\n", name);
return 0;
}
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 213123b..379fa35 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -1947,7 +1947,7 @@ static int resp_xdwriteread(struct scsi_cmnd *scp,
unsigned long long lba,

offset = 0;
for_each_sg(sdb->table.sgl, sg, sdb->table.nents, i) {
- kaddr = (unsigned char *)kmap_atomic(sg_page(sg), KM_USER0);
+ kaddr = kmap_atomic(sg_page(sg), KM_USER0);
if (!kaddr)
goto out;

2009-04-08 13:57:58

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 51/56] sysv: Remove void casts

Fixed patch

Thanks,

Jack

--

sysv: Remove void casts

From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---

fs/sysv/dir.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c
index 56f6552..73b70a5 100644
--- a/fs/sysv/dir.c
+++ b/fs/sysv/dir.c
@@ -87,7 +87,7 @@ static int sysv_readdir(struct file * filp, void *
dirent, filldir_t filldir)

if (IS_ERR(page))
continue;
- kaddr = (char *)page_address(page);
+ kaddr = page_address(page);
de = (struct sysv_dir_entry *)(kaddr+offset);
limit = kaddr + PAGE_CACHE_SIZE - SYSV_DIRSIZE;
for ( ;(char*)de <= limit; de++) {
@@ -157,7 +157,7 @@ struct sysv_dir_entry *sysv_find_entry(struct dentry
*dentry, struct page **res_
char *kaddr;
page = dir_get_page(dir, n);
if (!IS_ERR(page)) {
- kaddr = (char*)page_address(page);
+ kaddr = page_address(page);
de = (struct sysv_dir_entry *) kaddr;
kaddr += PAGE_CACHE_SIZE - SYSV_DIRSIZE;
for ( ; (char *) de <= kaddr ; de++) {
@@ -201,7 +201,7 @@ int sysv_add_link(struct dentry *dentry, struct
inode *inode)
err = PTR_ERR(page);
if (IS_ERR(page))
goto out;
- kaddr = (char*)page_address(page);
+ kaddr = page_address(page);
de = (struct sysv_dir_entry *)kaddr;
kaddr += PAGE_CACHE_SIZE - SYSV_DIRSIZE;
while ((char *)de <= kaddr) {
@@ -244,7 +244,7 @@ int sysv_delete_entry(struct sysv_dir_entry *de,
struct page *page)
{
struct address_space *mapping = page->mapping;
struct inode *inode = (struct inode*)mapping->host;
- char *kaddr = (char*)page_address(page);
+ char *kaddr = page_address(page);
loff_t pos = page_offset(page) + (char *)de - kaddr;
int err;

@@ -278,7 +278,7 @@ int sysv_make_empty(struct inode *inode, struct
inode *dir)
}
kmap(page);

- base = (char*)page_address(page);
+ base = page_address(page);
memset(base, 0, PAGE_CACHE_SIZE);

de = (struct sysv_dir_entry *) base;
@@ -312,7 +312,7 @@ int sysv_empty_dir(struct inode * inode)
if (IS_ERR(page))
continue;

- kaddr = (char *)page_address(page);
+ kaddr = page_address(page);
de = (struct sysv_dir_entry *)kaddr;
kaddr += PAGE_CACHE_SIZE-SYSV_DIRSIZE;

2009-04-08 13:59:30

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 50/56] drivers/staging: Remove void casts

Fixed patch

Thanks,

Jack

--

drivers/staging: Remove void casts

From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---

drivers/staging/altpciechdma/altpciechdma.c | 4 ++--
drivers/staging/epl/EplApiLinuxKernel.c | 8 ++------
drivers/staging/et131x/et1310_rx.c | 4 ++--
drivers/staging/rtl8187se/r8180_core.c | 13 ++++++-------
drivers/staging/slicoss/slicoss.c | 3 +--
5 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/altpciechdma/altpciechdma.c
b/drivers/staging/altpciechdma/altpciechdma.c
index 5869e14..f613a1d 100644
--- a/drivers/staging/altpciechdma/altpciechdma.c
+++ b/drivers/staging/altpciechdma/altpciechdma.c
@@ -535,7 +535,7 @@ static int __devinit dma_test(struct ape_dev *ape,
struct pci_dev *dev)

/* allocate and map coherently-cached memory for a DMA-able buffer */
/* @see Documentation/PCI/PCI-DMA-mapping.txt, near line 318 */
- buffer_virt = (u8 *)pci_alloc_consistent(dev, PAGE_SIZE * 4,
&buffer_bus);
+ buffer_virt = pci_alloc_consistent(dev, PAGE_SIZE * 4, &buffer_bus);
if (!buffer_virt) {
printk(KERN_DEBUG "Could not allocate coherent DMA buffer.\n");
goto fail;
@@ -793,7 +793,7 @@ static int __devinit probe(struct pci_dev *dev,
const struct pci_device_id *id)

/* allocate and map coherently-cached memory for a descriptor table */
/* @see LDD3 page 446 */
- ape->table_virt = (struct ape_chdma_table *)pci_alloc_consistent(dev,
+ ape->table_virt = pci_alloc_consistent(dev,
APE_CHDMA_TABLE_SIZE, &ape->table_bus);
/* could not allocate table? */
if (!ape->table_virt) {
diff --git a/drivers/staging/epl/EplApiLinuxKernel.c
b/drivers/staging/epl/EplApiLinuxKernel.c
index cb3e275..4c5dfcd 100644
--- a/drivers/staging/epl/EplApiLinuxKernel.c
+++ b/drivers/staging/epl/EplApiLinuxKernel.c
@@ -655,9 +655,7 @@ static int EplLinIoctl(struct inode
*pDeviceFile_p, // information about the dev
goto Exit;
}

- pBufHeader =
- (tEplLinSdoBufHeader *)
- vmalloc(sizeof(tEplLinSdoBufHeader) +
+ pBufHeader = vmalloc(sizeof(tEplLinSdoBufHeader) +
SdoObject.m_uiSize);
if (pBufHeader == NULL) { // no memory available
iRet = -ENOMEM;
@@ -751,9 +749,7 @@ static int EplLinIoctl(struct inode
*pDeviceFile_p, // information about the dev
goto Exit;
}

- pBufHeader =
- (tEplLinSdoBufHeader *)
- vmalloc(sizeof(tEplLinSdoBufHeader) +
+ pBufHeader = vmalloc(sizeof(tEplLinSdoBufHeader) +
SdoObject.m_uiSize);
if (pBufHeader == NULL) { // no memory available
iRet = -ENOMEM;
diff --git a/drivers/staging/et131x/et1310_rx.c
b/drivers/staging/et131x/et1310_rx.c
index 8dc559a..a3810f5 100644
--- a/drivers/staging/et131x/et1310_rx.c
+++ b/drivers/staging/et131x/et1310_rx.c
@@ -610,8 +610,8 @@ int et131x_init_recv(struct et131x_adapter *adapter)

/* Setup each RFD */
for (RfdCount = 0; RfdCount < rx_ring->NumRfd; RfdCount++) {
- pMpRfd = (MP_RFD *) kmem_cache_alloc(rx_ring->RecvLookaside,
- GFP_ATOMIC | GFP_DMA);
+ pMpRfd = kmem_cache_alloc(rx_ring->RecvLookaside,
+ GFP_ATOMIC | GFP_DMA);

if (!pMpRfd) {
DBG_ERROR(et131x_dbginfo,
diff --git a/drivers/staging/rtl8187se/r8180_core.c
b/drivers/staging/rtl8187se/r8180_core.c
index 6ecd12d..4f35f6d 100644
--- a/drivers/staging/rtl8187se/r8180_core.c
+++ b/drivers/staging/rtl8187se/r8180_core.c
@@ -1691,7 +1691,7 @@ int alloc_tx_beacon_desc_ring(struct net_device
*dev, int count)
u32 *tmp;
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);

- priv->txbeaconring = (u32*)pci_alloc_consistent(priv->pdev,
+ priv->txbeaconring = pci_alloc_consistent(priv->pdev,
sizeof(u32)*8*count,
&priv->txbeaconringdma);
if (!priv->txbeaconring) return -1;
@@ -1727,8 +1727,7 @@ short alloc_tx_desc_ring(struct net_device *dev,
int bufsize, int count,
DMESGE ("TX buffer allocation too large");
return 0;
}
- desc = (u32*)pci_alloc_consistent(pdev,
- sizeof(u32)*8*count+256, &dma_desc);
+ desc = pci_alloc_consistent(pdev, sizeof(u32)*8*count+256, &dma_desc);
if(desc==NULL) return -1;
if(dma_desc & 0xff){

@@ -1751,7 +1750,7 @@ short alloc_tx_desc_ring(struct net_device *dev,
int bufsize, int count,
tmp=desc;
for (i=0;i<count;i++)
{
- buf = (void*)pci_alloc_consistent(pdev,bufsize,&dma_tmp);
+ buf = pci_alloc_consistent(pdev,bufsize,&dma_tmp);
if (buf == NULL) return -ENOMEM;

switch(addr) {
@@ -1975,8 +1974,8 @@ short alloc_rx_desc_ring(struct net_device *dev,
u16 bufsize, int count)
return -1;
}

- desc =
(u32*)pci_alloc_consistent(pdev,sizeof(u32)*rx_desc_size*count+256,
- &dma_desc);
+ desc = pci_alloc_consistent(pdev,sizeof(u32)*rx_desc_size*count+256,
+ &dma_desc);

if(dma_desc & 0xff){

@@ -2017,7 +2016,7 @@ short alloc_rx_desc_ring(struct net_device *dev,
u16 bufsize, int count)
for(j=0;j<bufsize;j++) ((u8*)buf)[i] = 0;
#endif

- //buf = (void*)pci_alloc_consistent(pdev,bufsize,&dma_tmp);
+ //buf = pci_alloc_consistent(pdev,bufsize,&dma_tmp);
if(-1 == buffer_add(&(priv->rxbuffer), buf,dma_tmp,
&(priv->rxbufferhead))){
DMESGE("Unable to allocate mem RX buf");
diff --git a/drivers/staging/slicoss/slicoss.c
b/drivers/staging/slicoss/slicoss.c
index 9481563..746034c 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -333,8 +333,7 @@ static void slic_init_adapter(struct net_device *netdev,
pslic_handle->next = adapter->pfree_slic_handles;
adapter->pfree_slic_handles = pslic_handle;
}
- adapter->pshmem = (struct slic_shmem *)
- pci_alloc_consistent(adapter->pcidev,
+ adapter->pshmem = pci_alloc_consistent(adapter->pcidev,
sizeof(struct slic_shmem),
&adapter->
phys_shmem);

2009-04-08 14:00:44

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 53/56] usb: Remove void casts

Fixed patch

Thanks,

Jack

--

usb: Remove void casts

From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---

drivers/usb/host/ehci-dbg.c | 2 +-
drivers/usb/host/ehci-mem.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
index 7f4ace7..abfc31f 100644
--- a/drivers/usb/host/ehci-dbg.c
+++ b/drivers/usb/host/ehci-dbg.c
@@ -832,7 +832,7 @@ static int fill_buffer(struct debug_buffer *buf)
int ret = 0;

if (!buf->output_buf)
- buf->output_buf = (char *)vmalloc(buf->alloc_size);
+ buf->output_buf = vmalloc(buf->alloc_size);

if (!buf->output_buf) {
ret = -ENOMEM;
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c
index 10d5291..df5334f 100644
--- a/drivers/usb/host/ehci-mem.c
+++ b/drivers/usb/host/ehci-mem.c
@@ -83,8 +83,7 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd
*ehci, gfp_t flags)
struct ehci_qh *qh;
dma_addr_t dma;

- qh = (struct ehci_qh *)
- dma_pool_alloc (ehci->qh_pool, flags, &dma);
+ qh = dma_pool_alloc (ehci->qh_pool, flags, &dma);
if (!qh)
return qh;

2009-04-08 14:02:25

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 56/56] xfs: Remove void casts

Fixed patch

Thanks,

Jack

--

xfs: Remove void casts

From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---

fs/xfs/quota/xfs_dquot_item.c | 2 +-
fs/xfs/support/ktrace.c | 10 ++++------
fs/xfs/xfs_attr_leaf.c | 2 +-
fs/xfs/xfs_buf_item.c | 7 +++----
fs/xfs/xfs_extfree_item.c | 10 ++++------
fs/xfs/xfs_inode.c | 5 ++---
fs/xfs/xfs_log_recover.c | 12 ++++--------
fs/xfs/xfs_trans.c | 5 ++---
fs/xfs/xfs_trans_inode.c | 3 +--
fs/xfs/xfs_trans_item.c | 6 ++----
10 files changed, 24 insertions(+), 38 deletions(-)

diff --git a/fs/xfs/quota/xfs_dquot_item.c b/fs/xfs/quota/xfs_dquot_item.c
index 1728f6a..a4d970a 100644
--- a/fs/xfs/quota/xfs_dquot_item.c
+++ b/fs/xfs/quota/xfs_dquot_item.c
@@ -648,7 +648,7 @@ xfs_qm_qoff_logitem_init(
{
xfs_qoff_logitem_t *qf;

- qf = (xfs_qoff_logitem_t*) kmem_zalloc(sizeof(xfs_qoff_logitem_t),
KM_SLEEP);
+ qf = kmem_zalloc(sizeof(xfs_qoff_logitem_t), KM_SLEEP);

qf->qql_item.li_type = XFS_LI_QUOTAOFF;
if (start)
diff --git a/fs/xfs/support/ktrace.c b/fs/xfs/support/ktrace.c
index 2d494c2..db35dcd 100644
--- a/fs/xfs/support/ktrace.c
+++ b/fs/xfs/support/ktrace.c
@@ -58,9 +58,9 @@ ktrace_alloc(int nentries, unsigned int __nocast sleep)
ktrace_entry_t *ktep;
int entries;

- ktp = (ktrace_t*)kmem_zone_alloc(ktrace_hdr_zone, sleep);
+ ktp = kmem_zone_alloc(ktrace_hdr_zone, sleep);

- if (ktp == (ktrace_t*)NULL) {
+ if (ktp == NULL) {
/*
* KM_SLEEP callers don't expect failure.
*/
@@ -75,11 +75,9 @@ ktrace_alloc(int nentries, unsigned int __nocast sleep)
*/
entries = roundup_pow_of_two(nentries);
if (entries == ktrace_zentries) {
- ktep = (ktrace_entry_t*)kmem_zone_zalloc(ktrace_ent_zone,
- sleep);
+ ktep = kmem_zone_zalloc(ktrace_ent_zone, sleep);
} else {
- ktep = (ktrace_entry_t*)kmem_zalloc((entries * sizeof(*ktep)),
- sleep | KM_LARGE);
+ ktep = kmem_zalloc((entries * sizeof(*ktep)), sleep | KM_LARGE);
}

if (ktep == NULL) {
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
index afdc891..688e894 100644
--- a/fs/xfs/xfs_attr_leaf.c
+++ b/fs/xfs/xfs_attr_leaf.c
@@ -2869,7 +2869,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **trans,
xfs_inode_t *dp, xfs_dabuf_t *bp)
* Allocate storage for a list of all the "remote" value extents.
*/
size = count * sizeof(xfs_attr_inactive_list_t);
- list = (xfs_attr_inactive_list_t *)kmem_alloc(size, KM_SLEEP);
+ list = kmem_alloc(size, KM_SLEEP);

/*
* Identify each of the "remote" value extents.
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index 92af409..95234ef 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -726,8 +726,7 @@ xfs_buf_item_init(
chunks = (int)((XFS_BUF_COUNT(bp) + (XFS_BLI_CHUNK - 1)) >>
XFS_BLI_SHIFT);
map_size = (int)((chunks + NBWORD) >> BIT_TO_WORD_SHIFT);

- bip = (xfs_buf_log_item_t*)kmem_zone_zalloc(xfs_buf_item_zone,
- KM_SLEEP);
+ bip = kmem_zone_zalloc(xfs_buf_item_zone, KM_SLEEP);
bip->bli_item.li_type = XFS_LI_BUF;
bip->bli_item.li_ops = &xfs_buf_item_ops;
bip->bli_item.li_mountp = mp;
@@ -751,9 +750,9 @@ xfs_buf_item_init(
* the buffer to indicate which bytes the callers have asked
* to have logged.
*/
- bip->bli_orig = (char *)kmem_alloc(XFS_BUF_COUNT(bp), KM_SLEEP);
+ bip->bli_orig = kmem_alloc(XFS_BUF_COUNT(bp), KM_SLEEP);
memcpy(bip->bli_orig, XFS_BUF_PTR(bp), XFS_BUF_COUNT(bp));
- bip->bli_logged = (char *)kmem_zalloc(XFS_BUF_COUNT(bp) / NBBY,
KM_SLEEP);
+ bip->bli_logged = kmem_zalloc(XFS_BUF_COUNT(bp) / NBBY, KM_SLEEP);
#endif

/*
diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c
index 05a4bdd..2b8267c 100644
--- a/fs/xfs/xfs_extfree_item.c
+++ b/fs/xfs/xfs_extfree_item.c
@@ -253,10 +253,9 @@ xfs_efi_init(xfs_mount_t *mp,
if (nextents > XFS_EFI_MAX_FAST_EXTENTS) {
size = (uint)(sizeof(xfs_efi_log_item_t) +
((nextents - 1) * sizeof(xfs_extent_t)));
- efip = (xfs_efi_log_item_t*)kmem_zalloc(size, KM_SLEEP);
+ efip = kmem_zalloc(size, KM_SLEEP);
} else {
- efip = (xfs_efi_log_item_t*)kmem_zone_zalloc(xfs_efi_zone,
- KM_SLEEP);
+ efip = kmem_zone_zalloc(xfs_efi_zone, KM_SLEEP);
}

efip->efi_item.li_type = XFS_LI_EFI;
@@ -548,10 +547,9 @@ xfs_efd_init(xfs_mount_t *mp,
if (nextents > XFS_EFD_MAX_FAST_EXTENTS) {
size = (uint)(sizeof(xfs_efd_log_item_t) +
((nextents - 1) * sizeof(xfs_extent_t)));
- efdp = (xfs_efd_log_item_t*)kmem_zalloc(size, KM_SLEEP);
+ efdp = kmem_zalloc(size, KM_SLEEP);
} else {
- efdp = (xfs_efd_log_item_t*)kmem_zone_zalloc(xfs_efd_zone,
- KM_SLEEP);
+ efdp = kmem_zone_zalloc(xfs_efd_zone, KM_SLEEP);
}

efdp->efd_item.li_type = XFS_LI_EFD;
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index e7ae08d..5ab6e3d 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -3453,7 +3453,7 @@ xfs_iext_add_indirect_multi(
* (all extents past */
if (nex2) {
byte_diff = nex2 * sizeof(xfs_bmbt_rec_t);
- nex2_ep = (xfs_bmbt_rec_t *) kmem_alloc(byte_diff, KM_NOFS);
+ nex2_ep = kmem_alloc(byte_diff, KM_NOFS);
memmove(nex2_ep, &erp->er_extbuf[idx], byte_diff);
erp->er_extcount -= nex2;
xfs_iext_irec_update_extoffs(ifp, erp_idx + 1, -nex2);
@@ -3842,8 +3842,7 @@ xfs_iext_realloc_indirect(
if (new_size == 0) {
xfs_iext_destroy(ifp);
} else {
- ifp->if_u1.if_ext_irec = (xfs_ext_irec_t *)
- kmem_realloc(ifp->if_u1.if_ext_irec,
+ ifp->if_u1.if_ext_irec = kmem_realloc(ifp->if_u1.if_ext_irec,
new_size, size, KM_NOFS);
}
}
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 7ba4501..fc8daa0 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -1670,8 +1670,7 @@ xlog_recover_do_buffer_pass1(
* the bucket.
*/
if (*bucket == NULL) {
- bcp = (xfs_buf_cancel_t *)kmem_alloc(sizeof(xfs_buf_cancel_t),
- KM_SLEEP);
+ bcp = kmem_alloc(sizeof(xfs_buf_cancel_t), KM_SLEEP);
bcp->bc_blkno = blkno;
bcp->bc_len = len;
bcp->bc_refcount = 1;
@@ -1696,8 +1695,7 @@ xlog_recover_do_buffer_pass1(
nextp = nextp->bc_next;
}
ASSERT(prevp != NULL);
- bcp = (xfs_buf_cancel_t *)kmem_alloc(sizeof(xfs_buf_cancel_t),
- KM_SLEEP);
+ bcp = kmem_alloc(sizeof(xfs_buf_cancel_t), KM_SLEEP);
bcp->bc_blkno = blkno;
bcp->bc_len = len;
bcp->bc_refcount = 1;
@@ -2316,8 +2314,7 @@ xlog_recover_do_inode_trans(
if (item->ri_buf[0].i_len == sizeof(xfs_inode_log_format_t)) {
in_f = (xfs_inode_log_format_t *)item->ri_buf[0].i_addr;
} else {
- in_f = (xfs_inode_log_format_t *)kmem_alloc(
- sizeof(xfs_inode_log_format_t), KM_SLEEP);
+ in_f = kmem_alloc(sizeof(xfs_inode_log_format_t), KM_SLEEP);
need_free = 1;
error = xfs_inode_item_format_convert(&item->ri_buf[0], in_f);
if (error)
@@ -3778,8 +3775,7 @@ xlog_do_log_recovery(
* First do a pass to find all of the cancelled buf log items.
* Store them in the buf_cancel_table for use in the second pass.
*/
- log->l_buf_cancel_table =
- (xfs_buf_cancel_t **)kmem_zalloc(XLOG_BC_TABLE_SIZE *
+ log->l_buf_cancel_table = kmem_zalloc(XLOG_BC_TABLE_SIZE *
sizeof(xfs_buf_cancel_t*),
KM_SLEEP);
error = xlog_do_recovery_pass(log, head_blk, tail_blk,
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 8570b82..282795e 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -868,9 +868,8 @@ shut_us_down:
} else if (nvec <= XFS_TRANS_LOGVEC_COUNT) {
log_vector = log_vector_fast;
} else {
- log_vector = (xfs_log_iovec_t *)kmem_alloc(nvec *
- sizeof(xfs_log_iovec_t),
- KM_SLEEP);
+ log_vector = kmem_alloc(nvec * sizeof(xfs_log_iovec_t),
+ KM_SLEEP);
}

/*
diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c
index 23d276a..e1b90f0 100644
--- a/fs/xfs/xfs_trans_inode.c
+++ b/fs/xfs/xfs_trans_inode.c
@@ -271,8 +271,7 @@ xfs_trans_inode_broot_debug(
ASSERT((ip->i_df.if_broot != NULL) &&
(ip->i_df.if_broot_bytes > 0));
iip->ili_root_size = ip->i_df.if_broot_bytes;
- iip->ili_orig_root =
- (char*)kmem_alloc(iip->ili_root_size, KM_SLEEP);
+ iip->ili_orig_root = kmem_alloc(iip->ili_root_size, KM_SLEEP);
memcpy(iip->ili_orig_root, (char*)(ip->i_df.if_broot),
iip->ili_root_size);
}
diff --git a/fs/xfs/xfs_trans_item.c b/fs/xfs/xfs_trans_item.c
index eb3fc57..49615dd 100644
--- a/fs/xfs/xfs_trans_item.c
+++ b/fs/xfs/xfs_trans_item.c
@@ -54,8 +54,7 @@ xfs_trans_add_item(xfs_trans_t *tp, xfs_log_item_t *lip)
* of them and put it at the front of the chunk list.
*/
if (tp->t_items_free == 0) {
- licp = (xfs_log_item_chunk_t*)
- kmem_alloc(sizeof(xfs_log_item_chunk_t), KM_SLEEP);
+ licp = kmem_alloc(sizeof(xfs_log_item_chunk_t), KM_SLEEP);
ASSERT(licp != NULL);
/*
* Initialize the chunk, and then
@@ -460,8 +459,7 @@ xfs_trans_add_busy(xfs_trans_t *tp, xfs_agnumber_t
ag, xfs_extlen_t idx)
* of them and put it at the front of the chunk list.
*/
if (tp->t_busy_free == 0) {
- lbcp = (xfs_log_busy_chunk_t*)
- kmem_alloc(sizeof(xfs_log_busy_chunk_t), KM_SLEEP);
+ lbcp = kmem_alloc(sizeof(xfs_log_busy_chunk_t), KM_SLEEP);
ASSERT(lbcp != NULL);
/*
* Initialize the chunk, and then

2009-04-08 14:03:26

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts

Fixed patch

Thanks,

Jack

--

x86: Remove void casts

From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---

arch/x86/kernel/machine_kexec_64.c | 8 ++++----
arch/x86/kernel/microcode_amd.c | 2 +-
arch/x86/mm/init_32.c | 4 ++--
arch/x86/mm/init_64.c | 10 +++++-----
arch/x86/mm/pageattr.c | 2 +-
5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/x86/kernel/machine_kexec_64.c
b/arch/x86/kernel/machine_kexec_64.c
index 89cea4d..1c5b3c9 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -33,7 +33,7 @@ static int init_one_level2_page(struct kimage *image,
pgd_t *pgd,
page = kimage_alloc_control_pages(image, 0);
if (!page)
goto out;
- pud = (pud_t *)page_address(page);
+ pud = page_address(page);
memset(pud, 0, PAGE_SIZE);
set_pgd(pgd, __pgd(__pa(pud) | _KERNPG_TABLE));
}
@@ -42,7 +42,7 @@ static int init_one_level2_page(struct kimage *image,
pgd_t *pgd,
page = kimage_alloc_control_pages(image, 0);
if (!page)
goto out;
- pmd = (pmd_t *)page_address(page);
+ pmd = page_address(page);
memset(pmd, 0, PAGE_SIZE);
set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE));
}
@@ -84,7 +84,7 @@ static int init_level3_page(struct kimage *image,
pud_t *level3p,
result = -ENOMEM;
goto out;
}
- level2p = (pmd_t *)page_address(page);
+ level2p = page_address(page);
init_level2_page(level2p, addr);
set_pud(level3p++, __pud(__pa(level2p) | _KERNPG_TABLE));
addr += PUD_SIZE;
@@ -117,7 +117,7 @@ static int init_level4_page(struct kimage *image,
pgd_t *level4p,
result = -ENOMEM;
goto out;
}
- level3p = (pud_t *)page_address(page);
+ level3p = page_address(page);
result = init_level3_page(image, level3p, addr, last_addr);
if (result)
goto out;
diff --git a/arch/x86/kernel/microcode_amd.c
b/arch/x86/kernel/microcode_amd.c
index 453b579..8624d69 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -239,7 +239,7 @@ static int install_equiv_cpu_table(const u8 *buf)
return 0;
}

- equiv_cpu_table = (struct equiv_cpu_entry *) vmalloc(size);
+ equiv_cpu_table = vmalloc(size);
if (!equiv_cpu_table) {
printk(KERN_ERR "microcode: failed to allocate "
"equivalent CPU table\n");
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 749559e..64f1a30 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -89,7 +89,7 @@ static pmd_t * __init one_md_table_init(pgd_t *pgd)
if (after_bootmem)
pmd_table = (pmd_t *)alloc_bootmem_low_pages(PAGE_SIZE);
else
- pmd_table = (pmd_t *)alloc_low_page();
+ pmd_table = alloc_low_page();
paravirt_alloc_pmd(&init_mm, __pa(pmd_table) >> PAGE_SHIFT);
set_pgd(pgd, __pgd(__pa(pmd_table) | _PAGE_PRESENT));
pud = pud_offset(pgd, 0);
@@ -121,7 +121,7 @@ static pte_t * __init one_page_table_init(pmd_t *pmd)
page_table =
(pte_t *)alloc_bootmem_low_pages(PAGE_SIZE);
} else
- page_table = (pte_t *)alloc_low_page();
+ page_table = alloc_low_page();

paravirt_alloc_pte(&init_mm, __pa(page_table) >> PAGE_SHIFT);
set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE));
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 1753e80..bd08334 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -164,7 +164,7 @@ static __ref void *spp_getpage(void)
static pud_t *fill_pud(pgd_t *pgd, unsigned long vaddr)
{
if (pgd_none(*pgd)) {
- pud_t *pud = (pud_t *)spp_getpage();
+ pud_t *pud = spp_getpage();
pgd_populate(&init_mm, pgd, pud);
if (pud != pud_offset(pgd, 0))
printk(KERN_ERR "PAGETABLE BUG #00! %p <-> %p\n",
@@ -176,7 +176,7 @@ static pud_t *fill_pud(pgd_t *pgd, unsigned long vaddr)
static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr)
{
if (pud_none(*pud)) {
- pmd_t *pmd = (pmd_t *) spp_getpage();
+ pmd_t *pmd = spp_getpage();
pud_populate(&init_mm, pud, pmd);
if (pmd != pmd_offset(pud, 0))
printk(KERN_ERR "PAGETABLE BUG #01! %p <-> %p\n",
@@ -188,7 +188,7 @@ static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr)
static pte_t *fill_pte(pmd_t *pmd, unsigned long vaddr)
{
if (pmd_none(*pmd)) {
- pte_t *pte = (pte_t *) spp_getpage();
+ pte_t *pte = spp_getpage();
pmd_populate_kernel(&init_mm, pmd, pte);
if (pte != pte_offset_kernel(pmd, 0))
printk(KERN_ERR "PAGETABLE BUG #02!\n");
@@ -264,13 +264,13 @@ static void __init __init_extra_mapping(unsigned
long phys, unsigned long size,
for (; size; phys += PMD_SIZE, size -= PMD_SIZE) {
pgd = pgd_offset_k((unsigned long)__va(phys));
if (pgd_none(*pgd)) {
- pud = (pud_t *) spp_getpage();
+ pud = spp_getpage();
set_pgd(pgd, __pgd(__pa(pud) | _KERNPG_TABLE |
_PAGE_USER));
}
pud = pud_offset(pgd, (unsigned long)__va(phys));
if (pud_none(*pud)) {
- pmd = (pmd_t *) spp_getpage();
+ pmd = spp_getpage();
set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE |
_PAGE_USER));
}
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index d71e1b6..41ee1db 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -490,7 +490,7 @@ static int split_large_page(pte_t *kpte, unsigned
long address)
if (tmp != kpte)
goto out_unlock;

- pbase = (pte_t *)page_address(base);
+ pbase = page_address(base);
paravirt_alloc_pte(&init_mm, page_to_pfn(base));
ref_prot = pte_pgprot(pte_clrhuge(*kpte));
/*

2009-04-08 14:04:30

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 36/56] ocfs2: Remove void casts

Fixed Patch

Thanks,

Jack

--

ocfs2: Remove void casts

From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---

fs/ocfs2/dlm/dlmmaster.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index f8b653f..52ee37d 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -758,8 +758,7 @@ lookup:
spin_unlock(&dlm->spinlock);
mlog(0, "allocating a new resource\n");
/* nothing found and we need to allocate one. */
- alloc_mle = (struct dlm_master_list_entry *)
- kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
+ alloc_mle = kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
if (!alloc_mle)
goto leave;
res = dlm_new_lockres(dlm, lockid, namelen);
@@ -1543,8 +1542,7 @@ way_up_top:
spin_unlock(&dlm->master_lock);
spin_unlock(&dlm->spinlock);

- mle = (struct dlm_master_list_entry *)
- kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
+ mle = kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
if (!mle) {
response = DLM_MASTER_RESP_ERROR;
mlog_errno(-ENOMEM);
@@ -2455,8 +2453,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
goto leave;
}

- mle = (struct dlm_master_list_entry *) kmem_cache_alloc(dlm_mle_cache,
- GFP_NOFS);
+ mle = kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
if (!mle) {
mlog_errno(ret);
goto leave;
@@ -3036,8 +3033,7 @@ int dlm_migrate_request_handler(struct o2net_msg
*msg, u32 len, void *data,
hash = dlm_lockid_hash(name, namelen);

/* preallocate.. if this fails, abort */
- mle = (struct dlm_master_list_entry *) kmem_cache_alloc(dlm_mle_cache,
- GFP_NOFS);
+ mle = kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);

if (!mle) {
ret = -ENOMEM;

2009-04-08 14:05:20

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 35/56] ntfs: Remove void casts

Fixed patch,

Thanks,

Jack

--

ntfs: Remove void casts

From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---

fs/ntfs/dir.c | 8 ++++----
fs/ntfs/index.c | 2 +-
fs/ntfs/super.c | 8 ++++----
fs/ntfs/usnjrnl.c | 2 +-
4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c
index 5a9e344..c373301 100644
--- a/fs/ntfs/dir.c
+++ b/fs/ntfs/dir.c
@@ -326,7 +326,7 @@ descend_into_child_node:
goto err_out;
}
lock_page(page);
- kaddr = (u8*)page_address(page);
+ kaddr = page_address(page);
fast_descend_into_child_node:
/* Get to the index allocation block. */
ia = (INDEX_ALLOCATION*)(kaddr + ((vcn <<
@@ -804,7 +804,7 @@ descend_into_child_node:
goto err_out;
}
lock_page(page);
- kaddr = (u8*)page_address(page);
+ kaddr = page_address(page);
fast_descend_into_child_node:
/* Get to the index allocation block. */
ia = (INDEX_ALLOCATION*)(kaddr + ((vcn <<
@@ -1279,7 +1279,7 @@ get_next_bmp_page:
bmp_page = NULL;
goto iput_err_out;
}
- bmp = (u8*)page_address(bmp_page);
+ bmp = page_address(bmp_page);
/* Find next index block in use. */
while (!(bmp[cur_bmp_pos >> 3] & (1 << (cur_bmp_pos & 7)))) {
find_next_index_buffer:
@@ -1322,7 +1322,7 @@ find_next_index_buffer:
goto err_out;
}
lock_page(ia_page);
- kaddr = (u8*)page_address(ia_page);
+ kaddr = page_address(ia_page);
}
/* Get the current index buffer. */
ia = (INDEX_ALLOCATION*)(kaddr + (ia_pos & ~PAGE_CACHE_MASK &
diff --git a/fs/ntfs/index.c b/fs/ntfs/index.c
index 2194eff..16a8b2e 100644
--- a/fs/ntfs/index.c
+++ b/fs/ntfs/index.c
@@ -282,7 +282,7 @@ descend_into_child_node:
goto err_out;
}
lock_page(page);
- kaddr = (u8*)page_address(page);
+ kaddr = page_address(page);
fast_descend_into_child_node:
/* Get to the index allocation block. */
ia = (INDEX_ALLOCATION*)(kaddr + ((vcn <<
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index f76951d..d05bccf 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -1295,7 +1295,7 @@ static int
check_windows_hibernation_status(ntfs_volume *vol)
ret = PTR_ERR(page);
goto iput_out;
}
- kaddr = (u32*)page_address(page);
+ kaddr = page_address(page);
if (*(le32*)kaddr == cpu_to_le32(0x72626968)/*'hibr'*/) {
ntfs_debug("Magic \"hibr\" found in hiberfil.sys. Windows is "
"hibernated on the volume. This is the "
@@ -1515,7 +1515,7 @@ not_enabled:
"attribute.");
return false;
}
- uh = (USN_HEADER*)page_address(page);
+ uh = page_address(page);
/* Sanity check the $Max. */
if (unlikely(sle64_to_cpu(uh->allocation_delta) >
sle64_to_cpu(uh->maximum_size))) {
@@ -2501,7 +2501,7 @@ static s64 get_nr_free_clusters(ntfs_volume *vol)
nr_free -= PAGE_CACHE_SIZE * 8;
continue;
}
- kaddr = (u32*)kmap_atomic(page, KM_USER0);
+ kaddr = kmap_atomic(page, KM_USER0);
/*
* For each 4 bytes, subtract the number of set bits. If this
* is the last page and it is partial we don't really care as
@@ -2572,7 +2572,7 @@ static unsigned long
__get_nr_free_mft_records(ntfs_volume *vol,
nr_free -= PAGE_CACHE_SIZE * 8;
continue;
}
- kaddr = (u32*)kmap_atomic(page, KM_USER0);
+ kaddr = kmap_atomic(page, KM_USER0);
/*
* For each 4 bytes, subtract the number of set bits. If this
* is the last page and it is partial we don't really care as
diff --git a/fs/ntfs/usnjrnl.c b/fs/ntfs/usnjrnl.c
index b2bc0d5..5c8fdd7 100644
--- a/fs/ntfs/usnjrnl.c
+++ b/fs/ntfs/usnjrnl.c
@@ -58,7 +58,7 @@ bool ntfs_stamp_usnjrnl(ntfs_volume *vol)
"$UsnJrnl/$DATA/$Max attribute.");
return false;
}
- uh = (USN_HEADER*)page_address(page);
+ uh = page_address(page);
stamp = get_current_ntfs_time();
ntfs_debug("Stamping transaction log ($UsnJrnl): old "
"journal_id 0x%llx, old lowest_valid_usn "

2009-04-08 14:06:04

by Will Newton

[permalink] [raw]
Subject: Re: [PATCH 20/56] inflate: Remove void casts

On Wed, Apr 8, 2009 at 2:54 PM, Jack Stone <[email protected]> wrote:
> Heres the fixed patch
>
> Thanks,
>
> Jack
>
> --
>
> inflate: Remove void casts
>
> From: Jack Stone <[email protected]>
>
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>
> ?lib/inflate.c | ? ?5 ++---
> ?1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/lib/inflate.c b/lib/inflate.c
> index 1a8e8a9..1eb0cd8 100644
> --- a/lib/inflate.c
> +++ b/lib/inflate.c
> @@ -249,7 +249,7 @@ static void *malloc(int size)
>
> ? ? ? ?malloc_ptr = (malloc_ptr + 3) & ~3; ? ? /* Align */
>
> - ? ? ? p = (void *)malloc_ptr;
> + ? ? ? p = malloc_ptr;
> ? ? ? ?malloc_ptr += size;

Won't this cause a "assignment makes pointer from integer without a
cast" warning?

> ? ? ? ?if (free_mem_end_ptr && malloc_ptr >= free_mem_end_ptr)
> @@ -481,8 +481,7 @@ DEBG1("3 ");
> ? ? ? ? z = 1 << j; ? ? ? ? ? ? /* table entries for j-bit table */
>
> ? ? ? ? /* allocate and link in new table */
> - ? ? ? ?if ((q = (struct huft *)malloc((z + 1)*sizeof(struct huft))) ==
> - ? ? ? ? ? ?(struct huft *)NULL)
> + ? ? ? ?if ((q = malloc((z + 1)*sizeof(struct huft))) == NULL)
> ? ? ? ? {
> ? ? ? ? ? if (h)
> ? ? ? ? ? ? huft_free(u[0]);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at ?http://www.tux.org/lkml/
>

2009-04-08 14:07:08

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 30/56] net: Remove void casts

Fixed patch

Thanks,

Jack

--

net: Remove void casts

From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---

drivers/net/arm/at91_ether.c | 2 +-
drivers/net/cassini.c | 3 +--
drivers/net/gianfar.c | 2 +-
drivers/net/ibmveth.c | 7 +++----
drivers/net/irda/au1k_ir.c | 3 +--
drivers/net/netxen/netxen_nic_init.c | 6 ++----
drivers/net/skfp/ess.c | 20 ++++++++++----------
drivers/net/skfp/hwmtm.c | 7 +++----
drivers/net/skfp/pmf.c | 4 ++--
drivers/net/skfp/smt.c | 3 +--
drivers/net/sungem.c | 3 +--
drivers/net/sunhme.c | 3 +--
drivers/net/via-velocity.c | 2 +-
drivers/net/wireless/ipw2x00/ipw2100.c | 4 +---
14 files changed, 29 insertions(+), 40 deletions(-)

diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c
index 442938d..c389b66 100644
--- a/drivers/net/arm/at91_ether.c
+++ b/drivers/net/arm/at91_ether.c
@@ -992,7 +992,7 @@ static int __init at91ether_setup(unsigned long
phy_type, unsigned short phy_add

/* Allocate memory for DMA Receive descriptors */
lp = netdev_priv(dev);
- lp->dlist = (struct recv_desc_bufs *) dma_alloc_coherent(NULL,
sizeof(struct recv_desc_bufs), (dma_addr_t *) &lp->dlist_phys, GFP_KERNEL);
+ lp->dlist = dma_alloc_coherent(NULL, sizeof(struct recv_desc_bufs),
(dma_addr_t *) &lp->dlist_phys, GFP_KERNEL);
if (lp->dlist == NULL) {
free_irq(dev->irq, dev);
free_netdev(dev);
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index f522276..620b783 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -5162,8 +5162,7 @@ static int __devinit cas_init_one(struct pci_dev
*pdev,
if (cas_saturn_firmware_init(cp))
goto err_out_iounmap;

- cp->init_block = (struct cas_init_block *)
- pci_alloc_consistent(pdev, sizeof(struct cas_init_block),
+ cp->init_block = pci_alloc_consistent(pdev, sizeof(struct
cas_init_block),
&cp->block_dvma);
if (!cp->init_block) {
dev_err(&pdev->dev, "Cannot allocate init block, aborting.\n");
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 65f5587..7a8885e 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -268,7 +268,7 @@ static int gfar_of_init(struct net_device *dev)
if (ph == NULL) {
u32 *fixed_link;

- fixed_link = (u32 *)of_get_property(np, "fixed-link", NULL);
+ fixed_link = of_get_property(np, "fixed-link", NULL);
if (!fixed_link) {
err = -ENODEV;
goto err_out;
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index 5c6315d..6ce7190 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -1218,16 +1218,15 @@ static int __devinit ibmveth_probe(struct
vio_dev *dev, const struct vio_device_
ibmveth_debug_printk_no_adapter("entering ibmveth_probe for UA 0x%x\n",
dev->unit_address);

- mac_addr_p = (unsigned char *) vio_get_attribute(dev,
- VETH_MAC_ADDR, NULL);
+ mac_addr_p = vio_get_attribute(dev, VETH_MAC_ADDR, NULL);
if(!mac_addr_p) {
printk(KERN_ERR "(%s:%3.3d) ERROR: Can't find VETH_MAC_ADDR "
"attribute\n", __FILE__, __LINE__);
return 0;
}

- mcastFilterSize_p = (unsigned int *) vio_get_attribute(dev,
- VETH_MCAST_FILTER_SIZE, NULL);
+ mcastFilterSize_p = vio_get_attribute(dev, VETH_MCAST_FILTER_SIZE,
+ NULL);
if(!mcastFilterSize_p) {
printk(KERN_ERR "(%s:%3.3d) ERROR: Can't find "
"VETH_MCAST_FILTER_SIZE attribute\n",
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c
index 9411640..b4a6ad8 100644
--- a/drivers/net/irda/au1k_ir.c
+++ b/drivers/net/irda/au1k_ir.c
@@ -234,8 +234,7 @@ static int au1k_irda_net_init(struct net_device *dev)
goto out2;

/* allocate the data buffers */
- aup->db[0].vaddr =
- (void *)dma_alloc(MAX_BUF_SIZE * 2*NUM_IR_DESC, &temp);
+ aup->db[0].vaddr = dma_alloc(MAX_BUF_SIZE * 2*NUM_IR_DESC, &temp);
if (!aup->db[0].vaddr)
goto out3;

diff --git a/drivers/net/netxen/netxen_nic_init.c
b/drivers/net/netxen/netxen_nic_init.c
index 0759c35..9b56b37 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -230,8 +230,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter
*adapter)
struct netxen_cmd_buffer *cmd_buf_arr;
struct net_device *netdev = adapter->netdev;

- cmd_buf_arr =
- (struct netxen_cmd_buffer *)vmalloc(TX_BUFF_RINGSIZE(adapter));
+ cmd_buf_arr = vmalloc(TX_BUFF_RINGSIZE(adapter));
if (cmd_buf_arr == NULL) {
printk(KERN_ERR "%s: Failed to allocate cmd buffer ring\n",
netdev->name);
@@ -277,8 +276,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter
*adapter)
break;

}
- rds_ring->rx_buf_arr = (struct netxen_rx_buffer *)
- vmalloc(RCV_BUFF_RINGSIZE(rds_ring));
+ rds_ring->rx_buf_arr = vmalloc(RCV_BUFF_RINGSIZE(rds_ring));
if (rds_ring->rx_buf_arr == NULL) {
printk(KERN_ERR "%s: Failed to allocate "
"rx buffer ring %d\n",
diff --git a/drivers/net/skfp/ess.c b/drivers/net/skfp/ess.c
index a85efcf..5ec0413 100644
--- a/drivers/net/skfp/ess.c
+++ b/drivers/net/skfp/ess.c
@@ -133,7 +133,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf
*mb, struct smt_header *sm,
/*
* get the resource type
*/
- if (!(p = (void *) sm_to_para(smc,sm,SMT_P0015))) {
+ if (!(p = sm_to_para(smc,sm,SMT_P0015))) {
DB_ESS("ESS: RAF frame error, parameter type not found\n",0,0) ;
return(fs) ;
}
@@ -142,7 +142,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf
*mb, struct smt_header *sm,
/*
* get the pointer to the ESS command
*/
- if (!(cmd = (struct smt_p_0016 *) sm_to_para(smc,sm,SMT_P0016))) {
+ if (!(cmd = sm_to_para(smc,sm,SMT_P0016))) {
/*
* error in frame: para ESS command was not found
*/
@@ -177,7 +177,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf
*mb, struct smt_header *sm,
if (!local || smc->mib.fddiESSPayload)
return(fs) ;

- p = (void *) sm_to_para(smc,sm,SMT_P0019) ;
+ p = sm_to_para(smc,sm,SMT_P0019) ;
for (i = 0; i < 5; i++) {
if (((struct smt_p_0019 *)p)->alloc_addr.a[i]) {
return(fs) ;
@@ -190,10 +190,10 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf
*mb, struct smt_header *sm,
*/
smc->ess.alloc_trans_id = sm->smt_tid ;
DB_ESS("ESS: save Alloc Req Trans ID %lx\n",sm->smt_tid,0);
- p = (void *) sm_to_para(smc,sm,SMT_P320F) ;
+ p = sm_to_para(smc,sm,SMT_P320F) ;
((struct smt_p_320f *)p)->mib_payload =
smc->mib.a[PATH0].fddiPATHSbaPayload ;
- p = (void *) sm_to_para(smc,sm,SMT_P3210) ;
+ p = sm_to_para(smc,sm,SMT_P3210) ;
((struct smt_p_3210 *)p)->mib_overhead =
smc->mib.a[PATH0].fddiPATHSbaOverhead ;
sm->smt_dest = smt_sba_da ;
@@ -248,13 +248,13 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf
*mb, struct smt_header *sm,
/*
* Extract message parameters
*/
- p = (void *) sm_to_para(smc,sm,SMT_P320F) ;
+ p = sm_to_para(smc,sm,SMT_P320F) ;
if (!p) {
printk(KERN_ERR "ESS: sm_to_para failed");
return fs;
}
payload = ((struct smt_p_320f *)p)->mib_payload ;
- p = (void *) sm_to_para(smc,sm,SMT_P3210) ;
+ p = sm_to_para(smc,sm,SMT_P3210) ;
if (!p) {
printk(KERN_ERR "ESS: sm_to_para failed");
return fs;
@@ -306,9 +306,9 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf
*mb, struct smt_header *sm,
/*
* Extract message queue parameters
*/
- p = (void *) sm_to_para(smc,sm,SMT_P320F) ;
+ p = sm_to_para(smc,sm,SMT_P320F) ;
payload = ((struct smt_p_320f *)p)->mib_payload ;
- p = (void *) sm_to_para(smc,sm,SMT_P3210) ;
+ p = sm_to_para(smc,sm,SMT_P3210) ;
overhead = ((struct smt_p_3210 *)p)->mib_overhead ;

DB_ESSN(2,"ESS: Change Request from %s\n",
@@ -529,7 +529,7 @@ static void ess_send_response(struct s_smc *smc,
struct smt_header *sm,
/* set P1A */
chg->cat.para.p_type = SMT_P001A ;
chg->cat.para.p_len = sizeof(struct smt_p_001a) - PARA_LEN ;
- p = (void *) sm_to_para(smc,sm,SMT_P001A) ;
+ p = sm_to_para(smc,sm,SMT_P001A) ;
chg->cat.category = ((struct smt_p_001a *)p)->category ;
}
dump_smt(smc,(struct smt_header *)chg,"RAF") ;
diff --git a/drivers/net/skfp/hwmtm.c b/drivers/net/skfp/hwmtm.c
index d322f1b..1b8d418 100644
--- a/drivers/net/skfp/hwmtm.c
+++ b/drivers/net/skfp/hwmtm.c
@@ -268,8 +268,7 @@ int mac_drv_init(struct s_smc *smc)
/*
* get the required memory for the RxDs and TxDs
*/
- if (!(smc->os.hwm.descr_p = (union s_fp_descr volatile *)
- mac_drv_get_desc_mem(smc,(u_int)
+ if (!(smc->os.hwm.descr_p = mac_drv_get_desc_mem(smc,(u_int)
(RXD_TXD_COUNT+1)*sizeof(struct s_smt_fp_txd)))) {
return(1) ; /* no space the hwm modul can't work */
}
@@ -281,13 +280,13 @@ int mac_drv_init(struct s_smc *smc)
smc->os.hwm.mbuf_pool.mb_start=(SMbuf
*)(&smc->os.hwm.mbuf_pool.mb[0]) ;
#else
#ifndef COMMON_MB_POOL
- if (!(smc->os.hwm.mbuf_pool.mb_start = (SMbuf *) mac_drv_get_space(smc,
+ if (!(smc->os.hwm.mbuf_pool.mb_start = mac_drv_get_space(smc,
MAX_MBUF*sizeof(SMbuf)))) {
return(1) ; /* no space the hwm modul can't work */
}
#else
if (!mb_start) {
- if (!(mb_start = (SMbuf *) mac_drv_get_space(smc,
+ if (!(mb_start = mac_drv_get_space(smc,
MAX_MBUF*sizeof(SMbuf)))) {
return(1) ; /* no space the hwm modul can't work */
}
diff --git a/drivers/net/skfp/pmf.c b/drivers/net/skfp/pmf.c
index 79e665e..87613b7 100644
--- a/drivers/net/skfp/pmf.c
+++ b/drivers/net/skfp/pmf.c
@@ -520,7 +520,7 @@ static int smt_authorize(struct s_smc *smc, struct
smt_header *sm)
for (i = 0 ; i < 8 && !p[i] ; i++)
;
if (i != 8) {
- pa = (struct smt_para *) sm_to_para(smc,sm,SMT_P_AUTHOR) ;
+ pa = sm_to_para(smc,sm,SMT_P_AUTHOR) ;
if (!pa)
return(1) ;
if (pa->p_len != 8)
@@ -536,7 +536,7 @@ static int smt_check_set_count(struct s_smc *smc,
struct smt_header *sm)
struct smt_para *pa ;
struct smt_p_setcount *sc ;

- pa = (struct smt_para *) sm_to_para(smc,sm,SMT_P1035) ;
+ pa = sm_to_para(smc,sm,SMT_P1035) ;
if (pa) {
sc = (struct smt_p_setcount *) pa ;
if ((smc->mib.fddiSMTSetCount.count != sc->count) ||
diff --git a/drivers/net/skfp/smt.c b/drivers/net/skfp/smt.c
index 83d16fe..a4acc6c 100644
--- a/drivers/net/skfp/smt.c
+++ b/drivers/net/skfp/smt.c
@@ -603,8 +603,7 @@ void smt_received_pack(struct s_smc *smc, SMbuf *mb,
int fs)
smt_echo_test(smc,0) ;
}
smc->sm.smt_tvu = smt_get_time() ;
- st = (struct smt_p_state *)
- sm_to_para(smc,sm,SMT_P_STATE) ;
+ st = sm_to_para(smc,sm,SMT_P_STATE) ;
if (st) {
smc->mib.m[MAC0].fddiMACUNDA_Flag =
(st->st_dupl_addr & SMT_ST_MY_DUPA) ?
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index d2dfe0a..4de10ce 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -3145,8 +3145,7 @@ static int __devinit gem_init_one(struct pci_dev
*pdev,
/* It is guaranteed that the returned buffer will be at least
* PAGE_SIZE aligned.
*/
- gp->init_block = (struct gem_init_block *)
- pci_alloc_consistent(pdev, sizeof(struct gem_init_block),
+ gp->init_block = pci_alloc_consistent(pdev, sizeof(struct
gem_init_block),
&gp->gblock_dvma);
if (!gp->init_block) {
printk(KERN_ERR PFX "Cannot allocate init block, "
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index 4e9bd38..814ea78 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -3091,8 +3091,7 @@ static int __devinit happy_meal_pci_probe(struct
pci_dev *pdev,
hp->happy_bursts = DMA_BURSTBITS;
#endif

- hp->happy_block = (struct hmeal_init_block *)
- dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &hp->hblock_dvma,
GFP_KERNEL);
+ hp->happy_block = dma_alloc_coherent(&pdev->dev, PAGE_SIZE,
&hp->hblock_dvma, GFP_KERNEL);

err = -ENODEV;
if (!hp->happy_block) {
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index fb53ef8..a0b6386 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -2136,7 +2136,7 @@ static int velocity_xmit(struct sk_buff *skb,
struct net_device *dev)

for (i = 0; i < nfrags; i++) {
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
- void *addr = (void *)page_address(frag->page) +
frag->page_offset;
+ void *addr = (void *) page_address(frag->page) +
frag->page_offset;

tdinfo->skb_dma[i + 1] = pci_map_single(vptr->pdev,
addr, frag->size, PCI_DMA_TODEVICE);

diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c
b/drivers/net/wireless/ipw2x00/ipw2100.c
index 97e5647..2e3d7c1 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -4301,9 +4301,7 @@ static int status_queue_allocate(struct
ipw2100_priv *priv, int entries)
IPW_DEBUG_INFO("enter\n");

q->size = entries * sizeof(struct ipw2100_status);
- q->drv =
- (struct ipw2100_status *)pci_alloc_consistent(priv->pci_dev,
- q->size, &q->nic);
+ q->drv = pci_alloc_consistent(priv->pci_dev, q->size, &q->nic);
if (!q->drv) {
IPW_DEBUG_WARNING("Can not allocate status queue.\n");
return -ENOMEM;

2009-04-08 14:08:10

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 29/56] irda: Remove void casts

Fixed patch

Thanks,

Jack

--

irda: Remove void casts

From: Jack Stone <[email protected]>

Remove uneeded void casts

Signed-Off-By: Jack Stone <[email protected]>
---

net/irda/discovery.c | 4 ++--
net/irda/ircomm/ircomm_lmp.c | 2 +-
net/irda/iriap.c | 2 +-
net/irda/irnet/irnet_irda.c | 3 +--
4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/net/irda/discovery.c b/net/irda/discovery.c
index a6f99b5..7fdc346 100644
--- a/net/irda/discovery.c
+++ b/net/irda/discovery.c
@@ -130,11 +130,11 @@ void irlmp_add_discovery_log(hashbin_t *cachelog,
hashbin_t *log)
* no need to lock it.
* We just need to lock the global log in irlmp_add_discovery().
*/
- discovery = (discovery_t *) hashbin_remove_first(log);
+ discovery = hashbin_remove_first(log);
while (discovery != NULL) {
irlmp_add_discovery(cachelog, discovery);

- discovery = (discovery_t *) hashbin_remove_first(log);
+ discovery = hashbin_remove_first(log);
}

/* Delete the now empty log */
diff --git a/net/irda/ircomm/ircomm_lmp.c b/net/irda/ircomm/ircomm_lmp.c
index 67c99d2..6245b45 100644
--- a/net/irda/ircomm/ircomm_lmp.c
+++ b/net/irda/ircomm/ircomm_lmp.c
@@ -152,7 +152,7 @@ static void ircomm_lmp_flow_control(struct sk_buff *skb)

line = cb->line;

- self = (struct ircomm_cb *) hashbin_lock_find(ircomm, line, NULL);
+ self = hashbin_lock_find(ircomm, line, NULL);
if (!self) {
IRDA_DEBUG(2, "%s(), didn't find myself\n", __func__ );
return;
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index 4a105dc..12cb0e9 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -251,7 +251,7 @@ void iriap_close(struct iriap_cb *self)
self->lsap = NULL;
}

- entry = (struct iriap_cb *) hashbin_remove(iriap, (long) self, NULL);
+ entry = hashbin_remove(iriap, (long) self, NULL);
IRDA_ASSERT(entry == self, return;);

__iriap_close(self);
diff --git a/net/irda/irnet/irnet_irda.c b/net/irda/irnet/irnet_irda.c
index cf9a4b5..3a89247 100644
--- a/net/irda/irnet/irnet_irda.c
+++ b/net/irda/irnet/irnet_irda.c
@@ -766,8 +766,7 @@ irnet_find_socket(irnet_socket * self)
* requested that nickname */
if(err == 0)
{
- new = (irnet_socket *) hashbin_find(irnet_server.list,
- 0, self->rname);
+ new = hashbin_find(irnet_server.list, 0, self->rname);
if(new)
DEBUG(IRDA_SERV_INFO, "Socket 0x%p matches rname ``%s''.\n",
new, new->rname);

2009-04-08 14:08:45

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts


* Jack Stone <[email protected]> wrote:

> Fixed patch
>
> Thanks,

Hm, what was fixed?

> Signed-Off-By: Jack Stone <[email protected]>

Btw., the canonical format is Signed-off-by. (note the
capitalization)

Ingo

2009-04-08 14:16:23

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 20/56] inflate: Remove void casts

Will Newton wrote:
> On Wed, Apr 8, 2009 at 2:54 PM, Jack Stone <[email protected]> wrote:
>
>> lib/inflate.c | 5 ++---
>> 1 files changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/lib/inflate.c b/lib/inflate.c
>> index 1a8e8a9..1eb0cd8 100644
>> --- a/lib/inflate.c
>> +++ b/lib/inflate.c
>> @@ -249,7 +249,7 @@ static void *malloc(int size)
>>
>> malloc_ptr = (malloc_ptr + 3) & ~3; /* Align */
>>
>> - p = (void *)malloc_ptr;
>> + p = malloc_ptr;
>> malloc_ptr += size;
>>
>
> Won't this cause a "assignment makes pointer from integer without a
> cast" warning?
I don't think so. The cast had no effect as both malloc_ptr and p are
declared as void *. The later += size
does pointer arithmetic.

Thanks,

Jack

2009-04-08 14:18:30

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts

Ingo Molnar wrote:
> * Jack Stone <[email protected]> wrote:
>
>
>> Fixed patch
>>
>> Thanks,
>>
>
> Hm, what was fixed?
>
I removed casts on pointer arithmetic which probably still needed to be
there to do the arithmetic properly.
>> Signed-Off-By: Jack Stone <[email protected]>
>>
>
> Btw., the canonical format is Signed-off-by. (note the
> capitalization)
>
Will note for the future.

Thanks,

Jack

2009-04-08 14:19:26

by Will Newton

[permalink] [raw]
Subject: Re: [PATCH 20/56] inflate: Remove void casts

On Wed, Apr 8, 2009 at 3:12 PM, Jack Stone <[email protected]> wrote:
> Will Newton wrote:
>> On Wed, Apr 8, 2009 at 2:54 PM, Jack Stone <[email protected]> wrote:
>>
>>> ?lib/inflate.c | ? ?5 ++---
>>> ?1 files changed, 2 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/lib/inflate.c b/lib/inflate.c
>>> index 1a8e8a9..1eb0cd8 100644
>>> --- a/lib/inflate.c
>>> +++ b/lib/inflate.c
>>> @@ -249,7 +249,7 @@ static void *malloc(int size)
>>>
>>> ? ? ? ?malloc_ptr = (malloc_ptr + 3) & ~3; ? ? /* Align */
>>
>>> - ? ? ? p = (void *)malloc_ptr;
>>> + ? ? ? p = malloc_ptr;
>>> ? ? ? ?malloc_ptr += size;
>>>
>>
>> Won't this cause a "assignment makes pointer from integer without a
>> cast" warning?
> I don't think so. The cast had no effect as both malloc_ptr and p are
> declared as void *. The later += size
> does pointer arithmetic.

static unsigned long malloc_ptr;

Please compile test your code.

> Thanks,
>
> Jack
>

2009-04-08 14:27:23

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 20/56] inflate: Remove void casts

walter harms wrote:
> Bert Wesarg schrieb:
>
>> On Wed, Apr 8, 2009 at 13:21, Jack Stone <[email protected]> wrote:
>>
>>> Remove uneeded void casts
>>>
>>> Signed-Off-By: Jack Stone <[email protected]>
>>> ---
>>> lib/inflate.c | 4 ++--
>>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/lib/inflate.c b/lib/inflate.c
>>> index 1a8e8a9..4b672f9 100644
>>> --- a/lib/inflate.c
>>> +++ b/lib/inflate.c
>>> @@ -481,7 +481,7 @@ DEBG1("3 ");
>>> z = 1 << j; /* table entries for j-bit table */
>>>
>>> /* allocate and link in new table */
>>> - if ((q = (struct huft *)malloc((z + 1)*sizeof(struct huft))) ==
>>> + if ((q = malloc((z + 1)*sizeof(struct huft))) ==
>>> (struct huft *)NULL)
>>>
> and move the q= from the if. less than half the size.
>
> q = malloc( (z + 1)*sizeof(*q) ):
> if ( q == NULL )
>
I was avoiding that sort of thing as this patch series is large enough
as it is.

Thanks,

Jack

2009-04-08 14:41:22

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts


* Jack Stone <[email protected]> wrote:

> Ingo Molnar wrote:
> > * Jack Stone <[email protected]> wrote:
> >
> >
> >> Fixed patch
> >>
> >> Thanks,
> >>
> >
> > Hm, what was fixed?
> >
> I removed casts on pointer arithmetic which probably still needed to be
> there to do the arithmetic properly.

... which pretty much proves the point that these patches should not
go via any "trivial" tree.

Those additions of mmu pointers you did were outright lethal, i
doubt this stuff could have booted on both 32-bit and 64-bit x86.

Please dont do this. Or if you do, please double check your change
and double check that the relevant vmlinux disassembly is still bit
for bit the same.

Ingo

2009-04-08 14:42:39

by walter harms

[permalink] [raw]
Subject: Re: [PATCH 20/56] inflate: Remove void casts



Bert Wesarg schrieb:
> On Wed, Apr 8, 2009 at 13:21, Jack Stone <[email protected]> wrote:
>> Remove uneeded void casts
>>
>> Signed-Off-By: Jack Stone <[email protected]>
>> ---
>> lib/inflate.c | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/lib/inflate.c b/lib/inflate.c
>> index 1a8e8a9..4b672f9 100644
>> --- a/lib/inflate.c
>> +++ b/lib/inflate.c
>> @@ -249,7 +249,7 @@ static void *malloc(int size)
>>
>> malloc_ptr = (malloc_ptr + 3) & ~3; /* Align */
>>
>> - p = (void *)malloc_ptr;
>> + p = malloc_ptr;
>> malloc_ptr += size;
>>
>> if (free_mem_end_ptr && malloc_ptr >= free_mem_end_ptr)
>> @@ -481,7 +481,7 @@ DEBG1("3 ");
>> z = 1 << j; /* table entries for j-bit table */
>>
>> /* allocate and link in new table */
>> - if ((q = (struct huft *)malloc((z + 1)*sizeof(struct huft))) ==
>> + if ((q = malloc((z + 1)*sizeof(struct huft))) ==
>> (struct huft *)NULL)
> Thats an unneeded cast too. (After that, the NULL can move up one line.)
>
> Bert
>> {
>> if (h)

and move the q= from the if. less than half the size.

q = malloc( (z + 1)*sizeof(*q) ):
if ( q == NULL )

re,
wh




2009-04-08 14:46:53

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts

Ingo Molnar wrote:
> * Jack Stone <[email protected]> wrote:
>
>
>> Ingo Molnar wrote:
>>
>>> * Jack Stone <[email protected]> wrote:
>>>
>>>
>>>
>>>> Fixed patch
>>>>
>>>> Thanks,
>>>>
>>>>
>>> Hm, what was fixed?
>>>
>>>
>> I removed casts on pointer arithmetic which probably still needed to be
>> there to do the arithmetic properly.
>>
>
> ... which pretty much proves the point that these patches should not
> go via any "trivial" tree.
>
> Those additions of mmu pointers you did were outright lethal, i
> doubt this stuff could have booted on both 32-bit and 64-bit x86.
>
> Please dont do this. Or if you do, please double check your change
> and double check that the relevant vmlinux disassembly is still bit
> for bit the same.
>

Thats what I meant by fixed - those changes were removed from the patch.

Thanks,

Jack

2009-04-08 14:49:22

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts


* Jack Stone <[email protected]> wrote:

> Ingo Molnar wrote:
> > * Jack Stone <[email protected]> wrote:
> >
> >
> >> Ingo Molnar wrote:
> >>
> >>> * Jack Stone <[email protected]> wrote:
> >>>
> >>>
> >>>
> >>>> Fixed patch
> >>>>
> >>>> Thanks,
> >>>>
> >>>>
> >>> Hm, what was fixed?
> >>>
> >>>
> >> I removed casts on pointer arithmetic which probably still needed to be
> >> there to do the arithmetic properly.
> >>
> >
> > ... which pretty much proves the point that these patches should
> > not go via any "trivial" tree.
> >
> > Those additions of mmu pointers you did were outright lethal, i
> > doubt this stuff could have booted on both 32-bit and 64-bit
> > x86.
> >
> > Please dont do this. Or if you do, please double check your
> > change and double check that the relevant vmlinux disassembly is
> > still bit for bit the same.
> >
>
> Thats what I meant by fixed - those changes were removed from the
> patch.

No, i mean, this approach should be changed, and i dont think any
type cast change should go via any trivial tree. It's easy to mess
it up. Please submit them to the maintainer trees.

Ingo

2009-04-08 14:53:45

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts

Ingo Molnar wrote:
> No, i mean, this approach should be changed, and i dont think any
> type cast change should go via any trivial tree. It's easy to mess
> it up. Please submit them to the maintainer trees
Ok. I'll try and find appropriate CCs. I'm going out shortly so it might
take me a while.

Thanks,

Jack

2009-04-08 14:57:43

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts


* Jack Stone <[email protected]> wrote:

> Ingo Molnar wrote:
> > No, i mean, this approach should be changed, and i dont think any
> > type cast change should go via any trivial tree. It's easy to mess
> > it up. Please submit them to the maintainer trees
>
> Ok. I'll try and find appropriate CCs. I'm going out shortly so it
> might take me a while.

Since you do many such patches it might make sense to script up a
"who maintains what" kind of script - and share that script with
lkml.

I have this silly little script:

git log $@ | grep Signed-off-by: |
cut -d: -f2 | cut -d\< -f1 |
sort | uniq -c | sort -n

To find out any recent parties that touches a particular file. But
it would be nice to somehow automate the pickup of mailing-list
addresses from MAINTAINERS for example. We've literally got hundreds
of email lists there.

It is not trivial to do though :-)

Ingo

2009-04-08 15:00:22

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts

Ingo Molnar wrote:
> * Jack Stone <[email protected]> wrote:
>
>
>> Ingo Molnar wrote:
>>
>>> No, i mean, this approach should be changed, and i dont think any
>>> type cast change should go via any trivial tree. It's easy to mess
>>> it up. Please submit them to the maintainer trees
>>>
>> Ok. I'll try and find appropriate CCs. I'm going out shortly so it
>> might take me a while.
>>
>
> Since you do many such patches it might make sense to script up a
> "who maintains what" kind of script - and share that script with
> lkml.
>
> I have this silly little script:
>
> git log $@ | grep Signed-off-by: |
> cut -d: -f2 | cut -d\< -f1 |
> sort | uniq -c | sort -n
>
> To find out any recent parties that touches a particular file. But
> it would be nice to somehow automate the pickup of mailing-list
> addresses from MAINTAINERS for example. We've literally got hundreds
> of email lists there.
>
> It is not trivial to do though :-)
>
It would be useful. The main problem is working out what files belong to
what MAINTAINERS entries.

I'll see what I can cook up.

Thanks,

Jack

2009-04-08 15:05:31

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts

Jack Stone wrote:
> Ingo Molnar wrote:
>
>> * Jack Stone <[email protected]> wrote:
>>
>>
>>
>>> Ingo Molnar wrote:
>>>
>>>
>>>> No, i mean, this approach should be changed, and i dont think any
>>>> type cast change should go via any trivial tree. It's easy to mess
>>>> it up. Please submit them to the maintainer trees
>>>>
>>>>
>>> Ok. I'll try and find appropriate CCs. I'm going out shortly so it
>>> might take me a while.
>>>
>>>
>> Since you do many such patches it might make sense to script up a
>> "who maintains what" kind of script - and share that script with
>> lkml.
>>
>> I have this silly little script:
>>
>> git log $@ | grep Signed-off-by: |
>> cut -d: -f2 | cut -d\< -f1 |
>> sort | uniq -c | sort -n
>>
>> To find out any recent parties that touches a particular file. But
>> it would be nice to somehow automate the pickup of mailing-list
>> addresses from MAINTAINERS for example. We've literally got hundreds
>> of email lists there.
>>
>> It is not trivial to do though :-)
>>
>>
> It would be useful. The main problem is working out what files belong to
> what MAINTAINERS entries.
>
> I'll see what I can cook up.
>
> Thanks,
>
> Jack
>
Look what turned up!

http://marc.info/?l=linux-kernel&m=123916809504492&w=2

Thanks,

Jack

2009-04-08 15:07:53

by Julia Lawall

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts

On Wed, 8 Apr 2009, Jack Stone wrote:

> Ingo Molnar wrote:
> > * Jack Stone <[email protected]> wrote:
> >
> >
> >> Ingo Molnar wrote:
> >>
> >>> No, i mean, this approach should be changed, and i dont think any
> >>> type cast change should go via any trivial tree. It's easy to mess
> >>> it up. Please submit them to the maintainer trees
> >>>
> >> Ok. I'll try and find appropriate CCs. I'm going out shortly so it
> >> might take me a while.
> >>
> >
> > Since you do many such patches it might make sense to script up a
> > "who maintains what" kind of script - and share that script with
> > lkml.
> >
> > I have this silly little script:
> >
> > git log $@ | grep Signed-off-by: |
> > cut -d: -f2 | cut -d\< -f1 |
> > sort | uniq -c | sort -n
> >
> > To find out any recent parties that touches a particular file. But
> > it would be nice to somehow automate the pickup of mailing-list
> > addresses from MAINTAINERS for example. We've literally got hundreds
> > of email lists there.
> >
> > It is not trivial to do though :-)
> >
> It would be useful. The main problem is working out what files belong to
> what MAINTAINERS entries.
>
> I'll see what I can cook up.

This can be helpful: http://lwn.net/Articles/284469/

It's a bit out of date, though, because git-blame seems to have
disappeared as a command.

julia

2009-04-08 15:10:57

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts

On Wed, Apr 08, 2009 at 05:06:57PM +0200, Julia Lawall wrote:
> This can be helpful: http://lwn.net/Articles/284469/
>
> It's a bit out of date, though, because git-blame seems to have
> disappeared as a command.

Are you just getting confused by the removal of the 'git-foo' form?

'git blame' works, and I see:
$ dpkg -S /usr/lib/git-core/git-blame
git-core: /usr/lib/git-core/git-blame

--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."

2009-04-08 15:13:57

by Julia Lawall

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts

On Wed, 8 Apr 2009, Matthew Wilcox wrote:

> On Wed, Apr 08, 2009 at 05:06:57PM +0200, Julia Lawall wrote:
> > This can be helpful: http://lwn.net/Articles/284469/
> >
> > It's a bit out of date, though, because git-blame seems to have
> > disappeared as a command.
>
> Are you just getting confused by the removal of the 'git-foo' form?
>
> 'git blame' works, and I see:
> $ dpkg -S /usr/lib/git-core/git-blame
> git-core: /usr/lib/git-core/git-blame

I just meant that the script uses git-blame, rather than git blame, so one
has to edit it a bit to make it work (on gentoo at least).

But anyway the link sent by Jack looks even more useful.

julia

2009-04-08 15:18:19

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts


* Jack Stone <[email protected]> wrote:

> Ingo Molnar wrote:
>
> > Since you do many such patches it might make sense to script up
> > a "who maintains what" kind of script - and share that script
> > with lkml.
> >
> > I have this silly little script:
> >
> > git log $@ | grep Signed-off-by: |
> > cut -d: -f2 | cut -d\< -f1 |
> > sort | uniq -c | sort -n
> >
> > To find out any recent parties that touches a particular file.
> > But it would be nice to somehow automate the pickup of
> > mailing-list addresses from MAINTAINERS for example. We've
> > literally got hundreds of email lists there.
> >
> > It is not trivial to do though :-)
>
> It would be useful. The main problem is working out what files
> belong to what MAINTAINERS entries.
>
> I'll see what I can cook up.

In theory we could put regex patterns into MAINTAINERS. Something
like this:

LOCKDEP AND LOCKSTAT
P: Peter Zijlstra
M: [email protected]
P: Ingo Molnar
M: [email protected]
L: [email protected]
T: git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep.git
F: kernel/lock*
F: include/linux/lockdep.h
S: Maintained

Note: there are files that fall under multiple maintainers so this
wouldnt be a 'precise' thing - but it would sure be useful.

( There's also other details like subdirectories within a larger
hiearchy and there being overlap between problems. Sometimes they
are sub-maintained, sometimes they are exclusive so pure glob
patterns are probably not enough. )

If this concept looks good to you ... i'd suggest that before you do
a large patch against MAINTAINERS mapping all the maintainer
domains, could you just do it for a few cases and send an RFC patch
to lkml?

If there's a general upstream buy-in and a there's a
scripts/list-maintainers.sh script that takes advantage of it then
all this would be rather useful. (and i've Cc:-ed Andrew and Linus -
if this is to be shot down due to fundamental objections then better
do it at the early stages ;-)

Plus checkpatch could be extended to check whether the Cc: list in a
patch properly matches the patterns in MAINTAINERS.

If done propery this would save us from quite a few mechanic "hm,
who maintains _that_ file??" searches and it would also save
maintainers from quite a few "hm, who queued up _that_ crap without
Cc:-ing me??" moments.

Thanks,

Ingo

2009-04-08 17:48:41

by Roland Dreier

[permalink] [raw]
Subject: Re: [PATCH 17/56] infiniband: Remove void casts

Will review and take via my tree... at first glance all look OK.

Thanks,
Roland

2009-04-08 20:46:18

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts

Ingo Molnar wrote:
> In theory we could put regex patterns into MAINTAINERS. Something
> like this:
>
> LOCKDEP AND LOCKSTAT
> P: Peter Zijlstra
> M: [email protected]
> P: Ingo Molnar
> M: [email protected]
> L: [email protected]
> T: git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep.git
> F: kernel/lock*
> F: include/linux/lockdep.h
> S: Maintained
>
> Note: there are files that fall under multiple maintainers so this
> wouldnt be a 'precise' thing - but it would sure be useful.
>
> ( There's also other details like subdirectories within a larger
> hiearchy and there being overlap between problems. Sometimes they
> are sub-maintained, sometimes they are exclusive so pure glob
> patterns are probably not enough. )
>
> If this concept looks good to you ... i'd suggest that before you do
> a large patch against MAINTAINERS mapping all the maintainer
> domains, could you just do it for a few cases and send an RFC patch
> to lkml?
>
> If there's a general upstream buy-in and a there's a
> scripts/list-maintainers.sh script that takes advantage of it then
> all this would be rather useful. (and i've Cc:-ed Andrew and Linus -
> if this is to be shot down due to fundamental objections then better
> do it at the early stages ;-)
>
> Plus checkpatch could be extended to check whether the Cc: list in a
> patch properly matches the patterns in MAINTAINERS.
>
> If done propery this would save us from quite a few mechanic "hm,
> who maintains _that_ file??" searches and it would also save
> maintainers from quite a few "hm, who queued up _that_ crap without
> Cc:-ing me??" moments.
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
That has already been done. Someone just so happened to submit
such a patch today.

http://marc.info/?l=linux-kernel&m=123916809504492&w=2

Thanks,

Jack

2009-04-08 22:07:45

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts

On Wed, 2009-04-08 at 21:45 +0100, Jack Stone wrote:
> That has already been done. Someone just so happened to submit
> such a patch today.
> http://marc.info/?l=linux-kernel&m=123916809504492&w=2

It's been floating around for awhile now.

If you're using git send-email, you could try adding
--cc-cmd "scripts/get_maintainer.pl patchfile"

Here are some descriptions of available options
http://lkml.org/lkml/2008/10/27/479

Let me know how it works for you.

cheers, Joe

2009-04-09 05:13:55

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts


* Jack Stone <[email protected]> wrote:

> Ingo Molnar wrote:
> > In theory we could put regex patterns into MAINTAINERS. Something
> > like this:
> >
> > LOCKDEP AND LOCKSTAT
> > P: Peter Zijlstra
> > M: [email protected]
> > P: Ingo Molnar
> > M: [email protected]
> > L: [email protected]
> > T: git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep.git
> > F: kernel/lock*
> > F: include/linux/lockdep.h
> > S: Maintained
> >
> > Note: there are files that fall under multiple maintainers so this
> > wouldnt be a 'precise' thing - but it would sure be useful.
> >
> > ( There's also other details like subdirectories within a larger
> > hiearchy and there being overlap between problems. Sometimes they
> > are sub-maintained, sometimes they are exclusive so pure glob
> > patterns are probably not enough. )
> >
> > If this concept looks good to you ... i'd suggest that before you do
> > a large patch against MAINTAINERS mapping all the maintainer
> > domains, could you just do it for a few cases and send an RFC patch
> > to lkml?
> >
> > If there's a general upstream buy-in and a there's a
> > scripts/list-maintainers.sh script that takes advantage of it then
> > all this would be rather useful. (and i've Cc:-ed Andrew and Linus -
> > if this is to be shot down due to fundamental objections then better
> > do it at the early stages ;-)
> >
> > Plus checkpatch could be extended to check whether the Cc: list in a
> > patch properly matches the patterns in MAINTAINERS.
> >
> > If done propery this would save us from quite a few mechanic "hm,
> > who maintains _that_ file??" searches and it would also save
> > maintainers from quite a few "hm, who queued up _that_ crap without
> > Cc:-ing me??" moments.
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
> That has already been done. Someone just so happened to submit
> such a patch today.
>
> http://marc.info/?l=linux-kernel&m=123916809504492&w=2

Ah, nice! I'll have a look.

Ingo

2009-04-09 09:39:26

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 04/56] befs: Remove void casts

[Added maintainer CC]

Jack Stone wrote:
> Heres the fixed patch
>
> Thanks
>
> Jack
>
> befs: Remove void casts
>
> From: Jack Stone <[email protected]>
>
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>
> fs/befs/linuxvfs.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
> index 76afd0d..e8b56a1 100644
> --- a/fs/befs/linuxvfs.c
> +++ b/fs/befs/linuxvfs.c
> @@ -277,8 +277,7 @@ static struct inode *
> befs_alloc_inode(struct super_block *sb)
> {
> struct befs_inode_info *bi;
> - bi = (struct befs_inode_info *)kmem_cache_alloc(befs_inode_cachep,
> - GFP_KERNEL);
> + bi = kmem_cache_alloc(befs_inode_cachep, GFP_KERNEL);
> if (!bi)
> return NULL;
> return &bi->vfs_inode;
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2009-04-09 09:42:01

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 02/56] alpha: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> arch/alpha/boot/bootpz.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/alpha/boot/bootpz.c b/arch/alpha/boot/bootpz.c
> index 1036b51..6e7af60 100644
> --- a/arch/alpha/boot/bootpz.c
> +++ b/arch/alpha/boot/bootpz.c
> @@ -129,7 +129,7 @@ pal_init(void)
> pcb_va->flags = 1;
> pcb_va->res1 = 0;
> pcb_va->res2 = 0;
> - pcb_pa = (struct pcb_struct *)find_pa((unsigned long)pcb_va);
> + pcb_pa = find_pa((unsigned long)pcb_va);
>
> /*
> * a0 = 2 (OSF)
>

2009-04-09 09:43:23

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 03/56] atm: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> drivers/atm/lanai.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
> index cf97c34..2c9d0da 100644
> --- a/drivers/atm/lanai.c
> +++ b/drivers/atm/lanai.c
> @@ -1459,7 +1459,7 @@ static int __devinit vcc_table_allocate(struct lanai_dev *lanai)
> return (lanai->vccs == NULL) ? -ENOMEM : 0;
> #else
> int bytes = (lanai->num_vci) * sizeof(struct lanai_vcc *);
> - lanai->vccs = (struct lanai_vcc **) vmalloc(bytes);
> + lanai->vccs = vmalloc(bytes);
> if (unlikely(lanai->vccs == NULL))
> return -ENOMEM;
> memset(lanai->vccs, 0, bytes);
>

2009-04-09 09:44:19

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 05/56] block: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> drivers/block/amiflop.c | 2 +-
> drivers/block/cciss.c | 11 ++++-------
> drivers/block/cciss_scsi.c | 3 +--
> drivers/block/cpqarray.c | 2 +-
> drivers/block/sx8.c | 2 +-
> drivers/block/viodasd.c | 3 +--
> 6 files changed, 9 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
> index 8df436f..702667b 100644
> --- a/drivers/block/amiflop.c
> +++ b/drivers/block/amiflop.c
> @@ -1727,7 +1727,7 @@ static int __init amiga_floppy_init(void)
> }
>
> ret = -ENOMEM;
> - if ((raw_buf = (char *)amiga_chip_alloc (RAW_BUF_SIZE, "Floppy")) ==
> + if ((raw_buf = amiga_chip_alloc (RAW_BUF_SIZE, "Floppy")) ==
> NULL) {
> printk("fd: cannot get chip mem buffer\n");
> goto out_memregion;
> diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
> index 0ef6f08..0c4747a 100644
> --- a/drivers/block/cciss.c
> +++ b/drivers/block/cciss.c
> @@ -452,7 +452,7 @@ static CommandList_struct *cmd_alloc(ctlr_info_t *h, int get_from_pool)
> dma_addr_t cmd_dma_handle, err_dma_handle;
>
> if (!get_from_pool) {
> - c = (CommandList_struct *) pci_alloc_consistent(h->pdev,
> + c = pci_alloc_consistent(h->pdev,
> sizeof(CommandList_struct), &cmd_dma_handle);
> if (c == NULL)
> return NULL;
> @@ -460,8 +460,7 @@ static CommandList_struct *cmd_alloc(ctlr_info_t *h, int get_from_pool)
>
> c->cmdindex = -1;
>
> - c->err_info = (ErrorInfo_struct *)
> - pci_alloc_consistent(h->pdev, sizeof(ErrorInfo_struct),
> + c->err_info = pci_alloc_consistent(h->pdev, sizeof(ErrorInfo_struct),
> &err_dma_handle);
>
> if (c->err_info == NULL) {
> @@ -3773,12 +3772,10 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
> hba[i]->cmd_pool_bits =
> kmalloc(DIV_ROUND_UP(hba[i]->nr_cmds, BITS_PER_LONG)
> * sizeof(unsigned long), GFP_KERNEL);
> - hba[i]->cmd_pool = (CommandList_struct *)
> - pci_alloc_consistent(hba[i]->pdev,
> + hba[i]->cmd_pool = pci_alloc_consistent(hba[i]->pdev,
> hba[i]->nr_cmds * sizeof(CommandList_struct),
> &(hba[i]->cmd_pool_dhandle));
> - hba[i]->errinfo_pool = (ErrorInfo_struct *)
> - pci_alloc_consistent(hba[i]->pdev,
> + hba[i]->errinfo_pool = pci_alloc_consistent(hba[i]->pdev,
> hba[i]->nr_cmds * sizeof(ErrorInfo_struct),
> &(hba[i]->errinfo_pool_dhandle));
> if ((hba[i]->cmd_pool_bits == NULL)
> diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
> index a3fd87b..1e997b2 100644
> --- a/drivers/block/cciss_scsi.c
> +++ b/drivers/block/cciss_scsi.c
> @@ -212,8 +212,7 @@ scsi_cmd_stack_setup(int ctlr, struct cciss_scsi_adapter_data_t *sa)
> // pci_alloc_consistent guarantees 32-bit DMA address will
> // be used
>
> - stk->pool = (struct cciss_scsi_cmd_stack_elem_t *)
> - pci_alloc_consistent(hba[ctlr]->pdev, size, &stk->cmd_pool_handle);
> + stk->pool = pci_alloc_consistent(hba[ctlr]->pdev, size, &stk->cmd_pool_handle);
>
> if (stk->pool == NULL) {
> printk("stk->pool is null\n");
> diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
> index ca268ca..207fbb6 100644
> --- a/drivers/block/cpqarray.c
> +++ b/drivers/block/cpqarray.c
> @@ -1353,7 +1353,7 @@ static cmdlist_t * cmd_alloc(ctlr_info_t *h, int get_from_pool)
> dma_addr_t cmd_dhandle;
>
> if (!get_from_pool) {
> - c = (cmdlist_t*)pci_alloc_consistent(h->pci_dev,
> + c = pci_alloc_consistent(h->pci_dev,
> sizeof(cmdlist_t), &cmd_dhandle);
> if(c==NULL)
> return NULL;
> diff --git a/drivers/block/sx8.c b/drivers/block/sx8.c
> index ff0448e..48c8bb4 100644
> --- a/drivers/block/sx8.c
> +++ b/drivers/block/sx8.c
> @@ -890,7 +890,7 @@ queue_one_request:
> */
>
> VPRINTK("build msg\n");
> - msg = (struct carm_msg_rw *) carm_ref_msg(host, crq->tag);
> + msg = carm_ref_msg(host, crq->tag);
>
> if (writing) {
> msg->type = CARM_MSG_WRITE;
> diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c
> index ecccf65..6e1210e 100644
> --- a/drivers/block/viodasd.c
> +++ b/drivers/block/viodasd.c
> @@ -285,8 +285,7 @@ static int send_request(struct request *req)
> ((u64)sg_dma_address(&sg[0])) << 32,
> sg_dma_len(&sg[0]));
> else {
> - bevent = (struct vioblocklpevent *)
> - vio_get_event_buffer(viomajorsubtype_blockio);
> + bevent = vio_get_event_buffer(viomajorsubtype_blockio);
> if (bevent == NULL) {
> printk(VIOD_KERN_WARNING
> "error allocating disk event buffer\n");
>

2009-04-09 09:45:00

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 06/56] cifs: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> fs/cifs/transport.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
> index 0ad3e2d..fb3bd00 100644
> --- a/fs/cifs/transport.c
> +++ b/fs/cifs/transport.c
> @@ -111,7 +111,7 @@ AllocOplockQEntry(struct inode *pinode, __u16 fid, struct cifsTconInfo *tcon)
> cERROR(1, ("Null parms passed to AllocOplockQEntry"));
> return NULL;
> }
> - temp = (struct oplock_q_entry *) kmem_cache_alloc(cifs_oplock_cachep,
> + temp = kmem_cache_alloc(cifs_oplock_cachep,
> GFP_KERNEL);
> if (temp == NULL)
> return temp;
>

2009-04-09 09:46:01

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 07/56] coda: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> fs/coda/inode.c | 2 +-
> fs/coda/upcall.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/coda/inode.c b/fs/coda/inode.c
> index 830f51a..a0407b3 100644
> --- a/fs/coda/inode.c
> +++ b/fs/coda/inode.c
> @@ -43,7 +43,7 @@ static struct kmem_cache * coda_inode_cachep;
> static struct inode *coda_alloc_inode(struct super_block *sb)
> {
> struct coda_inode_info *ei;
> - ei = (struct coda_inode_info *)kmem_cache_alloc(coda_inode_cachep, GFP_KERNEL);
> + ei = kmem_cache_alloc(coda_inode_cachep, GFP_KERNEL);
> if (!ei)
> return NULL;
> memset(&ei->c_fid, 0, sizeof(struct CodaFid));
> diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c
> index c274d94..0f2e171 100644
> --- a/fs/coda/upcall.c
> +++ b/fs/coda/upcall.c
> @@ -59,7 +59,7 @@ static void *alloc_upcall(int opcode, int size)
>
> #define UPARG(op)\
> do {\
> - inp = (union inputArgs *)alloc_upcall(op, insize); \
> + inp = alloc_upcall(op, insize); \
> if (IS_ERR(inp)) { return PTR_ERR(inp); }\
> outp = (union outputArgs *)(inp); \
> outsize = insize; \
>

2009-04-09 09:47:58

by Jack Stone

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

[Added maintainer CCs]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> 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;
> 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);
> 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);
> }
>
> iovlen = nooutpages + 6;
>

2009-04-09 09:50:16

by Jack Stone

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

Sorry I CCd the wrong patch. Here is the corrected version

Thanks,

Jack

Jack Stone wrote:
> Hi Jesper,
>
> That patch might be wrong. Here's a revised version:
>
> Thanks
>
> Jack
>
> cris: Remove void casts
>
> From: Jack Stone <[email protected]>
>
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>
> arch/cris/arch-v32/drivers/cryptocop.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/cris/arch-v32/drivers/cryptocop.c
> b/arch/cris/arch-v32/drivers/cryptocop.c
> index 67c61ea..f2ffabb 100644
> --- a/arch/cris/arch-v32/drivers/cryptocop.c
> +++ b/arch/cris/arch-v32/drivers/cryptocop.c
> @@ -2784,7 +2784,7 @@ static int cryptocop_ioctl_process(struct inode
> *inode, struct file *filp, unsig
> 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 {
>
>

2009-04-09 09:51:23

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 06/56] cifs: Remove void casts

Sorry I CCd the wrong patch. Here is the corrected version.

Thanks,

Jack

Jack Stone wrote:
> Fixed patch
>
> Thanks
>
> Jack
>
> --
>
> cifs: Remove void casts
>
> From: Jack Stone <[email protected]>
>
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>
> fs/cifs/transport.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
> index 0ad3e2d..86191b0 100644
> --- a/fs/cifs/transport.c
> +++ b/fs/cifs/transport.c
> @@ -111,8 +111,7 @@ AllocOplockQEntry(struct inode *pinode, __u16 fid,
> struct cifsTconInfo *tcon)
> cERROR(1, ("Null parms passed to AllocOplockQEntry"));
> return NULL;
> }
> - temp = (struct oplock_q_entry *) kmem_cache_alloc(cifs_oplock_cachep,
> - GFP_KERNEL);
> + temp = kmem_cache_alloc(cifs_oplock_cachep, GFP_KERNEL);
> if (temp == NULL)
> return temp;
> else {
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2009-04-09 09:53:10

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 10/56] ext2: Remove void casts

[Added maintainer CCs]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> fs/ext2/super.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/ext2/super.c b/fs/ext2/super.c
> index f983225..be6825a 100644
> --- a/fs/ext2/super.c
> +++ b/fs/ext2/super.c
> @@ -143,7 +143,7 @@ static struct kmem_cache * ext2_inode_cachep;
> static struct inode *ext2_alloc_inode(struct super_block *sb)
> {
> struct ext2_inode_info *ei;
> - ei = (struct ext2_inode_info *)kmem_cache_alloc(ext2_inode_cachep, GFP_KERNEL);
> + ei = kmem_cache_alloc(ext2_inode_cachep, GFP_KERNEL);
> if (!ei)
> return NULL;
> #ifdef CONFIG_EXT2_FS_POSIX_ACL
>

2009-04-09 09:54:29

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 11/56] freevxfs: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> fs/freevxfs/vxfs_inode.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/freevxfs/vxfs_inode.c b/fs/freevxfs/vxfs_inode.c
> index 03a6ea5..9811217 100644
> --- a/fs/freevxfs/vxfs_inode.c
> +++ b/fs/freevxfs/vxfs_inode.c
> @@ -138,7 +138,7 @@ __vxfs_iget(ino_t ino, struct inode *ilistp)
> if (!IS_ERR(pp)) {
> struct vxfs_inode_info *vip;
> struct vxfs_dinode *dip;
> - caddr_t kaddr = (char *)page_address(pp);
> + caddr_t kaddr = page_address(pp);
>
> if (!(vip = kmem_cache_alloc(vxfs_inode_cachep, GFP_KERNEL)))
> goto fail;
>

2009-04-09 09:55:24

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 12/56] hpfs: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> fs/hpfs/super.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c
> index fecf402..ab539dc 100644
> --- a/fs/hpfs/super.c
> +++ b/fs/hpfs/super.c
> @@ -164,7 +164,7 @@ static struct kmem_cache * hpfs_inode_cachep;
> static struct inode *hpfs_alloc_inode(struct super_block *sb)
> {
> struct hpfs_inode_info *ei;
> - ei = (struct hpfs_inode_info *)kmem_cache_alloc(hpfs_inode_cachep, GFP_NOFS);
> + ei = kmem_cache_alloc(hpfs_inode_cachep, GFP_NOFS);
> if (!ei)
> return NULL;
> ei->vfs_inode.i_version = 1;
>

2009-04-09 09:57:20

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 13/56] i2c: Remove void casts

[Added maintainer CCs]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> drivers/i2c/i2c-core.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index b6f3a0d..1578645 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -1510,7 +1510,7 @@ struct i2c_adapter* i2c_get_adapter(int id)
> struct i2c_adapter *adapter;
>
> mutex_lock(&core_lock);
> - adapter = (struct i2c_adapter *)idr_find(&i2c_adapter_idr, id);
> + adapter = idr_find(&i2c_adapter_idr, id);
> if (adapter && !try_module_get(adapter->owner))
> adapter = NULL;
>
>

2009-04-09 09:57:44

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 14/56] ia64: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> arch/ia64/kernel/mca_drv.c | 2 +-
> arch/ia64/mm/contig.c | 2 +-
> arch/ia64/mm/discontig.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c
> index f94aaa8..820f34e 100644
> --- a/arch/ia64/kernel/mca_drv.c
> +++ b/arch/ia64/kernel/mca_drv.c
> @@ -496,7 +496,7 @@ recover_from_read_error(slidx_table_t *slidx,
> u64 target_identifier;
> pal_min_state_area_t *pmsa;
> struct ia64_psr *psr1, *psr2;
> - ia64_fptr_t *mca_hdlr_bh = (ia64_fptr_t*)mca_handler_bhhook;
> + ia64_fptr_t *mca_hdlr_bh = mca_handler_bhhook;
>
> /* Is target address valid? */
> target_identifier = get_target_identifier(peidx);
> diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c
> index 0ee085e..e0d27b0 100644
> --- a/arch/ia64/mm/contig.c
> +++ b/arch/ia64/mm/contig.c
> @@ -272,7 +272,7 @@ paging_init (void)
> map_size = PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) *
> sizeof(struct page));
> vmalloc_end -= map_size;
> - vmem_map = (struct page *) vmalloc_end;
> + vmem_map = vmalloc_end;
> efi_memmap_walk(create_mem_map_page_table, NULL);
>
> /*
> diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
> index d85ba98..f3a45cd 100644
> --- a/arch/ia64/mm/discontig.c
> +++ b/arch/ia64/mm/discontig.c
> @@ -668,7 +668,7 @@ void __init paging_init(void)
> #ifdef CONFIG_VIRTUAL_MEM_MAP
> vmalloc_end -= PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) *
> sizeof(struct page));
> - vmem_map = (struct page *) vmalloc_end;
> + vmem_map = vmalloc_end;
> efi_memmap_walk(create_mem_map_page_table, NULL);
> printk("Virtual mem_map starts at 0x%p\n", vmem_map);
> #endif
>

2009-04-09 09:58:49

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 15/56] ide: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> drivers/ide/pmac.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
> index 052b9bf..f76e4e6 100644
> --- a/drivers/ide/pmac.c
> +++ b/drivers/ide/pmac.c
> @@ -1682,7 +1682,7 @@ static int __devinit pmac_ide_init_dma(ide_hwif_t *hwif,
> * The +2 is +1 for the stop command and +1 to allow for
> * aligning the start address to a multiple of 16 bytes.
> */
> - pmif->dma_table_cpu = (struct dbdma_cmd*)pci_alloc_consistent(
> + pmif->dma_table_cpu = pci_alloc_consistent(
> dev,
> (MAX_DCMDS + 2) * sizeof(struct dbdma_cmd),
> &hwif->dmatable_dma);
>

2009-04-09 09:59:26

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 18/56] isdn: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Respinned patch
>
> Thanks,
>
> Jack
>
> --
>
> isdn: Remove void casts
>
> From: Jack Stone <[email protected]>
>
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>
> drivers/isdn/hardware/eicon/capifunc.c | 2 +-
> drivers/isdn/hardware/eicon/diddfunc.c | 2 +-
> drivers/isdn/hardware/eicon/divasfunc.c | 2 +-
> drivers/isdn/hardware/eicon/divasi.c | 34
> +++++++++----------------------
> drivers/isdn/hardware/eicon/idifunc.c | 2 +-
> drivers/isdn/hardware/eicon/mntfunc.c | 2 +-
> drivers/isdn/hardware/eicon/s_4bri.c | 2 +-
> drivers/isdn/hardware/eicon/um_idi.c | 7 ++----
> 8 files changed, 18 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/isdn/hardware/eicon/capifunc.c
> b/drivers/isdn/hardware/eicon/capifunc.c
> index 4d425c6..7027547 100644
> --- a/drivers/isdn/hardware/eicon/capifunc.c
> +++ b/drivers/isdn/hardware/eicon/capifunc.c
> @@ -1072,7 +1072,7 @@ static int divacapi_connect_didd(void)
> req.didd_notify.e.Req = 0;
> req.didd_notify.e.Rc =
> IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
> - req.didd_notify.info.callback = (void *)didd_callback;
> + req.didd_notify.info.callback = didd_callback;
> req.didd_notify.info.context = NULL;
> DAdapter.request((ENTITY *) & req);
> if (req.didd_notify.e.Rc != 0xff) {
> diff --git a/drivers/isdn/hardware/eicon/diddfunc.c
> b/drivers/isdn/hardware/eicon/diddfunc.c
> index 3029234..d97bfba 100644
> --- a/drivers/isdn/hardware/eicon/diddfunc.c
> +++ b/drivers/isdn/hardware/eicon/diddfunc.c
> @@ -63,7 +63,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
> req.didd_notify.e.Req = 0;
> req.didd_notify.e.Rc =
> IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
> - req.didd_notify.info.callback = (void *)didd_callback;
> + req.didd_notify.info.callback = didd_callback;
> req.didd_notify.info.context = NULL;
> _DAdapter.request((ENTITY *) & req);
> if (req.didd_notify.e.Rc != 0xff)
> diff --git a/drivers/isdn/hardware/eicon/divasfunc.c
> b/drivers/isdn/hardware/eicon/divasfunc.c
> index d36a4c0..2616a22 100644
> --- a/drivers/isdn/hardware/eicon/divasfunc.c
> +++ b/drivers/isdn/hardware/eicon/divasfunc.c
> @@ -170,7 +170,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
> req.didd_notify.e.Req = 0;
> req.didd_notify.e.Rc =
> IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
> - req.didd_notify.info.callback = (void *)didd_callback;
> + req.didd_notify.info.callback = didd_callback;
> req.didd_notify.info.context = NULL;
> DAdapter.request((ENTITY *) & req);
> if (req.didd_notify.e.Rc != 0xff) {
> diff --git a/drivers/isdn/hardware/eicon/divasi.c
> b/drivers/isdn/hardware/eicon/divasi.c
> index 69e71eb..2510886 100644
> --- a/drivers/isdn/hardware/eicon/divasi.c
> +++ b/drivers/isdn/hardware/eicon/divasi.c
> @@ -237,13 +237,10 @@ um_idi_read(struct file *file, char __user *buf,
> size_t count, loff_t * offset)
> return (-ENODEV);
> }
>
> - if (!
> - (p_os =
> - (diva_um_idi_os_context_t *) diva_um_id_get_os_context(file->
> - private_data)))
> - {
> + if (!(p_os = diva_um_id_get_os_context(file-> private_data))) {
> return (-ENODEV);
> }
> +
> if (p_os->aborted) {
> return (-ENODEV);
> }
> @@ -296,7 +293,7 @@ static int um_idi_open_adapter(struct file *file,
> int adapter_nr)
> if (!(file->private_data = e)) {
> return (0);
> }
> - p_os = (diva_um_idi_os_context_t *) diva_um_id_get_os_context(e);
> + p_os = diva_um_id_get_os_context(e);
> init_waitqueue_head(&p_os->read_wait);
> init_waitqueue_head(&p_os->close_wait);
> init_timer(&p_os->diva_timer_id);
> @@ -329,12 +326,10 @@ um_idi_write(struct file *file, const char __user
> *buf, size_t count,
> return (-ENODEV);
> }
>
> - if (!(p_os =
> - (diva_um_idi_os_context_t *) diva_um_id_get_os_context(file->
> - private_data)))
> - {
> + if (!(p_os = diva_um_id_get_os_context(file->private_data))) {
> return (-ENODEV);
> }
> +
> if (p_os->aborted) {
> return (-ENODEV);
> }
> @@ -374,9 +369,7 @@ static unsigned int um_idi_poll(struct file *file,
> poll_table * wait)
> return (POLLERR);
> }
>
> - if ((!(p_os =
> - (diva_um_idi_os_context_t *)
> - diva_um_id_get_os_context(file->private_data)))
> + if ((!(p_os = diva_um_id_get_os_context(file->private_data)))
> || p_os->aborted) {
> return (POLLERR);
> }
> @@ -416,8 +409,7 @@ static int um_idi_release(struct inode *inode,
> struct file *file)
> goto out;
> }
>
> - if (!(p_os =
> - (diva_um_idi_os_context_t *)
> diva_um_id_get_os_context(file->private_data))) {
> + if (!(p_os = diva_um_id_get_os_context(file->private_data))) {
> ret = -ENODEV;
> goto out;
> }
> @@ -484,9 +476,7 @@ static int remove_entity(void *entity)
> return (0);
> }
>
> - if (!(p_os =
> - (diva_um_idi_os_context_t *)
> - diva_um_id_get_os_context(entity))) {
> + if (!(p_os = diva_um_id_get_os_context(entity))) {
> DBG_FTL(("Zero entity os context on remove"))
> return (0);
> }
> @@ -557,9 +547,7 @@ void diva_um_idi_start_wdog(void *entity)
> diva_um_idi_os_context_t *p_os;
>
> if (entity &&
> - ((p_os =
> - (diva_um_idi_os_context_t *)
> - diva_um_id_get_os_context(entity)))) {
> + ((p_os = diva_um_id_get_os_context(entity)))) {
> mod_timer(&p_os->diva_timer_id, jiffies + 10 * HZ);
> }
> }
> @@ -569,9 +557,7 @@ void diva_um_idi_stop_wdog(void *entity)
> diva_um_idi_os_context_t *p_os;
>
> if (entity &&
> - ((p_os =
> - (diva_um_idi_os_context_t *)
> - diva_um_id_get_os_context(entity)))) {
> + ((p_os = diva_um_id_get_os_context(entity)))) {
> del_timer(&p_os->diva_timer_id);
> }
> }
> diff --git a/drivers/isdn/hardware/eicon/idifunc.c
> b/drivers/isdn/hardware/eicon/idifunc.c
> index db87d51..5399cc1 100644
> --- a/drivers/isdn/hardware/eicon/idifunc.c
> +++ b/drivers/isdn/hardware/eicon/idifunc.c
> @@ -197,7 +197,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
> req.didd_notify.e.Req = 0;
> req.didd_notify.e.Rc =
> IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
> - req.didd_notify.info.callback = (void *)didd_callback;
> + req.didd_notify.info.callback = didd_callback;
> req.didd_notify.info.context = NULL;
> DAdapter.request((ENTITY *) & req);
> if (req.didd_notify.e.Rc != 0xff) {
> diff --git a/drivers/isdn/hardware/eicon/mntfunc.c
> b/drivers/isdn/hardware/eicon/mntfunc.c
> index a564b75..2251662 100644
> --- a/drivers/isdn/hardware/eicon/mntfunc.c
> +++ b/drivers/isdn/hardware/eicon/mntfunc.c
> @@ -88,7 +88,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
> req.didd_notify.e.Req = 0;
> req.didd_notify.e.Rc =
> IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
> - req.didd_notify.info.callback = (void *)didd_callback;
> + req.didd_notify.info.callback = didd_callback;
> req.didd_notify.info.context = NULL;
> DAdapter.request((ENTITY *) & req);
> if (req.didd_notify.e.Rc != 0xff)
> diff --git a/drivers/isdn/hardware/eicon/s_4bri.c
> b/drivers/isdn/hardware/eicon/s_4bri.c
> index 25c5d7f..28e8410 100644
> --- a/drivers/isdn/hardware/eicon/s_4bri.c
> +++ b/drivers/isdn/hardware/eicon/s_4bri.c
> @@ -189,7 +189,7 @@ static byte * qBri_check_FPGAsrc (PISDN_ADAPTER
> IoAdapter, char *FileName,
> char *fpgaFile, *fpgaType, *fpgaDate, *fpgaTime ;
> dword fpgaFlen, fpgaTlen, fpgaDlen, cnt, year, i ;
>
> - if (!(File = (byte *)xdiLoadFile (FileName, Length, 0))) {
> + if (!(File = xdiLoadFile (FileName, Length, 0))) {
> return (NULL) ;
> }
> /*
> diff --git a/drivers/isdn/hardware/eicon/um_idi.c
> b/drivers/isdn/hardware/eicon/um_idi.c
> index 6563db9..55eb212 100644
> --- a/drivers/isdn/hardware/eicon/um_idi.c
> +++ b/drivers/isdn/hardware/eicon/um_idi.c
> @@ -679,9 +679,7 @@ static int process_idi_ind(divas_um_idi_entity_t *
> e, byte ind)
> int do_wakeup = 0;
>
> if (e->e.complete != 0x02) {
> - diva_um_idi_ind_hdr_t *pind =
> - (diva_um_idi_ind_hdr_t *)
> - diva_data_q_get_segment4write(&e->data);
> + diva_um_idi_ind_hdr_t *pind =
> diva_data_q_get_segment4write(&e->data);
> if (pind) {
> e->e.RNum = 1;
> e->e.R->P = (byte *) & pind[1];
> @@ -734,8 +732,7 @@ static int write_return_code(divas_um_idi_entity_t *
> e, byte rc)
> {
> diva_um_idi_ind_hdr_t *prc;
>
> - if (!(prc =
> - (diva_um_idi_ind_hdr_t *) diva_data_q_get_segment4write(&e->rc)))
> + if (!(prc = diva_data_q_get_segment4write(&e->rc)))
> {
> DBG_ERR(("A: A(%d) E(%08x) rc(%02x) lost",
> e->adapter->adapter_nr, e, rc));
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2009-04-09 10:01:00

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 19/56] kvm: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> virt/kvm/kvm_main.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 605697e..95f915a 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -795,8 +795,7 @@ static struct kvm *kvm_create_vm(void)
> kfree(kvm);
> return ERR_PTR(-ENOMEM);
> }
> - kvm->coalesced_mmio_ring =
> - (struct kvm_coalesced_mmio_ring *)page_address(page);
> + kvm->coalesced_mmio_ring = page_address(page);
> #endif
>
> #if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
>

2009-04-09 10:03:45

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 21/56] md: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> drivers/md/bitmap.c | 8 ++++----
> drivers/md/dm-table.c | 4 ++--
> drivers/md/md.c | 19 +++++++++----------
> 3 files changed, 15 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
> index f8a9f7a..2a11c90 100644
> --- a/drivers/md/bitmap.c
> +++ b/drivers/md/bitmap.c
> @@ -493,7 +493,7 @@ void bitmap_update_sb(struct bitmap *bitmap)
> return;
> }
> spin_unlock_irqrestore(&bitmap->lock, flags);
> - sb = (bitmap_super_t *)kmap_atomic(bitmap->sb_page, KM_USER0);
> + sb = kmap_atomic(bitmap->sb_page, KM_USER0);
> sb->events = cpu_to_le64(bitmap->mddev->events);
> if (bitmap->mddev->events < bitmap->events_cleared) {
> /* rocking back to read-only */
> @@ -511,7 +511,7 @@ void bitmap_print_sb(struct bitmap *bitmap)
>
> if (!bitmap || !bitmap->sb_page)
> return;
> - sb = (bitmap_super_t *)kmap_atomic(bitmap->sb_page, KM_USER0);
> + sb = kmap_atomic(bitmap->sb_page, KM_USER0);
> printk(KERN_DEBUG "%s: bitmap file superblock:\n", bmname(bitmap));
> printk(KERN_DEBUG " magic: %08x\n", le32_to_cpu(sb->magic));
> printk(KERN_DEBUG " version: %d\n", le32_to_cpu(sb->version));
> @@ -559,7 +559,7 @@ static int bitmap_read_sb(struct bitmap *bitmap)
> return err;
> }
>
> - sb = (bitmap_super_t *)kmap_atomic(bitmap->sb_page, KM_USER0);
> + sb = kmap_atomic(bitmap->sb_page, KM_USER0);
>
> chunksize = le32_to_cpu(sb->chunksize);
> daemon_sleep = le32_to_cpu(sb->daemon_sleep);
> @@ -646,7 +646,7 @@ static int bitmap_mask_state(struct bitmap *bitmap, enum bitmap_state bits,
> return 0;
> }
> spin_unlock_irqrestore(&bitmap->lock, flags);
> - sb = (bitmap_super_t *)kmap_atomic(bitmap->sb_page, KM_USER0);
> + sb = kmap_atomic(bitmap->sb_page, KM_USER0);
> old = le32_to_cpu(sb->state) & bits;
> switch (op) {
> case MASK_SET: sb->state |= cpu_to_le32(bits);
> diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
> index e8361b1..6e57fe2 100644
> --- a/drivers/md/dm-table.c
> +++ b/drivers/md/dm-table.c
> @@ -211,7 +211,7 @@ static int alloc_targets(struct dm_table *t, unsigned int num)
> * Append an empty entry to catch sectors beyond the end of
> * the device.
> */
> - n_highs = (sector_t *) dm_vcalloc(num + 1, sizeof(struct dm_target) +
> + n_highs = dm_vcalloc(num + 1, sizeof(struct dm_target) +
> sizeof(sector_t));
> if (!n_highs)
> return -ENOMEM;
> @@ -775,7 +775,7 @@ static int setup_indexes(struct dm_table *t)
> total += t->counts[i];
> }
>
> - indexes = (sector_t *) dm_vcalloc(total, (unsigned long) NODE_SIZE);
> + indexes = dm_vcalloc(total, (unsigned long) NODE_SIZE);
> if (!indexes)
> return -ENOMEM;
>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index ed5727c..22cd6b3 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -767,7 +767,7 @@ static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version
> ret = -EINVAL;
>
> bdevname(rdev->bdev, b);
> - sb = (mdp_super_t*)page_address(rdev->sb_page);
> + sb = page_address(rdev->sb_page);
>
> if (sb->md_magic != MD_SB_MAGIC) {
> printk(KERN_ERR "md: invalid raid superblock magic on %s\n",
> @@ -817,7 +817,7 @@ static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version
> ret = 1;
> } else {
> __u64 ev1, ev2;
> - mdp_super_t *refsb = (mdp_super_t*)page_address(refdev->sb_page);
> + mdp_super_t *refsb = page_address(refdev->sb_page);
> if (!uuid_equal(refsb, sb)) {
> printk(KERN_WARNING "md: %s has different UUID to %s\n",
> b, bdevname(refdev->bdev,b2));
> @@ -852,7 +852,7 @@ static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version
> static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev)
> {
> mdp_disk_t *desc;
> - mdp_super_t *sb = (mdp_super_t *)page_address(rdev->sb_page);
> + mdp_super_t *sb = page_address(rdev->sb_page);
> __u64 ev1 = md_event(sb);
>
> rdev->raid_disk = -1;
> @@ -972,7 +972,7 @@ static void super_90_sync(mddev_t *mddev, mdk_rdev_t *rdev)
>
> rdev->sb_size = MD_SB_BYTES;
>
> - sb = (mdp_super_t*)page_address(rdev->sb_page);
> + sb = page_address(rdev->sb_page);
>
> memset(sb, 0, sizeof(*sb));
>
> @@ -1166,7 +1166,7 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
> if (ret) return ret;
>
>
> - sb = (struct mdp_superblock_1*)page_address(rdev->sb_page);
> + sb = page_address(rdev->sb_page);
>
> if (sb->magic != cpu_to_le32(MD_SB_MAGIC) ||
> sb->major_version != cpu_to_le32(1) ||
> @@ -1219,8 +1219,7 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
> ret = 1;
> } else {
> __u64 ev1, ev2;
> - struct mdp_superblock_1 *refsb =
> - (struct mdp_superblock_1*)page_address(refdev->sb_page);
> + struct mdp_superblock_1 *refsb = page_address(refdev->sb_page);
>
> if (memcmp(sb->set_uuid, refsb->set_uuid, 16) != 0 ||
> sb->level != refsb->level ||
> @@ -1258,7 +1257,7 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
>
> static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev)
> {
> - struct mdp_superblock_1 *sb = (struct mdp_superblock_1*)page_address(rdev->sb_page);
> + struct mdp_superblock_1 *sb = page_address(rdev->sb_page);
> __u64 ev1 = le64_to_cpu(sb->events);
>
> rdev->raid_disk = -1;
> @@ -1355,7 +1354,7 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)
> int max_dev, i;
> /* make rdev->sb match mddev and rdev data. */
>
> - sb = (struct mdp_superblock_1*)page_address(rdev->sb_page);
> + sb = page_address(rdev->sb_page);
>
> sb->feature_map = 0;
> sb->pad0 = 0;
> @@ -1453,7 +1452,7 @@ super_1_rdev_size_change(mdk_rdev_t *rdev, sector_t num_sectors)
> num_sectors = max_sectors;
> rdev->sb_start = sb_start;
> }
> - sb = (struct mdp_superblock_1 *) page_address(rdev->sb_page);
> + sb = page_address(rdev->sb_page);
> sb->data_size = cpu_to_le64(num_sectors);
> sb->super_offset = rdev->sb_start;
> sb->sb_csum = calc_sb_1_csum(sb);
>

2009-04-09 10:06:16

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 24/56] mips: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> arch/mips/boot/elf2ecoff.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/mips/boot/elf2ecoff.c b/arch/mips/boot/elf2ecoff.c
> index c5a7f30..0a4cbf0 100644
> --- a/arch/mips/boot/elf2ecoff.c
> +++ b/arch/mips/boot/elf2ecoff.c
> @@ -136,7 +136,7 @@ static char *saveRead(int file, off_t offset, off_t len, char *name)
> fprintf(stderr, "%s: fseek: %s\n", name, strerror(errno));
> exit(1);
> }
> - if (!(tmp = (char *) malloc(len))) {
> + if (!(tmp = malloc(len))) {
> fprintf(stderr, "%s: Can't allocate %ld bytes.\n", name,
> len);
> exit(1);
>

2009-04-09 10:06:55

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 25/56] mm: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> mm/shmem.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/mm/shmem.c b/mm/shmem.c
> index d94d2e9..4febea9 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -2357,7 +2357,7 @@ static struct kmem_cache *shmem_inode_cachep;
> static struct inode *shmem_alloc_inode(struct super_block *sb)
> {
> struct shmem_inode_info *p;
> - p = (struct shmem_inode_info *)kmem_cache_alloc(shmem_inode_cachep, GFP_KERNEL);
> + p = kmem_cache_alloc(shmem_inode_cachep, GFP_KERNEL);
> if (!p)
> return NULL;
> return &p->vfs_inode;
>

2009-04-09 10:07:37

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 26/56] ncpfs: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> fs/ncpfs/inode.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
> index d642f0e..7d33658 100644
> --- a/fs/ncpfs/inode.c
> +++ b/fs/ncpfs/inode.c
> @@ -53,7 +53,7 @@ static struct kmem_cache * ncp_inode_cachep;
> static struct inode *ncp_alloc_inode(struct super_block *sb)
> {
> struct ncp_inode_info *ei;
> - ei = (struct ncp_inode_info *)kmem_cache_alloc(ncp_inode_cachep, GFP_KERNEL);
> + ei = kmem_cache_alloc(ncp_inode_cachep, GFP_KERNEL);
> if (!ei)
> return NULL;
> return &ei->vfs_inode;
>

2009-04-09 10:08:24

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 27/56] ipv4: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> net/ipv4/route.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index c40debe..3699077 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -2707,8 +2707,7 @@ static struct dst_ops ipv4_dst_blackhole_ops = {
> static int ipv4_dst_blackhole(struct net *net, struct rtable **rp, struct flowi *flp)
> {
> struct rtable *ort = *rp;
> - struct rtable *rt = (struct rtable *)
> - dst_alloc(&ipv4_dst_blackhole_ops);
> + struct rtable *rt = dst_alloc(&ipv4_dst_blackhole_ops);
>
> if (rt) {
> struct dst_entry *new = &rt->u.dst;
>

2009-04-09 10:09:00

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 28/56] ipv6: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> net/ipv6/route.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index 1394ddb..9c70a88 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -834,8 +834,7 @@ EXPORT_SYMBOL(ip6_route_output);
> int ip6_dst_blackhole(struct sock *sk, struct dst_entry **dstp, struct flowi *fl)
> {
> struct rt6_info *ort = (struct rt6_info *) *dstp;
> - struct rt6_info *rt = (struct rt6_info *)
> - dst_alloc(&ip6_dst_blackhole_ops);
> + struct rt6_info *rt = dst_alloc(&ip6_dst_blackhole_ops);
> struct dst_entry *new = NULL;
>
> if (rt) {
>

2009-04-09 10:10:05

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 29/56] irda: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Fixed patch
>
> Thanks,
>
> Jack
>
> --
>
> irda: Remove void casts
>
> From: Jack Stone <[email protected]>
>
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>
> net/irda/discovery.c | 4 ++--
> net/irda/ircomm/ircomm_lmp.c | 2 +-
> net/irda/iriap.c | 2 +-
> net/irda/irnet/irnet_irda.c | 3 +--
> 4 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/net/irda/discovery.c b/net/irda/discovery.c
> index a6f99b5..7fdc346 100644
> --- a/net/irda/discovery.c
> +++ b/net/irda/discovery.c
> @@ -130,11 +130,11 @@ void irlmp_add_discovery_log(hashbin_t *cachelog,
> hashbin_t *log)
> * no need to lock it.
> * We just need to lock the global log in irlmp_add_discovery().
> */
> - discovery = (discovery_t *) hashbin_remove_first(log);
> + discovery = hashbin_remove_first(log);
> while (discovery != NULL) {
> irlmp_add_discovery(cachelog, discovery);
>
> - discovery = (discovery_t *) hashbin_remove_first(log);
> + discovery = hashbin_remove_first(log);
> }
>
> /* Delete the now empty log */
> diff --git a/net/irda/ircomm/ircomm_lmp.c b/net/irda/ircomm/ircomm_lmp.c
> index 67c99d2..6245b45 100644
> --- a/net/irda/ircomm/ircomm_lmp.c
> +++ b/net/irda/ircomm/ircomm_lmp.c
> @@ -152,7 +152,7 @@ static void ircomm_lmp_flow_control(struct sk_buff *skb)
>
> line = cb->line;
>
> - self = (struct ircomm_cb *) hashbin_lock_find(ircomm, line, NULL);
> + self = hashbin_lock_find(ircomm, line, NULL);
> if (!self) {
> IRDA_DEBUG(2, "%s(), didn't find myself\n", __func__ );
> return;
> diff --git a/net/irda/iriap.c b/net/irda/iriap.c
> index 4a105dc..12cb0e9 100644
> --- a/net/irda/iriap.c
> +++ b/net/irda/iriap.c
> @@ -251,7 +251,7 @@ void iriap_close(struct iriap_cb *self)
> self->lsap = NULL;
> }
>
> - entry = (struct iriap_cb *) hashbin_remove(iriap, (long) self, NULL);
> + entry = hashbin_remove(iriap, (long) self, NULL);
> IRDA_ASSERT(entry == self, return;);
>
> __iriap_close(self);
> diff --git a/net/irda/irnet/irnet_irda.c b/net/irda/irnet/irnet_irda.c
> index cf9a4b5..3a89247 100644
> --- a/net/irda/irnet/irnet_irda.c
> +++ b/net/irda/irnet/irnet_irda.c
> @@ -766,8 +766,7 @@ irnet_find_socket(irnet_socket * self)
> * requested that nickname */
> if(err == 0)
> {
> - new = (irnet_socket *) hashbin_find(irnet_server.list,
> - 0, self->rname);
> + new = hashbin_find(irnet_server.list, 0, self->rname);
> if(new)
> DEBUG(IRDA_SERV_INFO, "Socket 0x%p matches rname ``%s''.\n",
> new, new->rname);
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2009-04-09 10:10:56

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 30/56] net: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Fixed patch
>
> Thanks,
>
> Jack
>
> --
>
> net: Remove void casts
>
> From: Jack Stone <[email protected]>
>
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>
> drivers/net/arm/at91_ether.c | 2 +-
> drivers/net/cassini.c | 3 +--
> drivers/net/gianfar.c | 2 +-
> drivers/net/ibmveth.c | 7 +++----
> drivers/net/irda/au1k_ir.c | 3 +--
> drivers/net/netxen/netxen_nic_init.c | 6 ++----
> drivers/net/skfp/ess.c | 20 ++++++++++----------
> drivers/net/skfp/hwmtm.c | 7 +++----
> drivers/net/skfp/pmf.c | 4 ++--
> drivers/net/skfp/smt.c | 3 +--
> drivers/net/sungem.c | 3 +--
> drivers/net/sunhme.c | 3 +--
> drivers/net/via-velocity.c | 2 +-
> drivers/net/wireless/ipw2x00/ipw2100.c | 4 +---
> 14 files changed, 29 insertions(+), 40 deletions(-)
>
> diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c
> index 442938d..c389b66 100644
> --- a/drivers/net/arm/at91_ether.c
> +++ b/drivers/net/arm/at91_ether.c
> @@ -992,7 +992,7 @@ static int __init at91ether_setup(unsigned long
> phy_type, unsigned short phy_add
>
> /* Allocate memory for DMA Receive descriptors */
> lp = netdev_priv(dev);
> - lp->dlist = (struct recv_desc_bufs *) dma_alloc_coherent(NULL,
> sizeof(struct recv_desc_bufs), (dma_addr_t *) &lp->dlist_phys, GFP_KERNEL);
> + lp->dlist = dma_alloc_coherent(NULL, sizeof(struct recv_desc_bufs),
> (dma_addr_t *) &lp->dlist_phys, GFP_KERNEL);
> if (lp->dlist == NULL) {
> free_irq(dev->irq, dev);
> free_netdev(dev);
> diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
> index f522276..620b783 100644
> --- a/drivers/net/cassini.c
> +++ b/drivers/net/cassini.c
> @@ -5162,8 +5162,7 @@ static int __devinit cas_init_one(struct pci_dev
> *pdev,
> if (cas_saturn_firmware_init(cp))
> goto err_out_iounmap;
>
> - cp->init_block = (struct cas_init_block *)
> - pci_alloc_consistent(pdev, sizeof(struct cas_init_block),
> + cp->init_block = pci_alloc_consistent(pdev, sizeof(struct
> cas_init_block),
> &cp->block_dvma);
> if (!cp->init_block) {
> dev_err(&pdev->dev, "Cannot allocate init block, aborting.\n");
> diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
> index 65f5587..7a8885e 100644
> --- a/drivers/net/gianfar.c
> +++ b/drivers/net/gianfar.c
> @@ -268,7 +268,7 @@ static int gfar_of_init(struct net_device *dev)
> if (ph == NULL) {
> u32 *fixed_link;
>
> - fixed_link = (u32 *)of_get_property(np, "fixed-link", NULL);
> + fixed_link = of_get_property(np, "fixed-link", NULL);
> if (!fixed_link) {
> err = -ENODEV;
> goto err_out;
> diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
> index 5c6315d..6ce7190 100644
> --- a/drivers/net/ibmveth.c
> +++ b/drivers/net/ibmveth.c
> @@ -1218,16 +1218,15 @@ static int __devinit ibmveth_probe(struct
> vio_dev *dev, const struct vio_device_
> ibmveth_debug_printk_no_adapter("entering ibmveth_probe for UA 0x%x\n",
> dev->unit_address);
>
> - mac_addr_p = (unsigned char *) vio_get_attribute(dev,
> - VETH_MAC_ADDR, NULL);
> + mac_addr_p = vio_get_attribute(dev, VETH_MAC_ADDR, NULL);
> if(!mac_addr_p) {
> printk(KERN_ERR "(%s:%3.3d) ERROR: Can't find VETH_MAC_ADDR "
> "attribute\n", __FILE__, __LINE__);
> return 0;
> }
>
> - mcastFilterSize_p = (unsigned int *) vio_get_attribute(dev,
> - VETH_MCAST_FILTER_SIZE, NULL);
> + mcastFilterSize_p = vio_get_attribute(dev, VETH_MCAST_FILTER_SIZE,
> + NULL);
> if(!mcastFilterSize_p) {
> printk(KERN_ERR "(%s:%3.3d) ERROR: Can't find "
> "VETH_MCAST_FILTER_SIZE attribute\n",
> diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c
> index 9411640..b4a6ad8 100644
> --- a/drivers/net/irda/au1k_ir.c
> +++ b/drivers/net/irda/au1k_ir.c
> @@ -234,8 +234,7 @@ static int au1k_irda_net_init(struct net_device *dev)
> goto out2;
>
> /* allocate the data buffers */
> - aup->db[0].vaddr =
> - (void *)dma_alloc(MAX_BUF_SIZE * 2*NUM_IR_DESC, &temp);
> + aup->db[0].vaddr = dma_alloc(MAX_BUF_SIZE * 2*NUM_IR_DESC, &temp);
> if (!aup->db[0].vaddr)
> goto out3;
>
> diff --git a/drivers/net/netxen/netxen_nic_init.c
> b/drivers/net/netxen/netxen_nic_init.c
> index 0759c35..9b56b37 100644
> --- a/drivers/net/netxen/netxen_nic_init.c
> +++ b/drivers/net/netxen/netxen_nic_init.c
> @@ -230,8 +230,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter
> *adapter)
> struct netxen_cmd_buffer *cmd_buf_arr;
> struct net_device *netdev = adapter->netdev;
>
> - cmd_buf_arr =
> - (struct netxen_cmd_buffer *)vmalloc(TX_BUFF_RINGSIZE(adapter));
> + cmd_buf_arr = vmalloc(TX_BUFF_RINGSIZE(adapter));
> if (cmd_buf_arr == NULL) {
> printk(KERN_ERR "%s: Failed to allocate cmd buffer ring\n",
> netdev->name);
> @@ -277,8 +276,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter
> *adapter)
> break;
>
> }
> - rds_ring->rx_buf_arr = (struct netxen_rx_buffer *)
> - vmalloc(RCV_BUFF_RINGSIZE(rds_ring));
> + rds_ring->rx_buf_arr = vmalloc(RCV_BUFF_RINGSIZE(rds_ring));
> if (rds_ring->rx_buf_arr == NULL) {
> printk(KERN_ERR "%s: Failed to allocate "
> "rx buffer ring %d\n",
> diff --git a/drivers/net/skfp/ess.c b/drivers/net/skfp/ess.c
> index a85efcf..5ec0413 100644
> --- a/drivers/net/skfp/ess.c
> +++ b/drivers/net/skfp/ess.c
> @@ -133,7 +133,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf
> *mb, struct smt_header *sm,
> /*
> * get the resource type
> */
> - if (!(p = (void *) sm_to_para(smc,sm,SMT_P0015))) {
> + if (!(p = sm_to_para(smc,sm,SMT_P0015))) {
> DB_ESS("ESS: RAF frame error, parameter type not found\n",0,0) ;
> return(fs) ;
> }
> @@ -142,7 +142,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf
> *mb, struct smt_header *sm,
> /*
> * get the pointer to the ESS command
> */
> - if (!(cmd = (struct smt_p_0016 *) sm_to_para(smc,sm,SMT_P0016))) {
> + if (!(cmd = sm_to_para(smc,sm,SMT_P0016))) {
> /*
> * error in frame: para ESS command was not found
> */
> @@ -177,7 +177,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf
> *mb, struct smt_header *sm,
> if (!local || smc->mib.fddiESSPayload)
> return(fs) ;
>
> - p = (void *) sm_to_para(smc,sm,SMT_P0019) ;
> + p = sm_to_para(smc,sm,SMT_P0019) ;
> for (i = 0; i < 5; i++) {
> if (((struct smt_p_0019 *)p)->alloc_addr.a[i]) {
> return(fs) ;
> @@ -190,10 +190,10 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf
> *mb, struct smt_header *sm,
> */
> smc->ess.alloc_trans_id = sm->smt_tid ;
> DB_ESS("ESS: save Alloc Req Trans ID %lx\n",sm->smt_tid,0);
> - p = (void *) sm_to_para(smc,sm,SMT_P320F) ;
> + p = sm_to_para(smc,sm,SMT_P320F) ;
> ((struct smt_p_320f *)p)->mib_payload =
> smc->mib.a[PATH0].fddiPATHSbaPayload ;
> - p = (void *) sm_to_para(smc,sm,SMT_P3210) ;
> + p = sm_to_para(smc,sm,SMT_P3210) ;
> ((struct smt_p_3210 *)p)->mib_overhead =
> smc->mib.a[PATH0].fddiPATHSbaOverhead ;
> sm->smt_dest = smt_sba_da ;
> @@ -248,13 +248,13 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf
> *mb, struct smt_header *sm,
> /*
> * Extract message parameters
> */
> - p = (void *) sm_to_para(smc,sm,SMT_P320F) ;
> + p = sm_to_para(smc,sm,SMT_P320F) ;
> if (!p) {
> printk(KERN_ERR "ESS: sm_to_para failed");
> return fs;
> }
> payload = ((struct smt_p_320f *)p)->mib_payload ;
> - p = (void *) sm_to_para(smc,sm,SMT_P3210) ;
> + p = sm_to_para(smc,sm,SMT_P3210) ;
> if (!p) {
> printk(KERN_ERR "ESS: sm_to_para failed");
> return fs;
> @@ -306,9 +306,9 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf
> *mb, struct smt_header *sm,
> /*
> * Extract message queue parameters
> */
> - p = (void *) sm_to_para(smc,sm,SMT_P320F) ;
> + p = sm_to_para(smc,sm,SMT_P320F) ;
> payload = ((struct smt_p_320f *)p)->mib_payload ;
> - p = (void *) sm_to_para(smc,sm,SMT_P3210) ;
> + p = sm_to_para(smc,sm,SMT_P3210) ;
> overhead = ((struct smt_p_3210 *)p)->mib_overhead ;
>
> DB_ESSN(2,"ESS: Change Request from %s\n",
> @@ -529,7 +529,7 @@ static void ess_send_response(struct s_smc *smc,
> struct smt_header *sm,
> /* set P1A */
> chg->cat.para.p_type = SMT_P001A ;
> chg->cat.para.p_len = sizeof(struct smt_p_001a) - PARA_LEN ;
> - p = (void *) sm_to_para(smc,sm,SMT_P001A) ;
> + p = sm_to_para(smc,sm,SMT_P001A) ;
> chg->cat.category = ((struct smt_p_001a *)p)->category ;
> }
> dump_smt(smc,(struct smt_header *)chg,"RAF") ;
> diff --git a/drivers/net/skfp/hwmtm.c b/drivers/net/skfp/hwmtm.c
> index d322f1b..1b8d418 100644
> --- a/drivers/net/skfp/hwmtm.c
> +++ b/drivers/net/skfp/hwmtm.c
> @@ -268,8 +268,7 @@ int mac_drv_init(struct s_smc *smc)
> /*
> * get the required memory for the RxDs and TxDs
> */
> - if (!(smc->os.hwm.descr_p = (union s_fp_descr volatile *)
> - mac_drv_get_desc_mem(smc,(u_int)
> + if (!(smc->os.hwm.descr_p = mac_drv_get_desc_mem(smc,(u_int)
> (RXD_TXD_COUNT+1)*sizeof(struct s_smt_fp_txd)))) {
> return(1) ; /* no space the hwm modul can't work */
> }
> @@ -281,13 +280,13 @@ int mac_drv_init(struct s_smc *smc)
> smc->os.hwm.mbuf_pool.mb_start=(SMbuf
> *)(&smc->os.hwm.mbuf_pool.mb[0]) ;
> #else
> #ifndef COMMON_MB_POOL
> - if (!(smc->os.hwm.mbuf_pool.mb_start = (SMbuf *) mac_drv_get_space(smc,
> + if (!(smc->os.hwm.mbuf_pool.mb_start = mac_drv_get_space(smc,
> MAX_MBUF*sizeof(SMbuf)))) {
> return(1) ; /* no space the hwm modul can't work */
> }
> #else
> if (!mb_start) {
> - if (!(mb_start = (SMbuf *) mac_drv_get_space(smc,
> + if (!(mb_start = mac_drv_get_space(smc,
> MAX_MBUF*sizeof(SMbuf)))) {
> return(1) ; /* no space the hwm modul can't work */
> }
> diff --git a/drivers/net/skfp/pmf.c b/drivers/net/skfp/pmf.c
> index 79e665e..87613b7 100644
> --- a/drivers/net/skfp/pmf.c
> +++ b/drivers/net/skfp/pmf.c
> @@ -520,7 +520,7 @@ static int smt_authorize(struct s_smc *smc, struct
> smt_header *sm)
> for (i = 0 ; i < 8 && !p[i] ; i++)
> ;
> if (i != 8) {
> - pa = (struct smt_para *) sm_to_para(smc,sm,SMT_P_AUTHOR) ;
> + pa = sm_to_para(smc,sm,SMT_P_AUTHOR) ;
> if (!pa)
> return(1) ;
> if (pa->p_len != 8)
> @@ -536,7 +536,7 @@ static int smt_check_set_count(struct s_smc *smc,
> struct smt_header *sm)
> struct smt_para *pa ;
> struct smt_p_setcount *sc ;
>
> - pa = (struct smt_para *) sm_to_para(smc,sm,SMT_P1035) ;
> + pa = sm_to_para(smc,sm,SMT_P1035) ;
> if (pa) {
> sc = (struct smt_p_setcount *) pa ;
> if ((smc->mib.fddiSMTSetCount.count != sc->count) ||
> diff --git a/drivers/net/skfp/smt.c b/drivers/net/skfp/smt.c
> index 83d16fe..a4acc6c 100644
> --- a/drivers/net/skfp/smt.c
> +++ b/drivers/net/skfp/smt.c
> @@ -603,8 +603,7 @@ void smt_received_pack(struct s_smc *smc, SMbuf *mb,
> int fs)
> smt_echo_test(smc,0) ;
> }
> smc->sm.smt_tvu = smt_get_time() ;
> - st = (struct smt_p_state *)
> - sm_to_para(smc,sm,SMT_P_STATE) ;
> + st = sm_to_para(smc,sm,SMT_P_STATE) ;
> if (st) {
> smc->mib.m[MAC0].fddiMACUNDA_Flag =
> (st->st_dupl_addr & SMT_ST_MY_DUPA) ?
> diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
> index d2dfe0a..4de10ce 100644
> --- a/drivers/net/sungem.c
> +++ b/drivers/net/sungem.c
> @@ -3145,8 +3145,7 @@ static int __devinit gem_init_one(struct pci_dev
> *pdev,
> /* It is guaranteed that the returned buffer will be at least
> * PAGE_SIZE aligned.
> */
> - gp->init_block = (struct gem_init_block *)
> - pci_alloc_consistent(pdev, sizeof(struct gem_init_block),
> + gp->init_block = pci_alloc_consistent(pdev, sizeof(struct
> gem_init_block),
> &gp->gblock_dvma);
> if (!gp->init_block) {
> printk(KERN_ERR PFX "Cannot allocate init block, "
> diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
> index 4e9bd38..814ea78 100644
> --- a/drivers/net/sunhme.c
> +++ b/drivers/net/sunhme.c
> @@ -3091,8 +3091,7 @@ static int __devinit happy_meal_pci_probe(struct
> pci_dev *pdev,
> hp->happy_bursts = DMA_BURSTBITS;
> #endif
>
> - hp->happy_block = (struct hmeal_init_block *)
> - dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &hp->hblock_dvma,
> GFP_KERNEL);
> + hp->happy_block = dma_alloc_coherent(&pdev->dev, PAGE_SIZE,
> &hp->hblock_dvma, GFP_KERNEL);
>
> err = -ENODEV;
> if (!hp->happy_block) {
> diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
> index fb53ef8..a0b6386 100644
> --- a/drivers/net/via-velocity.c
> +++ b/drivers/net/via-velocity.c
> @@ -2136,7 +2136,7 @@ static int velocity_xmit(struct sk_buff *skb,
> struct net_device *dev)
>
> for (i = 0; i < nfrags; i++) {
> skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
> - void *addr = (void *)page_address(frag->page) +
> frag->page_offset;
> + void *addr = (void *) page_address(frag->page) +
> frag->page_offset;
>
> tdinfo->skb_dma[i + 1] = pci_map_single(vptr->pdev,
> addr, frag->size, PCI_DMA_TODEVICE);
>
> diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c
> b/drivers/net/wireless/ipw2x00/ipw2100.c
> index 97e5647..2e3d7c1 100644
> --- a/drivers/net/wireless/ipw2x00/ipw2100.c
> +++ b/drivers/net/wireless/ipw2x00/ipw2100.c
> @@ -4301,9 +4301,7 @@ static int status_queue_allocate(struct
> ipw2100_priv *priv, int entries)
> IPW_DEBUG_INFO("enter\n");
>
> q->size = entries * sizeof(struct ipw2100_status);
> - q->drv =
> - (struct ipw2100_status *)pci_alloc_consistent(priv->pci_dev,
> - q->size, &q->nic);
> + q->drv = pci_alloc_consistent(priv->pci_dev, q->size, &q->nic);
> if (!q->drv) {
> IPW_DEBUG_WARNING("Can not allocate status queue.\n");
> return -ENOMEM;
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2009-04-09 10:12:22

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 31/56] sctp: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> net/sctp/socket.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/sctp/socket.c b/net/sctp/socket.c
> index 5fb3a8c..3ed4b4d 100644
> --- a/net/sctp/socket.c
> +++ b/net/sctp/socket.c
> @@ -227,7 +227,7 @@ struct sctp_association *sctp_id2assoc(struct sock *sk, sctp_assoc_t id)
> return NULL;
>
> spin_lock_bh(&sctp_assocs_id_lock);
> - asoc = (struct sctp_association *)idr_find(&sctp_assocs_id, (int)id);
> + asoc = idr_find(&sctp_assocs_id, (int)id);
> spin_unlock_bh(&sctp_assocs_id_lock);
>
> if (!asoc || (asoc->base.sk != sk) || asoc->base.dead)
>

2009-04-09 10:12:53

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 32/56] sunrpc: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> net/sunrpc/rpc_pipe.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
> index 9ced062..b8e401a 100644
> --- a/net/sunrpc/rpc_pipe.c
> +++ b/net/sunrpc/rpc_pipe.c
> @@ -154,7 +154,7 @@ static struct inode *
> rpc_alloc_inode(struct super_block *sb)
> {
> struct rpc_inode *rpci;
> - rpci = (struct rpc_inode *)kmem_cache_alloc(rpc_inode_cachep, GFP_KERNEL);
> + rpci = kmem_cache_alloc(rpc_inode_cachep, GFP_KERNEL);
> if (!rpci)
> return NULL;
> return &rpci->vfs_inode;
>

2009-04-09 10:13:55

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 33/56] tipc: Remove void casts

[Added maintainer CCs]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> net/tipc/port.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/tipc/port.c b/net/tipc/port.c
> index e70d27e..0804ae2 100644
> --- a/net/tipc/port.c
> +++ b/net/tipc/port.c
> @@ -1528,7 +1528,7 @@ int tipc_forward_buf2name(u32 ref,
> u32 destport = 0;
> int res;
>
> - p_ptr = (struct port *)tipc_ref_deref(ref);
> + p_ptr = tipc_ref_deref(ref);
> if (!p_ptr || p_ptr->publ.connected)
> return -EINVAL;
>
> @@ -1656,7 +1656,7 @@ int tipc_forward_buf2port(u32 ref,
> struct tipc_msg *msg;
> int res;
>
> - p_ptr = (struct port *)tipc_ref_deref(ref);
> + p_ptr = tipc_ref_deref(ref);
> if (!p_ptr || p_ptr->publ.connected)
> return -EINVAL;
>
>

2009-04-09 10:14:35

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 34/56] nfs: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> fs/nfs/inode.c | 2 +-
> fs/nfs/nfs2xdr.c | 2 +-
> fs/nfs/nfs3xdr.c | 2 +-
> fs/nfs/nfs4xdr.c | 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
> index 64f8719..c6aceaf 100644
> --- a/fs/nfs/inode.c
> +++ b/fs/nfs/inode.c
> @@ -1342,7 +1342,7 @@ void nfs4_clear_inode(struct inode *inode)
> struct inode *nfs_alloc_inode(struct super_block *sb)
> {
> struct nfs_inode *nfsi;
> - nfsi = (struct nfs_inode *)kmem_cache_alloc(nfs_inode_cachep, GFP_KERNEL);
> + nfsi = kmem_cache_alloc(nfs_inode_cachep, GFP_KERNEL);
> if (!nfsi)
> return NULL;
> nfsi->flags = 0UL;
> diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
> index c862c93..a9017a6 100644
> --- a/fs/nfs/nfs2xdr.c
> +++ b/fs/nfs/nfs2xdr.c
> @@ -627,7 +627,7 @@ nfs_xdr_readlinkres(struct rpc_rqst *req, __be32 *p, void *dummy)
> }
>
> /* NULL terminate the string we got */
> - kaddr = (char *)kmap_atomic(rcvbuf->pages[0], KM_USER0);
> + kaddr = kmap_atomic(rcvbuf->pages[0], KM_USER0);
> kaddr[len+rcvbuf->page_base] = '\0';
> kunmap_atomic(kaddr, KM_USER0);
> return 0;
> diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
> index e6a1932..48ccc17 100644
> --- a/fs/nfs/nfs3xdr.c
> +++ b/fs/nfs/nfs3xdr.c
> @@ -859,7 +859,7 @@ nfs3_xdr_readlinkres(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr)
> }
>
> /* NULL terminate the string we got */
> - kaddr = (char*)kmap_atomic(rcvbuf->pages[0], KM_USER0);
> + kaddr = kmap_atomic(rcvbuf->pages[0], KM_USER0);
> kaddr[len+rcvbuf->page_base] = '\0';
> kunmap_atomic(kaddr, KM_USER0);
> return 0;
> diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
> index 1690f0e..a283caa 100644
> --- a/fs/nfs/nfs4xdr.c
> +++ b/fs/nfs/nfs4xdr.c
> @@ -3565,7 +3565,7 @@ static int decode_readlink(struct xdr_stream *xdr, struct rpc_rqst *req)
> * and and null-terminate the text (the VFS expects
> * null-termination).
> */
> - kaddr = (char *)kmap_atomic(rcvbuf->pages[0], KM_USER0);
> + kaddr = kmap_atomic(rcvbuf->pages[0], KM_USER0);
> kaddr[len+rcvbuf->page_base] = '\0';
> kunmap_atomic(kaddr, KM_USER0);
> return 0;
>

2009-04-09 10:16:18

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 35/56] ntfs: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Fixed patch,
>
> Thanks,
>
> Jack
>
> --
>
> ntfs: Remove void casts
>
> From: Jack Stone <[email protected]>
>
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>
> fs/ntfs/dir.c | 8 ++++----
> fs/ntfs/index.c | 2 +-
> fs/ntfs/super.c | 8 ++++----
> fs/ntfs/usnjrnl.c | 2 +-
> 4 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c
> index 5a9e344..c373301 100644
> --- a/fs/ntfs/dir.c
> +++ b/fs/ntfs/dir.c
> @@ -326,7 +326,7 @@ descend_into_child_node:
> goto err_out;
> }
> lock_page(page);
> - kaddr = (u8*)page_address(page);
> + kaddr = page_address(page);
> fast_descend_into_child_node:
> /* Get to the index allocation block. */
> ia = (INDEX_ALLOCATION*)(kaddr + ((vcn <<
> @@ -804,7 +804,7 @@ descend_into_child_node:
> goto err_out;
> }
> lock_page(page);
> - kaddr = (u8*)page_address(page);
> + kaddr = page_address(page);
> fast_descend_into_child_node:
> /* Get to the index allocation block. */
> ia = (INDEX_ALLOCATION*)(kaddr + ((vcn <<
> @@ -1279,7 +1279,7 @@ get_next_bmp_page:
> bmp_page = NULL;
> goto iput_err_out;
> }
> - bmp = (u8*)page_address(bmp_page);
> + bmp = page_address(bmp_page);
> /* Find next index block in use. */
> while (!(bmp[cur_bmp_pos >> 3] & (1 << (cur_bmp_pos & 7)))) {
> find_next_index_buffer:
> @@ -1322,7 +1322,7 @@ find_next_index_buffer:
> goto err_out;
> }
> lock_page(ia_page);
> - kaddr = (u8*)page_address(ia_page);
> + kaddr = page_address(ia_page);
> }
> /* Get the current index buffer. */
> ia = (INDEX_ALLOCATION*)(kaddr + (ia_pos & ~PAGE_CACHE_MASK &
> diff --git a/fs/ntfs/index.c b/fs/ntfs/index.c
> index 2194eff..16a8b2e 100644
> --- a/fs/ntfs/index.c
> +++ b/fs/ntfs/index.c
> @@ -282,7 +282,7 @@ descend_into_child_node:
> goto err_out;
> }
> lock_page(page);
> - kaddr = (u8*)page_address(page);
> + kaddr = page_address(page);
> fast_descend_into_child_node:
> /* Get to the index allocation block. */
> ia = (INDEX_ALLOCATION*)(kaddr + ((vcn <<
> diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
> index f76951d..d05bccf 100644
> --- a/fs/ntfs/super.c
> +++ b/fs/ntfs/super.c
> @@ -1295,7 +1295,7 @@ static int
> check_windows_hibernation_status(ntfs_volume *vol)
> ret = PTR_ERR(page);
> goto iput_out;
> }
> - kaddr = (u32*)page_address(page);
> + kaddr = page_address(page);
> if (*(le32*)kaddr == cpu_to_le32(0x72626968)/*'hibr'*/) {
> ntfs_debug("Magic \"hibr\" found in hiberfil.sys. Windows is "
> "hibernated on the volume. This is the "
> @@ -1515,7 +1515,7 @@ not_enabled:
> "attribute.");
> return false;
> }
> - uh = (USN_HEADER*)page_address(page);
> + uh = page_address(page);
> /* Sanity check the $Max. */
> if (unlikely(sle64_to_cpu(uh->allocation_delta) >
> sle64_to_cpu(uh->maximum_size))) {
> @@ -2501,7 +2501,7 @@ static s64 get_nr_free_clusters(ntfs_volume *vol)
> nr_free -= PAGE_CACHE_SIZE * 8;
> continue;
> }
> - kaddr = (u32*)kmap_atomic(page, KM_USER0);
> + kaddr = kmap_atomic(page, KM_USER0);
> /*
> * For each 4 bytes, subtract the number of set bits. If this
> * is the last page and it is partial we don't really care as
> @@ -2572,7 +2572,7 @@ static unsigned long
> __get_nr_free_mft_records(ntfs_volume *vol,
> nr_free -= PAGE_CACHE_SIZE * 8;
> continue;
> }
> - kaddr = (u32*)kmap_atomic(page, KM_USER0);
> + kaddr = kmap_atomic(page, KM_USER0);
> /*
> * For each 4 bytes, subtract the number of set bits. If this
> * is the last page and it is partial we don't really care as
> diff --git a/fs/ntfs/usnjrnl.c b/fs/ntfs/usnjrnl.c
> index b2bc0d5..5c8fdd7 100644
> --- a/fs/ntfs/usnjrnl.c
> +++ b/fs/ntfs/usnjrnl.c
> @@ -58,7 +58,7 @@ bool ntfs_stamp_usnjrnl(ntfs_volume *vol)
> "$UsnJrnl/$DATA/$Max attribute.");
> return false;
> }
> - uh = (USN_HEADER*)page_address(page);
> + uh = page_address(page);
> stamp = get_current_ntfs_time();
> ntfs_debug("Stamping transaction log ($UsnJrnl): old "
> "journal_id 0x%llx, old lowest_valid_usn "
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2009-04-09 10:17:22

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 36/56] ocfs2: Remove void casts

[Added maintainer CCs]
Jack Stone wrote:
> Fixed Patch
>
> Thanks,
>
> Jack
>
> --
>
> ocfs2: Remove void casts
>
> From: Jack Stone <[email protected]>
>
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>
> fs/ocfs2/dlm/dlmmaster.c | 12 ++++--------
> 1 files changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
> index f8b653f..52ee37d 100644
> --- a/fs/ocfs2/dlm/dlmmaster.c
> +++ b/fs/ocfs2/dlm/dlmmaster.c
> @@ -758,8 +758,7 @@ lookup:
> spin_unlock(&dlm->spinlock);
> mlog(0, "allocating a new resource\n");
> /* nothing found and we need to allocate one. */
> - alloc_mle = (struct dlm_master_list_entry *)
> - kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
> + alloc_mle = kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
> if (!alloc_mle)
> goto leave;
> res = dlm_new_lockres(dlm, lockid, namelen);
> @@ -1543,8 +1542,7 @@ way_up_top:
> spin_unlock(&dlm->master_lock);
> spin_unlock(&dlm->spinlock);
>
> - mle = (struct dlm_master_list_entry *)
> - kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
> + mle = kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
> if (!mle) {
> response = DLM_MASTER_RESP_ERROR;
> mlog_errno(-ENOMEM);
> @@ -2455,8 +2453,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
> goto leave;
> }
>
> - mle = (struct dlm_master_list_entry *) kmem_cache_alloc(dlm_mle_cache,
> - GFP_NOFS);
> + mle = kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
> if (!mle) {
> mlog_errno(ret);
> goto leave;
> @@ -3036,8 +3033,7 @@ int dlm_migrate_request_handler(struct o2net_msg
> *msg, u32 len, void *data,
> hash = dlm_lockid_hash(name, namelen);
>
> /* preallocate.. if this fails, abort */
> - mle = (struct dlm_master_list_entry *) kmem_cache_alloc(dlm_mle_cache,
> - GFP_NOFS);
> + mle = kmem_cache_alloc(dlm_mle_cache, GFP_NOFS);
>
> if (!mle) {
> ret = -ENOMEM;
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2009-04-09 10:18:32

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 37/56] oss: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> sound/oss/msnd.c | 2 +-
> sound/oss/pss.c | 6 +++---
> sound/oss/sequencer.c | 4 ++--
> sound/oss/sscape.c | 2 +-
> 4 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/sound/oss/msnd.c b/sound/oss/msnd.c
> index e4282d9..21eb6dc 100644
> --- a/sound/oss/msnd.c
> +++ b/sound/oss/msnd.c
> @@ -100,7 +100,7 @@ void msnd_fifo_free(msnd_fifo *f)
> int msnd_fifo_alloc(msnd_fifo *f, size_t n)
> {
> msnd_fifo_free(f);
> - f->data = (char *)vmalloc(n);
> + f->data = vmalloc(n);
> f->n = n;
> f->tail = 0;
> f->head = 0;
> diff --git a/sound/oss/pss.c b/sound/oss/pss.c
> index 83f5ee2..82f4d5a 100644
> --- a/sound/oss/pss.c
> +++ b/sound/oss/pss.c
> @@ -859,7 +859,7 @@ static int pss_coproc_ioctl(void *dev_info, unsigned int cmd, void __user *arg,
> return 0;
>
> case SNDCTL_COPR_LOAD:
> - buf = (copr_buffer *) vmalloc(sizeof(copr_buffer));
> + buf = vmalloc(sizeof(copr_buffer));
> if (buf == NULL)
> return -ENOSPC;
> if (copy_from_user(buf, arg, sizeof(copr_buffer))) {
> @@ -871,7 +871,7 @@ static int pss_coproc_ioctl(void *dev_info, unsigned int cmd, void __user *arg,
> return err;
>
> case SNDCTL_COPR_SENDMSG:
> - mbuf = (copr_msg *)vmalloc(sizeof(copr_msg));
> + mbuf = vmalloc(sizeof(copr_msg));
> if (mbuf == NULL)
> return -ENOSPC;
> if (copy_from_user(mbuf, arg, sizeof(copr_msg))) {
> @@ -895,7 +895,7 @@ static int pss_coproc_ioctl(void *dev_info, unsigned int cmd, void __user *arg,
>
> case SNDCTL_COPR_RCVMSG:
> err = 0;
> - mbuf = (copr_msg *)vmalloc(sizeof(copr_msg));
> + mbuf = vmalloc(sizeof(copr_msg));
> if (mbuf == NULL)
> return -ENOSPC;
> data = (unsigned short *)mbuf->data;
> diff --git a/sound/oss/sequencer.c b/sound/oss/sequencer.c
> index c798746..31c01ba 100644
> --- a/sound/oss/sequencer.c
> +++ b/sound/oss/sequencer.c
> @@ -1648,13 +1648,13 @@ void sequencer_init(void)
> {
> if (sequencer_ok)
> return;
> - queue = (unsigned char *)vmalloc(SEQ_MAX_QUEUE * EV_SZ);
> + queue = vmalloc(SEQ_MAX_QUEUE * EV_SZ);
> if (queue == NULL)
> {
> printk(KERN_ERR "sequencer: Can't allocate memory for sequencer output queue\n");
> return;
> }
> - iqueue = (unsigned char *)vmalloc(SEQ_MAX_QUEUE * IEV_SZ);
> + iqueue = vmalloc(SEQ_MAX_QUEUE * IEV_SZ);
> if (iqueue == NULL)
> {
> printk(KERN_ERR "sequencer: Can't allocate memory for sequencer input queue\n");
> diff --git a/sound/oss/sscape.c b/sound/oss/sscape.c
> index 30c36d1..9d6b9b0 100644
> --- a/sound/oss/sscape.c
> +++ b/sound/oss/sscape.c
> @@ -573,7 +573,7 @@ static int sscape_coproc_ioctl(void *dev_info, unsigned int cmd, void __user *ar
> return 0;
>
> case SNDCTL_COPR_LOAD:
> - buf = (copr_buffer *) vmalloc(sizeof(copr_buffer));
> + buf = vmalloc(sizeof(copr_buffer));
> if (buf == NULL)
> return -ENOSPC;
> if (copy_from_user(buf, arg, sizeof(copr_buffer)))
>

2009-04-09 10:19:33

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 38/56] pci: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> drivers/pci/intel-iommu.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
> index fb3a3f3..c0dd267 100644
> --- a/drivers/pci/intel-iommu.c
> +++ b/drivers/pci/intel-iommu.c
> @@ -519,7 +519,7 @@ static struct context_entry * device_to_context_entry(struct intel_iommu *iommu,
> root = &iommu->root_entry[bus];
> context = get_context_addr_from_root(root);
> if (!context) {
> - context = (struct context_entry *)alloc_pgtable_page();
> + context = alloc_pgtable_page();
> if (!context) {
> spin_unlock_irqrestore(&iommu->lock, flags);
> return NULL;
> @@ -789,7 +789,7 @@ static int iommu_alloc_root_entry(struct intel_iommu *iommu)
> struct root_entry *root;
> unsigned long flags;
>
> - root = (struct root_entry *)alloc_pgtable_page();
> + root = alloc_pgtable_page();
> if (!root)
> return -ENOMEM;
>
> @@ -1290,7 +1290,7 @@ static int domain_init(struct dmar_domain *domain, int guest_width)
> domain->iommu_count = 1;
>
> /* always allocate the top pgd */
> - domain->pgd = (struct dma_pte *)alloc_pgtable_page();
> + domain->pgd = alloc_pgtable_page();
> if (!domain->pgd)
> return -ENOMEM;
> __iommu_flush_cache(iommu, domain->pgd, PAGE_SIZE);
> @@ -3019,7 +3019,7 @@ static int vm_domain_init(struct dmar_domain *domain, int guest_width)
> domain->max_addr = 0;
>
> /* always allocate the top pgd */
> - domain->pgd = (struct dma_pte *)alloc_pgtable_page();
> + domain->pgd = alloc_pgtable_page();
> if (!domain->pgd)
> return -ENOMEM;
> domain_flush_cache(domain, domain->pgd, PAGE_SIZE);
>

2009-04-09 10:20:32

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 39/56] powerpc: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> arch/powerpc/sysdev/fsl_soc.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
> index afe8dbc..f63d668 100644
> --- a/arch/powerpc/sysdev/fsl_soc.c
> +++ b/arch/powerpc/sysdev/fsl_soc.c
> @@ -186,7 +186,7 @@ static int __init of_add_fixed_phys(void)
> struct fixed_phy_status status = {};
>
> for_each_node_by_name(np, "ethernet") {
> - fixed_link = (u32 *)of_get_property(np, "fixed-link", NULL);
> + fixed_link = of_get_property(np, "fixed-link", NULL);
> if (!fixed_link)
> continue;
>
>

2009-04-09 10:22:27

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 41/56] reiserfs: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> fs/reiserfs/inode.c | 2 +-
> fs/reiserfs/super.c | 3 +--
> fs/reiserfs/tail_conversion.c | 2 +-
> 3 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
> index 6fd0f47..b304e16 100644
> --- a/fs/reiserfs/inode.c
> +++ b/fs/reiserfs/inode.c
> @@ -349,7 +349,7 @@ static int _get_block_create_0(struct inode *inode, sector_t block,
> ** kmap schedules
> */
> if (!p) {
> - p = (char *)kmap(bh_result->b_page);
> + p = kmap(bh_result->b_page);
> if (fs_changed(fs_gen, inode->i_sb)
> && item_moved(&tmp_ih, &path)) {
> goto research;
> diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
> index 0ae6486..ada745d 100644
> --- a/fs/reiserfs/super.c
> +++ b/fs/reiserfs/super.c
> @@ -510,8 +510,7 @@ static struct kmem_cache *reiserfs_inode_cachep;
> static struct inode *reiserfs_alloc_inode(struct super_block *sb)
> {
> struct reiserfs_inode_info *ei;
> - ei = (struct reiserfs_inode_info *)
> - kmem_cache_alloc(reiserfs_inode_cachep, GFP_KERNEL);
> + ei = kmem_cache_alloc(reiserfs_inode_cachep, GFP_KERNEL);
> if (!ei)
> return NULL;
> return &ei->vfs_inode;
> diff --git a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c
> index d7f6e51..2916393 100644
> --- a/fs/reiserfs/tail_conversion.c
> +++ b/fs/reiserfs/tail_conversion.c
> @@ -211,7 +211,7 @@ int indirect2direct(struct reiserfs_transaction_handle *th,
> // append can be done either
> // we are in truncate or packing tail in file_release
>
> - tail = (char *)kmap(page); /* this can schedule */
> + tail = kmap(page); /* this can schedule */
>
> if (path_changed(&s_ih, path)) {
> /* re-search indirect item */
>

2009-04-09 10:23:50

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 42/56] drivers/s390: Remove void casts

[Added maintainer CCs]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> drivers/s390/net/qeth_core_main.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
> index c827d69..454e181 100644
> --- a/drivers/s390/net/qeth_core_main.c
> +++ b/drivers/s390/net/qeth_core_main.c
> @@ -1037,7 +1037,7 @@ static int qeth_is_1920_device(struct qeth_card *card)
> QETH_DBF_TEXT(SETUP, 2, "chk_1920");
>
> ccwdev = card->data.ccwdev;
> - chp_dsc = (struct channelPath_dsc *)ccw_device_get_chp_desc(ccwdev, 0);
> + chp_dsc = ccw_device_get_chp_desc(ccwdev, 0);
> if (chp_dsc != NULL) {
> /* CHPP field bit 6 == 1 -> single queue */
> single_queue = ((chp_dsc->chpp & 0x02) == 0x02);
>

2009-04-09 10:26:33

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 43/56] s390: Remove void casts

[Added maintainer CCs]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> arch/s390/math-emu/math.c | 26 +++++++++++++-------------
> 1 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/arch/s390/math-emu/math.c b/arch/s390/math-emu/math.c
> index 3ee78cc..c1d43c9 100644
> --- a/arch/s390/math-emu/math.c
> +++ b/arch/s390/math-emu/math.c
> @@ -1917,7 +1917,7 @@ int math_emu_ed(__u8 *opcode, struct pt_regs * regs) {
>
> emu_store_regd((opcode[1] >> 4) & 15);
> opc = *((__u32 *) opcode);
> - dxb = (__u64 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
> + dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
> mathemu_copy_from_user(&temp, dxb, 8);
> /* call the emulation function */
> _fex = ((int (*)(struct pt_regs *, int, double *))
> @@ -1932,7 +1932,7 @@ int math_emu_ed(__u8 *opcode, struct pt_regs * regs) {
>
> emu_store_rege((opcode[1] >> 4) & 15);
> opc = *((__u32 *) opcode);
> - dxb = (__u32 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
> + dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
> mathemu_get_user(temp, dxb);
> /* call the emulation function */
> _fex = ((int (*)(struct pt_regs *, int, float *))
> @@ -1948,7 +1948,7 @@ int math_emu_ed(__u8 *opcode, struct pt_regs * regs) {
> emu_store_regd((opcode[1] >> 4) & 15);
> emu_store_regd((opcode[4] >> 4) & 15);
> opc = *((__u32 *) opcode);
> - dxb = (__u64 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
> + dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
> mathemu_copy_from_user(&temp, dxb, 8);
> /* call the emulation function */
> _fex = ((int (*)(struct pt_regs *, int, double *, int))
> @@ -1964,7 +1964,7 @@ int math_emu_ed(__u8 *opcode, struct pt_regs * regs) {
> emu_store_rege((opcode[1] >> 4) & 15);
> emu_store_rege((opcode[4] >> 4) & 15);
> opc = *((__u32 *) opcode);
> - dxb = (__u32 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
> + dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
> mathemu_get_user(temp, dxb);
> /* call the emulation function */
> _fex = ((int (*)(struct pt_regs *, int, float *, int))
> @@ -1982,7 +1982,7 @@ int math_emu_ed(__u8 *opcode, struct pt_regs * regs) {
> return SIGILL;
> emu_store_regd((opcode[1] >> 4) & 15);
> opc = *((__u32 *) opcode);
> - dxb = (__u64 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
> + dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
> mathemu_copy_from_user(&temp, dxb, 8);
> /* call the emulation function */
> _fex = ((int (*)(struct pt_regs *, int, double *))
> @@ -1999,7 +1999,7 @@ int math_emu_ed(__u8 *opcode, struct pt_regs * regs) {
> __u32 opc;
> emu_store_rege((opcode[1] >> 4) & 15);
> opc = *((__u32 *) opcode);
> - dxb = (__u32 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
> + dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
> mathemu_get_user(temp, dxb);
> /* call the emulation function */
> _fex = ((int (*)(struct pt_regs *, int, float *))
> @@ -2017,7 +2017,7 @@ int math_emu_ed(__u8 *opcode, struct pt_regs * regs) {
> return SIGILL;
> emu_store_rege((opcode[1] >> 4) & 15);
> opc = *((__u32 *) opcode);
> - dxb = (__u32 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
> + dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
> mathemu_get_user(temp, dxb);
> /* call the emulation function */
> _fex = ((int (*)(struct pt_regs *, int, float *))
> @@ -2148,7 +2148,7 @@ int math_emu_ld(__u8 *opcode, struct pt_regs * regs) {
> __u32 opc = *((__u32 *) opcode);
> __u64 *dxb;
>
> - dxb = (__u64 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
> + dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
> mathemu_copy_from_user(&fp_regs->fprs[(opc >> 20) & 0xf].d, dxb, 8);
> return 0;
> }
> @@ -2161,7 +2161,7 @@ int math_emu_le(__u8 *opcode, struct pt_regs * regs) {
> __u32 opc = *((__u32 *) opcode);
> __u32 *mem, *dxb;
>
> - dxb = (__u32 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
> + dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
> mem = (__u32 *) (&fp_regs->fprs[(opc >> 20) & 0xf].f);
> mathemu_get_user(mem[0], dxb);
> return 0;
> @@ -2175,7 +2175,7 @@ int math_emu_std(__u8 *opcode, struct pt_regs * regs) {
> __u32 opc = *((__u32 *) opcode);
> __u64 *dxb;
>
> - dxb = (__u64 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
> + dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
> mathemu_copy_to_user(dxb, &fp_regs->fprs[(opc >> 20) & 0xf].d, 8);
> return 0;
> }
> @@ -2188,7 +2188,7 @@ int math_emu_ste(__u8 *opcode, struct pt_regs * regs) {
> __u32 opc = *((__u32 *) opcode);
> __u32 *mem, *dxb;
>
> - dxb = (__u32 *) calc_addr(regs, opc >> 16, opc >> 12, opc);
> + dxb = calc_addr(regs, opc >> 16, opc >> 12, opc);
> mem = (__u32 *) (&fp_regs->fprs[(opc >> 20) & 0xf].f);
> mathemu_put_user(mem[0], dxb);
> return 0;
> @@ -2201,7 +2201,7 @@ int math_emu_lfpc(__u8 *opcode, struct pt_regs *regs) {
> __u32 opc = *((__u32 *) opcode);
> __u32 *dxb, temp;
>
> - dxb= (__u32 *) calc_addr(regs, 0, opc>>12, opc);
> + dxb= calc_addr(regs, 0, opc>>12, opc);
> mathemu_get_user(temp, dxb);
> if ((temp & ~FPC_VALID_MASK) != 0)
> return SIGILL;
> @@ -2216,7 +2216,7 @@ int math_emu_stfpc(__u8 *opcode, struct pt_regs *regs) {
> __u32 opc = *((__u32 *) opcode);
> __u32 *dxb;
>
> - dxb= (__u32 *) calc_addr(regs, 0, opc>>12, opc);
> + dxb= calc_addr(regs, 0, opc>>12, opc);
> mathemu_put_user(current->thread.fp_regs.fpc, dxb);
> return 0;
> }
>

2009-04-09 10:28:01

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 45/56] scsi: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Fixed patch
>
> Thanks,
>
> Jack
>
> --
>
> scsi: Remove void casts
>
> From: Jack Stone <[email protected]>
>
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>
> drivers/scsi/aic7xxx/aic79xx_core.c | 6 ++----
> drivers/scsi/aic7xxx/aic7xxx_core.c | 9 +++------
> drivers/scsi/aic7xxx/aicasm/aicasm.c | 10 +++++-----
> drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c | 4 ++--
> drivers/scsi/aic7xxx_old.c | 3 +--
> drivers/scsi/ibmvscsi/ibmvscsi.c | 3 +--
> drivers/scsi/ibmvscsi/ibmvstgt.c | 3 +--
> drivers/scsi/lpfc/lpfc_hbadisc.c | 3 +--
> drivers/scsi/lpfc/lpfc_init.c | 4 ++--
> drivers/scsi/lpfc/lpfc_nportdisc.c | 4 ++--
> drivers/scsi/lpfc/lpfc_sli.c | 8 ++++----
> drivers/scsi/osst.c | 6 +++---
> drivers/scsi/scsi_debug.c | 2 +-
> 13 files changed, 28 insertions(+), 37 deletions(-)
>
> diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c
> b/drivers/scsi/aic7xxx/aic79xx_core.c
> index 63b521d..b971974 100644
> --- a/drivers/scsi/aic7xxx/aic79xx_core.c
> +++ b/drivers/scsi/aic7xxx/aic79xx_core.c
> @@ -6932,13 +6932,11 @@ ahd_alloc_scbs(struct ahd_softc *ahd)
> int error;
> #endif
>
> - next_scb = (struct scb *)malloc(sizeof(*next_scb),
> - M_DEVBUF, M_NOWAIT);
> + next_scb = malloc(sizeof(*next_scb), M_DEVBUF, M_NOWAIT);
> if (next_scb == NULL)
> break;
>
> - pdata = (struct scb_platform_data *)malloc(sizeof(*pdata),
> - M_DEVBUF, M_NOWAIT);
> + pdata = malloc(sizeof(*pdata), M_DEVBUF, M_NOWAIT);
> if (pdata == NULL) {
> free(next_scb, M_DEVBUF);
> break;
> diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c
> b/drivers/scsi/aic7xxx/aic7xxx_core.c
> index e6f2bb7..e17825d 100644
> --- a/drivers/scsi/aic7xxx/aic7xxx_core.c
> +++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
> @@ -2152,8 +2152,7 @@ ahc_alloc_tstate(struct ahc_softc *ahc, u_int
> scsi_id, char channel)
> && ahc->enabled_targets[scsi_id] != master_tstate)
> panic("%s: ahc_alloc_tstate - Target already allocated",
> ahc_name(ahc));
> - tstate = (struct ahc_tmode_tstate*)malloc(sizeof(*tstate),
> - M_DEVBUF, M_NOWAIT);
> + tstate = malloc(sizeof(*tstate), M_DEVBUF, M_NOWAIT);
> if (tstate == NULL)
> return (NULL);
>
> @@ -4783,8 +4782,7 @@ ahc_init_scbdata(struct ahc_softc *ahc)
> SLIST_INIT(&scb_data->sg_maps);
>
> /* Allocate SCB resources */
> - scb_data->scbarray =
> - (struct scb *)malloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC,
> + scb_data->scbarray = malloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC,
> M_DEVBUF, M_NOWAIT);
> if (scb_data->scbarray == NULL)
> return (ENOMEM);
> @@ -5014,8 +5012,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc)
> #ifndef __linux__
> int error;
> #endif
> - pdata = (struct scb_platform_data *)malloc(sizeof(*pdata),
> - M_DEVBUF, M_NOWAIT);
> + pdata = malloc(sizeof(*pdata), M_DEVBUF, M_NOWAIT);
> if (pdata == NULL)
> break;
> next_scb->platform_data = pdata;
> diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm.c
> b/drivers/scsi/aic7xxx/aicasm/aicasm.c
> index e4a7787..38e1690 100644
> --- a/drivers/scsi/aic7xxx/aicasm/aicasm.c
> +++ b/drivers/scsi/aic7xxx/aicasm/aicasm.c
> @@ -497,7 +497,7 @@ emit_patch(scope_t *scope, int patch)
> /* No-Op patch */
> return;
>
> - new_patch = (patch_t *)malloc(sizeof(*new_patch));
> + new_patch = malloc(sizeof(*new_patch));
>
> if (new_patch == NULL)
> stop("Could not malloc patch structure", EX_OSERR);
> @@ -550,7 +550,7 @@ output_listing(char *ifilename)
>
> func_values = NULL;
> if (func_count != 0) {
> - func_values = (int *)malloc(func_count * sizeof(int));
> + func_values = malloc(func_count * sizeof(int));
>
> if (func_values == NULL)
> stop("Could not malloc", EX_OSERR);
> @@ -734,7 +734,7 @@ seq_alloc()
> {
> struct instruction *new_instr;
>
> - new_instr = (struct instruction *)malloc(sizeof(struct instruction));
> + new_instr = malloc(sizeof(struct instruction));
> if (new_instr == NULL)
> stop("Unable to malloc instruction object", EX_SOFTWARE);
> memset(new_instr, 0, sizeof(*new_instr));
> @@ -748,7 +748,7 @@ cs_alloc()
> {
> critical_section_t *new_cs;
>
> - new_cs= (critical_section_t *)malloc(sizeof(critical_section_t));
> + new_cs= malloc(sizeof(critical_section_t));
> if (new_cs == NULL)
> stop("Unable to malloc critical_section object", EX_SOFTWARE);
> memset(new_cs, 0, sizeof(*new_cs));
> @@ -762,7 +762,7 @@ scope_alloc()
> {
> scope_t *new_scope;
>
> - new_scope = (scope_t *)malloc(sizeof(scope_t));
> + new_scope = malloc(sizeof(scope_t));
> if (new_scope == NULL)
> stop("Unable to malloc scope object", EX_SOFTWARE);
> memset(new_scope, 0, sizeof(*new_scope));
> diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
> b/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
> index 078ed60..c7c5812 100644
> --- a/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
> +++ b/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
> @@ -67,7 +67,7 @@ symbol_create(char *name)
> {
> symbol_t *new_symbol;
>
> - new_symbol = (symbol_t *)malloc(sizeof(symbol_t));
> + new_symbol = malloc(sizeof(symbol_t));
> if (new_symbol == NULL) {
> perror("Unable to create new symbol");
> exit(EX_SOFTWARE);
> @@ -227,7 +227,7 @@ symlist_add(symlist_t *symlist, symbol_t *symbol,
> int how)
> {
> symbol_node_t *newnode;
>
> - newnode = (symbol_node_t *)malloc(sizeof(symbol_node_t));
> + newnode = malloc(sizeof(symbol_node_t));
> if (newnode == NULL) {
> stop("symlist_add: Unable to malloc symbol_node", EX_SOFTWARE);
> /* NOTREACHED */
> diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c
> index 93984c9..96c2f92 100644
> --- a/drivers/scsi/aic7xxx_old.c
> +++ b/drivers/scsi/aic7xxx_old.c
> @@ -2569,8 +2569,7 @@ aic7xxx_allocate_scb(struct aic7xxx_host *p)
> if (scb_ap == NULL)
> return(0);
> scb_dma = (struct aic7xxx_scb_dma *)&scb_ap[scb_count];
> - hsgp = (struct hw_scatterlist *)
> - pci_alloc_consistent(p->pdev, scb_size * scb_count,
> + hsgp = pci_alloc_consistent(p->pdev, scb_size * scb_count,
> &scb_dma->dma_address);
> if (hsgp == NULL)
> {
> diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c
> b/drivers/scsi/ibmvscsi/ibmvscsi.c
> index c9aa761..7a90d4c 100644
> --- a/drivers/scsi/ibmvscsi/ibmvscsi.c
> +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
> @@ -423,8 +423,7 @@ static int map_sg_data(struct scsi_cmnd *cmd,
>
> /* get indirect table */
> if (!evt_struct->ext_list) {
> - evt_struct->ext_list = (struct srp_direct_buf *)
> - dma_alloc_coherent(dev,
> + evt_struct->ext_list = dma_alloc_coherent(dev,
> SG_ALL * sizeof(struct srp_direct_buf),
> &evt_struct->ext_list_token, 0);
> if (!evt_struct->ext_list) {
> diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c
> b/drivers/scsi/ibmvscsi/ibmvstgt.c
> index e2dd6a4..ceb3737 100644
> --- a/drivers/scsi/ibmvscsi/ibmvstgt.c
> +++ b/drivers/scsi/ibmvscsi/ibmvstgt.c
> @@ -852,8 +852,7 @@ static int ibmvstgt_probe(struct vio_dev *dev, const
> struct vio_device_id *id)
> if (err)
> goto put_host;
>
> - dma = (unsigned int *) vio_get_attribute(dev, "ibm,my-dma-window",
> - &dma_size);
> + dma = vio_get_attribute(dev, "ibm,my-dma-window", &dma_size);
> if (!dma || dma_size != 40) {
> eprintk("Couldn't get window property %d\n", dma_size);
> err = -EIO;
> diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c
> b/drivers/scsi/lpfc/lpfc_hbadisc.c
> index 311ed6d..dabe99d 100644
> --- a/drivers/scsi/lpfc/lpfc_hbadisc.c
> +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
> @@ -2441,8 +2441,7 @@ lpfc_setup_disc_node(struct lpfc_vport *vport,
> uint32_t did)
> if ((vport->fc_flag & FC_RSCN_MODE) != 0 &&
> lpfc_rscn_payload_check(vport, did) == 0)
> return NULL;
> - ndlp = (struct lpfc_nodelist *)
> - mempool_alloc(vport->phba->nlp_mem_pool, GFP_KERNEL);
> + ndlp = mempool_alloc(vport->phba->nlp_mem_pool, GFP_KERNEL);
> if (!ndlp)
> return NULL;
> lpfc_nlp_init(vport, ndlp, did);
> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> index 06874e6..808a66b 100644
> --- a/drivers/scsi/lpfc/lpfc_init.c
> +++ b/drivers/scsi/lpfc/lpfc_init.c
> @@ -992,7 +992,7 @@ lpfc_handle_latt(struct lpfc_hba *phba)
> struct lpfc_dmabuf *mp;
> int rc = 0;
>
> - pmb = (LPFC_MBOXQ_t *)mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
> + pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
> if (!pmb) {
> rc = 1;
> goto lpfc_handle_latt_err_exit;
> @@ -2322,7 +2322,7 @@ lpfc_enable_msix(struct lpfc_hba *phba)
> /*
> * Configure HBA MSI-X attention conditions to messages
> */
> - pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
> + pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
>
> if (!pmb) {
> rc = -ENOMEM;
> diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c
> b/drivers/scsi/lpfc/lpfc_nportdisc.c
> index 8f548ad..0ab2616 100644
> --- a/drivers/scsi/lpfc/lpfc_nportdisc.c
> +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
> @@ -1082,7 +1082,7 @@ lpfc_cmpl_adisc_adisc_issue(struct lpfc_vport *vport,
> cmdiocb = (struct lpfc_iocbq *) arg;
> rspiocb = cmdiocb->context_un.rsp_iocb;
>
> - ap = (ADISC *)lpfc_check_elscmpl_iocb(phba, cmdiocb, rspiocb);
> + ap = lpfc_check_elscmpl_iocb(phba, cmdiocb, rspiocb);
> irsp = &rspiocb->iocb;
>
> if ((irsp->ulpStatus) ||
> @@ -1420,7 +1420,7 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport
> *vport, struct lpfc_nodelist *ndlp,
>
> cmdiocb = (struct lpfc_iocbq *) arg;
> rspiocb = cmdiocb->context_un.rsp_iocb;
> - npr = (PRLI *)lpfc_check_elscmpl_iocb(phba, cmdiocb, rspiocb);
> + npr = lpfc_check_elscmpl_iocb(phba, cmdiocb, rspiocb);
>
> irsp = &rspiocb->iocb;
> if (irsp->ulpStatus) {
> diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
> index a36a120..966fcc5 100644
> --- a/drivers/scsi/lpfc/lpfc_sli.c
> +++ b/drivers/scsi/lpfc/lpfc_sli.c
> @@ -313,7 +313,7 @@ lpfc_sli_ring_map(struct lpfc_hba *phba)
> MAILBOX_t *pmbox;
> int i, rc, ret = 0;
>
> - pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
> + pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
> if (!pmb)
> return -ENOMEM;
> pmbox = &pmb->mb;
> @@ -2591,7 +2591,7 @@ lpfc_sli_brdkill(struct lpfc_hba *phba)
> "0329 Kill HBA Data: x%x x%x\n",
> phba->pport->port_state, psli->sli_flag);
>
> - pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
> + pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
> if (!pmb)
> return 1;
>
> @@ -2939,7 +2939,7 @@ lpfc_sli_hbq_setup(struct lpfc_hba *phba)
> /* Get a Mailbox buffer to setup mailbox
> * commands for HBA initialization
> */
> - pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
> + pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
>
> if (!pmb)
> return -ENOMEM;
> @@ -3006,7 +3006,7 @@ lpfc_sli_config_port(struct lpfc_hba *phba, int
> sli_mode)
> LPFC_MBOXQ_t *pmb;
> uint32_t resetcount = 0, rc = 0, done = 0;
>
> - pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
> + pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
> if (!pmb) {
> phba->link_state = LPFC_HBA_ERROR;
> return -ENOMEM;
> diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
> index acb8358..bd6c3a3 100644
> --- a/drivers/scsi/osst.c
> +++ b/drivers/scsi/osst.c
> @@ -1482,7 +1482,7 @@ static int
> osst_read_back_buffer_and_rewrite(struct osst_tape * STp, struct osst
> int dbg = debugging;
> #endif
>
> - if ((buffer = (unsigned char *)vmalloc((nframes + 1) *
> OS_DATA_SIZE)) == NULL)
> + if ((buffer = vmalloc((nframes + 1) * OS_DATA_SIZE)) == NULL)
> return (-EIO);
>
> printk(KERN_INFO "%s:I: Reading back %d frames from drive buffer%s\n",
> @@ -2294,7 +2294,7 @@ static int osst_write_header(struct osst_tape *
> STp, struct osst_request ** aSRp
> if (STp->raw) return 0;
>
> if (STp->header_cache == NULL) {
> - if ((STp->header_cache = (os_header_t
> *)vmalloc(sizeof(os_header_t))) == NULL) {
> + if ((STp->header_cache = vmalloc(sizeof(os_header_t))) == NULL) {
> printk(KERN_ERR "%s:E: Failed to allocate header cache\n",
> name);
> return (-ENOMEM);
> }
> @@ -2482,7 +2482,7 @@ static int __osst_analyze_headers(struct osst_tape
> * STp, struct osst_request **
> name, ppos, update_frame_cntr);
> #endif
> if (STp->header_cache == NULL) {
> - if ((STp->header_cache = (os_header_t
> *)vmalloc(sizeof(os_header_t))) == NULL) {
> + if ((STp->header_cache = vmalloc(sizeof(os_header_t))) ==
> NULL) {
> printk(KERN_ERR "%s:E: Failed to allocate header
> cache\n", name);
> return 0;
> }
> diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
> index 213123b..379fa35 100644
> --- a/drivers/scsi/scsi_debug.c
> +++ b/drivers/scsi/scsi_debug.c
> @@ -1947,7 +1947,7 @@ static int resp_xdwriteread(struct scsi_cmnd *scp,
> unsigned long long lba,
>
> offset = 0;
> for_each_sg(sdb->table.sgl, sg, sdb->table.nents, i) {
> - kaddr = (unsigned char *)kmap_atomic(sg_page(sg), KM_USER0);
> + kaddr = kmap_atomic(sg_page(sg), KM_USER0);
> if (!kaddr)
> goto out;
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2009-04-09 10:33:26

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 49/56] sparc: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> arch/sparc/kernel/iommu.c | 2 +-
> arch/sparc/kernel/signal32.c | 6 ++----
> arch/sparc/kernel/signal_32.c | 6 ++----
> arch/sparc/kernel/signal_64.c | 3 +--
> 4 files changed, 6 insertions(+), 11 deletions(-)
>
> diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c
> index d8900e1..792c0e8 100644
> --- a/arch/sparc/kernel/iommu.c
> +++ b/arch/sparc/kernel/iommu.c
> @@ -220,7 +220,7 @@ int iommu_table_init(struct iommu *iommu, int tsbsize,
> printk(KERN_ERR "IOMMU: Error, gfp(tsb) failed.\n");
> goto out_free_dummy_page;
> }
> - iommu->page_table = (iopte_t *)page_address(page);
> + iommu->page_table = page_address(page);
>
> for (i = 0; i < num_tsb_entries; i++)
> iopte_make_dummy(iommu, &iommu->page_table[i]);
> diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c
> index ba5b09a..432a0ad 100644
> --- a/arch/sparc/kernel/signal32.c
> +++ b/arch/sparc/kernel/signal32.c
> @@ -468,8 +468,7 @@ static void setup_frame32(struct k_sigaction *ka, struct pt_regs *regs,
> if (!(current_thread_info()->fpsaved[0] & FPRS_FEF))
> sigframe_size -= sizeof(__siginfo_fpu_t);
>
> - sf = (struct signal_frame32 __user *)
> - get_sigframe(&ka->sa, regs, sigframe_size);
> + sf = get_sigframe(&ka->sa, regs, sigframe_size);
>
> if (invalid_frame_pointer(sf, sigframe_size))
> goto sigill;
> @@ -603,8 +602,7 @@ static void setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs,
> if (!(current_thread_info()->fpsaved[0] & FPRS_FEF))
> sigframe_size -= sizeof(__siginfo_fpu_t);
>
> - sf = (struct rt_signal_frame32 __user *)
> - get_sigframe(&ka->sa, regs, sigframe_size);
> + sf = get_sigframe(&ka->sa, regs, sigframe_size);
>
> if (invalid_frame_pointer(sf, sigframe_size))
> goto sigill;
> diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c
> index 181d069..45ef48e 100644
> --- a/arch/sparc/kernel/signal_32.c
> +++ b/arch/sparc/kernel/signal_32.c
> @@ -326,8 +326,7 @@ static void setup_frame(struct k_sigaction *ka, struct pt_regs *regs,
> if (!used_math())
> sigframe_size -= sizeof(__siginfo_fpu_t);
>
> - sf = (struct signal_frame __user *)
> - get_sigframe(&ka->sa, regs, sigframe_size);
> + sf = get_sigframe(&ka->sa, regs, sigframe_size);
>
> if (invalid_frame_pointer(sf, sigframe_size))
> goto sigill_and_return;
> @@ -402,8 +401,7 @@ static void setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
> sigframe_size = RT_ALIGNEDSZ;
> if (!used_math())
> sigframe_size -= sizeof(__siginfo_fpu_t);
> - sf = (struct rt_signal_frame __user *)
> - get_sigframe(&ka->sa, regs, sigframe_size);
> + sf = get_sigframe(&ka->sa, regs, sigframe_size);
> if (invalid_frame_pointer(sf, sigframe_size))
> goto sigill;
> if (current_thread_info()->w_saved != 0)
> diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c
> index ec82d76..638bfe6 100644
> --- a/arch/sparc/kernel/signal_64.c
> +++ b/arch/sparc/kernel/signal_64.c
> @@ -422,8 +422,7 @@ setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
> if (!(current_thread_info()->fpsaved[0] & FPRS_FEF))
> sigframe_size -= sizeof(__siginfo_fpu_t);
>
> - sf = (struct rt_signal_frame __user *)
> - get_sigframe(ka, regs, sigframe_size);
> + sf = get_sigframe(ka, regs, sigframe_size);
>
> if (invalid_frame_pointer (sf, sigframe_size))
> goto sigill;
>

2009-04-09 10:33:57

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 50/56] drivers/staging: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Fixed patch
>
> Thanks,
>
> Jack
>
> --
>
> drivers/staging: Remove void casts
>
> From: Jack Stone <[email protected]>
>
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>
> drivers/staging/altpciechdma/altpciechdma.c | 4 ++--
> drivers/staging/epl/EplApiLinuxKernel.c | 8 ++------
> drivers/staging/et131x/et1310_rx.c | 4 ++--
> drivers/staging/rtl8187se/r8180_core.c | 13 ++++++-------
> drivers/staging/slicoss/slicoss.c | 3 +--
> 5 files changed, 13 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/staging/altpciechdma/altpciechdma.c
> b/drivers/staging/altpciechdma/altpciechdma.c
> index 5869e14..f613a1d 100644
> --- a/drivers/staging/altpciechdma/altpciechdma.c
> +++ b/drivers/staging/altpciechdma/altpciechdma.c
> @@ -535,7 +535,7 @@ static int __devinit dma_test(struct ape_dev *ape,
> struct pci_dev *dev)
>
> /* allocate and map coherently-cached memory for a DMA-able buffer */
> /* @see Documentation/PCI/PCI-DMA-mapping.txt, near line 318 */
> - buffer_virt = (u8 *)pci_alloc_consistent(dev, PAGE_SIZE * 4,
> &buffer_bus);
> + buffer_virt = pci_alloc_consistent(dev, PAGE_SIZE * 4, &buffer_bus);
> if (!buffer_virt) {
> printk(KERN_DEBUG "Could not allocate coherent DMA buffer.\n");
> goto fail;
> @@ -793,7 +793,7 @@ static int __devinit probe(struct pci_dev *dev,
> const struct pci_device_id *id)
>
> /* allocate and map coherently-cached memory for a descriptor table */
> /* @see LDD3 page 446 */
> - ape->table_virt = (struct ape_chdma_table *)pci_alloc_consistent(dev,
> + ape->table_virt = pci_alloc_consistent(dev,
> APE_CHDMA_TABLE_SIZE, &ape->table_bus);
> /* could not allocate table? */
> if (!ape->table_virt) {
> diff --git a/drivers/staging/epl/EplApiLinuxKernel.c
> b/drivers/staging/epl/EplApiLinuxKernel.c
> index cb3e275..4c5dfcd 100644
> --- a/drivers/staging/epl/EplApiLinuxKernel.c
> +++ b/drivers/staging/epl/EplApiLinuxKernel.c
> @@ -655,9 +655,7 @@ static int EplLinIoctl(struct inode
> *pDeviceFile_p, // information about the dev
> goto Exit;
> }
>
> - pBufHeader =
> - (tEplLinSdoBufHeader *)
> - vmalloc(sizeof(tEplLinSdoBufHeader) +
> + pBufHeader = vmalloc(sizeof(tEplLinSdoBufHeader) +
> SdoObject.m_uiSize);
> if (pBufHeader == NULL) { // no memory available
> iRet = -ENOMEM;
> @@ -751,9 +749,7 @@ static int EplLinIoctl(struct inode
> *pDeviceFile_p, // information about the dev
> goto Exit;
> }
>
> - pBufHeader =
> - (tEplLinSdoBufHeader *)
> - vmalloc(sizeof(tEplLinSdoBufHeader) +
> + pBufHeader = vmalloc(sizeof(tEplLinSdoBufHeader) +
> SdoObject.m_uiSize);
> if (pBufHeader == NULL) { // no memory available
> iRet = -ENOMEM;
> diff --git a/drivers/staging/et131x/et1310_rx.c
> b/drivers/staging/et131x/et1310_rx.c
> index 8dc559a..a3810f5 100644
> --- a/drivers/staging/et131x/et1310_rx.c
> +++ b/drivers/staging/et131x/et1310_rx.c
> @@ -610,8 +610,8 @@ int et131x_init_recv(struct et131x_adapter *adapter)
>
> /* Setup each RFD */
> for (RfdCount = 0; RfdCount < rx_ring->NumRfd; RfdCount++) {
> - pMpRfd = (MP_RFD *) kmem_cache_alloc(rx_ring->RecvLookaside,
> - GFP_ATOMIC | GFP_DMA);
> + pMpRfd = kmem_cache_alloc(rx_ring->RecvLookaside,
> + GFP_ATOMIC | GFP_DMA);
>
> if (!pMpRfd) {
> DBG_ERROR(et131x_dbginfo,
> diff --git a/drivers/staging/rtl8187se/r8180_core.c
> b/drivers/staging/rtl8187se/r8180_core.c
> index 6ecd12d..4f35f6d 100644
> --- a/drivers/staging/rtl8187se/r8180_core.c
> +++ b/drivers/staging/rtl8187se/r8180_core.c
> @@ -1691,7 +1691,7 @@ int alloc_tx_beacon_desc_ring(struct net_device
> *dev, int count)
> u32 *tmp;
> struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
>
> - priv->txbeaconring = (u32*)pci_alloc_consistent(priv->pdev,
> + priv->txbeaconring = pci_alloc_consistent(priv->pdev,
> sizeof(u32)*8*count,
> &priv->txbeaconringdma);
> if (!priv->txbeaconring) return -1;
> @@ -1727,8 +1727,7 @@ short alloc_tx_desc_ring(struct net_device *dev,
> int bufsize, int count,
> DMESGE ("TX buffer allocation too large");
> return 0;
> }
> - desc = (u32*)pci_alloc_consistent(pdev,
> - sizeof(u32)*8*count+256, &dma_desc);
> + desc = pci_alloc_consistent(pdev, sizeof(u32)*8*count+256, &dma_desc);
> if(desc==NULL) return -1;
> if(dma_desc & 0xff){
>
> @@ -1751,7 +1750,7 @@ short alloc_tx_desc_ring(struct net_device *dev,
> int bufsize, int count,
> tmp=desc;
> for (i=0;i<count;i++)
> {
> - buf = (void*)pci_alloc_consistent(pdev,bufsize,&dma_tmp);
> + buf = pci_alloc_consistent(pdev,bufsize,&dma_tmp);
> if (buf == NULL) return -ENOMEM;
>
> switch(addr) {
> @@ -1975,8 +1974,8 @@ short alloc_rx_desc_ring(struct net_device *dev,
> u16 bufsize, int count)
> return -1;
> }
>
> - desc =
> (u32*)pci_alloc_consistent(pdev,sizeof(u32)*rx_desc_size*count+256,
> - &dma_desc);
> + desc = pci_alloc_consistent(pdev,sizeof(u32)*rx_desc_size*count+256,
> + &dma_desc);
>
> if(dma_desc & 0xff){
>
> @@ -2017,7 +2016,7 @@ short alloc_rx_desc_ring(struct net_device *dev,
> u16 bufsize, int count)
> for(j=0;j<bufsize;j++) ((u8*)buf)[i] = 0;
> #endif
>
> - //buf = (void*)pci_alloc_consistent(pdev,bufsize,&dma_tmp);
> + //buf = pci_alloc_consistent(pdev,bufsize,&dma_tmp);
> if(-1 == buffer_add(&(priv->rxbuffer), buf,dma_tmp,
> &(priv->rxbufferhead))){
> DMESGE("Unable to allocate mem RX buf");
> diff --git a/drivers/staging/slicoss/slicoss.c
> b/drivers/staging/slicoss/slicoss.c
> index 9481563..746034c 100644
> --- a/drivers/staging/slicoss/slicoss.c
> +++ b/drivers/staging/slicoss/slicoss.c
> @@ -333,8 +333,7 @@ static void slic_init_adapter(struct net_device *netdev,
> pslic_handle->next = adapter->pfree_slic_handles;
> adapter->pfree_slic_handles = pslic_handle;
> }
> - adapter->pshmem = (struct slic_shmem *)
> - pci_alloc_consistent(adapter->pcidev,
> + adapter->pshmem = pci_alloc_consistent(adapter->pcidev,
> sizeof(struct slic_shmem),
> &adapter->
> phys_shmem);
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2009-04-09 10:37:33

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 51/56] sysv: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Fixed patch
>
> Thanks,
>
> Jack
>
> --
>
> sysv: Remove void casts
>
> From: Jack Stone <[email protected]>
>
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>
> fs/sysv/dir.c | 12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c
> index 56f6552..73b70a5 100644
> --- a/fs/sysv/dir.c
> +++ b/fs/sysv/dir.c
> @@ -87,7 +87,7 @@ static int sysv_readdir(struct file * filp, void *
> dirent, filldir_t filldir)
>
> if (IS_ERR(page))
> continue;
> - kaddr = (char *)page_address(page);
> + kaddr = page_address(page);
> de = (struct sysv_dir_entry *)(kaddr+offset);
> limit = kaddr + PAGE_CACHE_SIZE - SYSV_DIRSIZE;
> for ( ;(char*)de <= limit; de++) {
> @@ -157,7 +157,7 @@ struct sysv_dir_entry *sysv_find_entry(struct dentry
> *dentry, struct page **res_
> char *kaddr;
> page = dir_get_page(dir, n);
> if (!IS_ERR(page)) {
> - kaddr = (char*)page_address(page);
> + kaddr = page_address(page);
> de = (struct sysv_dir_entry *) kaddr;
> kaddr += PAGE_CACHE_SIZE - SYSV_DIRSIZE;
> for ( ; (char *) de <= kaddr ; de++) {
> @@ -201,7 +201,7 @@ int sysv_add_link(struct dentry *dentry, struct
> inode *inode)
> err = PTR_ERR(page);
> if (IS_ERR(page))
> goto out;
> - kaddr = (char*)page_address(page);
> + kaddr = page_address(page);
> de = (struct sysv_dir_entry *)kaddr;
> kaddr += PAGE_CACHE_SIZE - SYSV_DIRSIZE;
> while ((char *)de <= kaddr) {
> @@ -244,7 +244,7 @@ int sysv_delete_entry(struct sysv_dir_entry *de,
> struct page *page)
> {
> struct address_space *mapping = page->mapping;
> struct inode *inode = (struct inode*)mapping->host;
> - char *kaddr = (char*)page_address(page);
> + char *kaddr = page_address(page);
> loff_t pos = page_offset(page) + (char *)de - kaddr;
> int err;
>
> @@ -278,7 +278,7 @@ int sysv_make_empty(struct inode *inode, struct
> inode *dir)
> }
> kmap(page);
>
> - base = (char*)page_address(page);
> + base = page_address(page);
> memset(base, 0, PAGE_CACHE_SIZE);
>
> de = (struct sysv_dir_entry *) base;
> @@ -312,7 +312,7 @@ int sysv_empty_dir(struct inode * inode)
> if (IS_ERR(page))
> continue;
>
> - kaddr = (char *)page_address(page);
> + kaddr = page_address(page);
> de = (struct sysv_dir_entry *)kaddr;
> kaddr += PAGE_CACHE_SIZE-SYSV_DIRSIZE;
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2009-04-09 10:37:54

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 52/56] ufs: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> fs/ufs/dir.c | 2 +-
> fs/ufs/super.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c
> index dbbbc46..17898e3 100644
> --- a/fs/ufs/dir.c
> +++ b/fs/ufs/dir.c
> @@ -585,7 +585,7 @@ int ufs_make_empty(struct inode * inode, struct inode *dir)
> }
>
> kmap(page);
> - base = (char*)page_address(page);
> + base = page_address(page);
> memset(base, 0, PAGE_CACHE_SIZE);
>
> de = (struct ufs_dir_entry *) base;
> diff --git a/fs/ufs/super.c b/fs/ufs/super.c
> index 6035929..2488b6d 100644
> --- a/fs/ufs/super.c
> +++ b/fs/ufs/super.c
> @@ -1304,7 +1304,7 @@ static struct kmem_cache * ufs_inode_cachep;
> static struct inode *ufs_alloc_inode(struct super_block *sb)
> {
> struct ufs_inode_info *ei;
> - ei = (struct ufs_inode_info *)kmem_cache_alloc(ufs_inode_cachep, GFP_KERNEL);
> + ei = kmem_cache_alloc(ufs_inode_cachep, GFP_KERNEL);
> if (!ei)
> return NULL;
> ei->vfs_inode.i_version = 1;
>

2009-04-09 10:38:43

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 54/56] x86: Remove void casts

[Added maintainer CCs]
Jack Stone wrote:
> Fixed patch
>
> Thanks,
>
> Jack
>
> --
>
> x86: Remove void casts
>
> From: Jack Stone <[email protected]>
>
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>
> arch/x86/kernel/machine_kexec_64.c | 8 ++++----
> arch/x86/kernel/microcode_amd.c | 2 +-
> arch/x86/mm/init_32.c | 4 ++--
> arch/x86/mm/init_64.c | 10 +++++-----
> arch/x86/mm/pageattr.c | 2 +-
> 5 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/arch/x86/kernel/machine_kexec_64.c
> b/arch/x86/kernel/machine_kexec_64.c
> index 89cea4d..1c5b3c9 100644
> --- a/arch/x86/kernel/machine_kexec_64.c
> +++ b/arch/x86/kernel/machine_kexec_64.c
> @@ -33,7 +33,7 @@ static int init_one_level2_page(struct kimage *image,
> pgd_t *pgd,
> page = kimage_alloc_control_pages(image, 0);
> if (!page)
> goto out;
> - pud = (pud_t *)page_address(page);
> + pud = page_address(page);
> memset(pud, 0, PAGE_SIZE);
> set_pgd(pgd, __pgd(__pa(pud) | _KERNPG_TABLE));
> }
> @@ -42,7 +42,7 @@ static int init_one_level2_page(struct kimage *image,
> pgd_t *pgd,
> page = kimage_alloc_control_pages(image, 0);
> if (!page)
> goto out;
> - pmd = (pmd_t *)page_address(page);
> + pmd = page_address(page);
> memset(pmd, 0, PAGE_SIZE);
> set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE));
> }
> @@ -84,7 +84,7 @@ static int init_level3_page(struct kimage *image,
> pud_t *level3p,
> result = -ENOMEM;
> goto out;
> }
> - level2p = (pmd_t *)page_address(page);
> + level2p = page_address(page);
> init_level2_page(level2p, addr);
> set_pud(level3p++, __pud(__pa(level2p) | _KERNPG_TABLE));
> addr += PUD_SIZE;
> @@ -117,7 +117,7 @@ static int init_level4_page(struct kimage *image,
> pgd_t *level4p,
> result = -ENOMEM;
> goto out;
> }
> - level3p = (pud_t *)page_address(page);
> + level3p = page_address(page);
> result = init_level3_page(image, level3p, addr, last_addr);
> if (result)
> goto out;
> diff --git a/arch/x86/kernel/microcode_amd.c
> b/arch/x86/kernel/microcode_amd.c
> index 453b579..8624d69 100644
> --- a/arch/x86/kernel/microcode_amd.c
> +++ b/arch/x86/kernel/microcode_amd.c
> @@ -239,7 +239,7 @@ static int install_equiv_cpu_table(const u8 *buf)
> return 0;
> }
>
> - equiv_cpu_table = (struct equiv_cpu_entry *) vmalloc(size);
> + equiv_cpu_table = vmalloc(size);
> if (!equiv_cpu_table) {
> printk(KERN_ERR "microcode: failed to allocate "
> "equivalent CPU table\n");
> diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
> index 749559e..64f1a30 100644
> --- a/arch/x86/mm/init_32.c
> +++ b/arch/x86/mm/init_32.c
> @@ -89,7 +89,7 @@ static pmd_t * __init one_md_table_init(pgd_t *pgd)
> if (after_bootmem)
> pmd_table = (pmd_t *)alloc_bootmem_low_pages(PAGE_SIZE);
> else
> - pmd_table = (pmd_t *)alloc_low_page();
> + pmd_table = alloc_low_page();
> paravirt_alloc_pmd(&init_mm, __pa(pmd_table) >> PAGE_SHIFT);
> set_pgd(pgd, __pgd(__pa(pmd_table) | _PAGE_PRESENT));
> pud = pud_offset(pgd, 0);
> @@ -121,7 +121,7 @@ static pte_t * __init one_page_table_init(pmd_t *pmd)
> page_table =
> (pte_t *)alloc_bootmem_low_pages(PAGE_SIZE);
> } else
> - page_table = (pte_t *)alloc_low_page();
> + page_table = alloc_low_page();
>
> paravirt_alloc_pte(&init_mm, __pa(page_table) >> PAGE_SHIFT);
> set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE));
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index 1753e80..bd08334 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -164,7 +164,7 @@ static __ref void *spp_getpage(void)
> static pud_t *fill_pud(pgd_t *pgd, unsigned long vaddr)
> {
> if (pgd_none(*pgd)) {
> - pud_t *pud = (pud_t *)spp_getpage();
> + pud_t *pud = spp_getpage();
> pgd_populate(&init_mm, pgd, pud);
> if (pud != pud_offset(pgd, 0))
> printk(KERN_ERR "PAGETABLE BUG #00! %p <-> %p\n",
> @@ -176,7 +176,7 @@ static pud_t *fill_pud(pgd_t *pgd, unsigned long vaddr)
> static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr)
> {
> if (pud_none(*pud)) {
> - pmd_t *pmd = (pmd_t *) spp_getpage();
> + pmd_t *pmd = spp_getpage();
> pud_populate(&init_mm, pud, pmd);
> if (pmd != pmd_offset(pud, 0))
> printk(KERN_ERR "PAGETABLE BUG #01! %p <-> %p\n",
> @@ -188,7 +188,7 @@ static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr)
> static pte_t *fill_pte(pmd_t *pmd, unsigned long vaddr)
> {
> if (pmd_none(*pmd)) {
> - pte_t *pte = (pte_t *) spp_getpage();
> + pte_t *pte = spp_getpage();
> pmd_populate_kernel(&init_mm, pmd, pte);
> if (pte != pte_offset_kernel(pmd, 0))
> printk(KERN_ERR "PAGETABLE BUG #02!\n");
> @@ -264,13 +264,13 @@ static void __init __init_extra_mapping(unsigned
> long phys, unsigned long size,
> for (; size; phys += PMD_SIZE, size -= PMD_SIZE) {
> pgd = pgd_offset_k((unsigned long)__va(phys));
> if (pgd_none(*pgd)) {
> - pud = (pud_t *) spp_getpage();
> + pud = spp_getpage();
> set_pgd(pgd, __pgd(__pa(pud) | _KERNPG_TABLE |
> _PAGE_USER));
> }
> pud = pud_offset(pgd, (unsigned long)__va(phys));
> if (pud_none(*pud)) {
> - pmd = (pmd_t *) spp_getpage();
> + pmd = spp_getpage();
> set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE |
> _PAGE_USER));
> }
> diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
> index d71e1b6..41ee1db 100644
> --- a/arch/x86/mm/pageattr.c
> +++ b/arch/x86/mm/pageattr.c
> @@ -490,7 +490,7 @@ static int split_large_page(pte_t *kpte, unsigned
> long address)
> if (tmp != kpte)
> goto out_unlock;
>
> - pbase = (pte_t *)page_address(base);
> + pbase = page_address(base);
> paravirt_alloc_pte(&init_mm, page_to_pfn(base));
> ref_prot = pte_pgprot(pte_clrhuge(*kpte));
> /*
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2009-04-09 10:39:16

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 53/56] usb: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Fixed patch
>
> Thanks,
>
> Jack
>
> --
>
> usb: Remove void casts
>
> From: Jack Stone <[email protected]>
>
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>
> drivers/usb/host/ehci-dbg.c | 2 +-
> drivers/usb/host/ehci-mem.c | 3 +--
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
> index 7f4ace7..abfc31f 100644
> --- a/drivers/usb/host/ehci-dbg.c
> +++ b/drivers/usb/host/ehci-dbg.c
> @@ -832,7 +832,7 @@ static int fill_buffer(struct debug_buffer *buf)
> int ret = 0;
>
> if (!buf->output_buf)
> - buf->output_buf = (char *)vmalloc(buf->alloc_size);
> + buf->output_buf = vmalloc(buf->alloc_size);
>
> if (!buf->output_buf) {
> ret = -ENOMEM;
> diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c
> index 10d5291..df5334f 100644
> --- a/drivers/usb/host/ehci-mem.c
> +++ b/drivers/usb/host/ehci-mem.c
> @@ -83,8 +83,7 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd
> *ehci, gfp_t flags)
> struct ehci_qh *qh;
> dma_addr_t dma;
>
> - qh = (struct ehci_qh *)
> - dma_pool_alloc (ehci->qh_pool, flags, &dma);
> + qh = dma_pool_alloc (ehci->qh_pool, flags, &dma);
> if (!qh)
> return qh;
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2009-04-09 10:40:27

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 55/56] xen: Remove void casts

[Added maintainer CCs]
Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
> drivers/xen/manage.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
> index 0d61db1..89310fb 100644
> --- a/drivers/xen/manage.c
> +++ b/drivers/xen/manage.c
> @@ -149,7 +149,7 @@ static void shutdown_handler(struct xenbus_watch *watch,
> if (err)
> return;
>
> - str = (char *)xenbus_read(xbt, "control", "shutdown", NULL);
> + str = xenbus_read(xbt, "control", "shutdown", NULL);
> /* Ignore read errors and empty reads. */
> if (XENBUS_IS_ERR_READ(str)) {
> xenbus_transaction_end(xbt, 1);
>

2009-04-09 10:40:55

by Jack Stone

[permalink] [raw]
Subject: Re: [PATCH 56/56] xfs: Remove void casts

[Added maintainer CC]
Jack Stone wrote:
> Fixed patch
>
> Thanks,
>
> Jack
>
> --
>
> xfs: Remove void casts
>
> From: Jack Stone <[email protected]>
>
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>
> ---
>
> fs/xfs/quota/xfs_dquot_item.c | 2 +-
> fs/xfs/support/ktrace.c | 10 ++++------
> fs/xfs/xfs_attr_leaf.c | 2 +-
> fs/xfs/xfs_buf_item.c | 7 +++----
> fs/xfs/xfs_extfree_item.c | 10 ++++------
> fs/xfs/xfs_inode.c | 5 ++---
> fs/xfs/xfs_log_recover.c | 12 ++++--------
> fs/xfs/xfs_trans.c | 5 ++---
> fs/xfs/xfs_trans_inode.c | 3 +--
> fs/xfs/xfs_trans_item.c | 6 ++----
> 10 files changed, 24 insertions(+), 38 deletions(-)
>
> diff --git a/fs/xfs/quota/xfs_dquot_item.c b/fs/xfs/quota/xfs_dquot_item.c
> index 1728f6a..a4d970a 100644
> --- a/fs/xfs/quota/xfs_dquot_item.c
> +++ b/fs/xfs/quota/xfs_dquot_item.c
> @@ -648,7 +648,7 @@ xfs_qm_qoff_logitem_init(
> {
> xfs_qoff_logitem_t *qf;
>
> - qf = (xfs_qoff_logitem_t*) kmem_zalloc(sizeof(xfs_qoff_logitem_t),
> KM_SLEEP);
> + qf = kmem_zalloc(sizeof(xfs_qoff_logitem_t), KM_SLEEP);
>
> qf->qql_item.li_type = XFS_LI_QUOTAOFF;
> if (start)
> diff --git a/fs/xfs/support/ktrace.c b/fs/xfs/support/ktrace.c
> index 2d494c2..db35dcd 100644
> --- a/fs/xfs/support/ktrace.c
> +++ b/fs/xfs/support/ktrace.c
> @@ -58,9 +58,9 @@ ktrace_alloc(int nentries, unsigned int __nocast sleep)
> ktrace_entry_t *ktep;
> int entries;
>
> - ktp = (ktrace_t*)kmem_zone_alloc(ktrace_hdr_zone, sleep);
> + ktp = kmem_zone_alloc(ktrace_hdr_zone, sleep);
>
> - if (ktp == (ktrace_t*)NULL) {
> + if (ktp == NULL) {
> /*
> * KM_SLEEP callers don't expect failure.
> */
> @@ -75,11 +75,9 @@ ktrace_alloc(int nentries, unsigned int __nocast sleep)
> */
> entries = roundup_pow_of_two(nentries);
> if (entries == ktrace_zentries) {
> - ktep = (ktrace_entry_t*)kmem_zone_zalloc(ktrace_ent_zone,
> - sleep);
> + ktep = kmem_zone_zalloc(ktrace_ent_zone, sleep);
> } else {
> - ktep = (ktrace_entry_t*)kmem_zalloc((entries * sizeof(*ktep)),
> - sleep | KM_LARGE);
> + ktep = kmem_zalloc((entries * sizeof(*ktep)), sleep | KM_LARGE);
> }
>
> if (ktep == NULL) {
> diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
> index afdc891..688e894 100644
> --- a/fs/xfs/xfs_attr_leaf.c
> +++ b/fs/xfs/xfs_attr_leaf.c
> @@ -2869,7 +2869,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **trans,
> xfs_inode_t *dp, xfs_dabuf_t *bp)
> * Allocate storage for a list of all the "remote" value extents.
> */
> size = count * sizeof(xfs_attr_inactive_list_t);
> - list = (xfs_attr_inactive_list_t *)kmem_alloc(size, KM_SLEEP);
> + list = kmem_alloc(size, KM_SLEEP);
>
> /*
> * Identify each of the "remote" value extents.
> diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
> index 92af409..95234ef 100644
> --- a/fs/xfs/xfs_buf_item.c
> +++ b/fs/xfs/xfs_buf_item.c
> @@ -726,8 +726,7 @@ xfs_buf_item_init(
> chunks = (int)((XFS_BUF_COUNT(bp) + (XFS_BLI_CHUNK - 1)) >>
> XFS_BLI_SHIFT);
> map_size = (int)((chunks + NBWORD) >> BIT_TO_WORD_SHIFT);
>
> - bip = (xfs_buf_log_item_t*)kmem_zone_zalloc(xfs_buf_item_zone,
> - KM_SLEEP);
> + bip = kmem_zone_zalloc(xfs_buf_item_zone, KM_SLEEP);
> bip->bli_item.li_type = XFS_LI_BUF;
> bip->bli_item.li_ops = &xfs_buf_item_ops;
> bip->bli_item.li_mountp = mp;
> @@ -751,9 +750,9 @@ xfs_buf_item_init(
> * the buffer to indicate which bytes the callers have asked
> * to have logged.
> */
> - bip->bli_orig = (char *)kmem_alloc(XFS_BUF_COUNT(bp), KM_SLEEP);
> + bip->bli_orig = kmem_alloc(XFS_BUF_COUNT(bp), KM_SLEEP);
> memcpy(bip->bli_orig, XFS_BUF_PTR(bp), XFS_BUF_COUNT(bp));
> - bip->bli_logged = (char *)kmem_zalloc(XFS_BUF_COUNT(bp) / NBBY,
> KM_SLEEP);
> + bip->bli_logged = kmem_zalloc(XFS_BUF_COUNT(bp) / NBBY, KM_SLEEP);
> #endif
>
> /*
> diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c
> index 05a4bdd..2b8267c 100644
> --- a/fs/xfs/xfs_extfree_item.c
> +++ b/fs/xfs/xfs_extfree_item.c
> @@ -253,10 +253,9 @@ xfs_efi_init(xfs_mount_t *mp,
> if (nextents > XFS_EFI_MAX_FAST_EXTENTS) {
> size = (uint)(sizeof(xfs_efi_log_item_t) +
> ((nextents - 1) * sizeof(xfs_extent_t)));
> - efip = (xfs_efi_log_item_t*)kmem_zalloc(size, KM_SLEEP);
> + efip = kmem_zalloc(size, KM_SLEEP);
> } else {
> - efip = (xfs_efi_log_item_t*)kmem_zone_zalloc(xfs_efi_zone,
> - KM_SLEEP);
> + efip = kmem_zone_zalloc(xfs_efi_zone, KM_SLEEP);
> }
>
> efip->efi_item.li_type = XFS_LI_EFI;
> @@ -548,10 +547,9 @@ xfs_efd_init(xfs_mount_t *mp,
> if (nextents > XFS_EFD_MAX_FAST_EXTENTS) {
> size = (uint)(sizeof(xfs_efd_log_item_t) +
> ((nextents - 1) * sizeof(xfs_extent_t)));
> - efdp = (xfs_efd_log_item_t*)kmem_zalloc(size, KM_SLEEP);
> + efdp = kmem_zalloc(size, KM_SLEEP);
> } else {
> - efdp = (xfs_efd_log_item_t*)kmem_zone_zalloc(xfs_efd_zone,
> - KM_SLEEP);
> + efdp = kmem_zone_zalloc(xfs_efd_zone, KM_SLEEP);
> }
>
> efdp->efd_item.li_type = XFS_LI_EFD;
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index e7ae08d..5ab6e3d 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -3453,7 +3453,7 @@ xfs_iext_add_indirect_multi(
> * (all extents past */
> if (nex2) {
> byte_diff = nex2 * sizeof(xfs_bmbt_rec_t);
> - nex2_ep = (xfs_bmbt_rec_t *) kmem_alloc(byte_diff, KM_NOFS);
> + nex2_ep = kmem_alloc(byte_diff, KM_NOFS);
> memmove(nex2_ep, &erp->er_extbuf[idx], byte_diff);
> erp->er_extcount -= nex2;
> xfs_iext_irec_update_extoffs(ifp, erp_idx + 1, -nex2);
> @@ -3842,8 +3842,7 @@ xfs_iext_realloc_indirect(
> if (new_size == 0) {
> xfs_iext_destroy(ifp);
> } else {
> - ifp->if_u1.if_ext_irec = (xfs_ext_irec_t *)
> - kmem_realloc(ifp->if_u1.if_ext_irec,
> + ifp->if_u1.if_ext_irec = kmem_realloc(ifp->if_u1.if_ext_irec,
> new_size, size, KM_NOFS);
> }
> }
> diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
> index 7ba4501..fc8daa0 100644
> --- a/fs/xfs/xfs_log_recover.c
> +++ b/fs/xfs/xfs_log_recover.c
> @@ -1670,8 +1670,7 @@ xlog_recover_do_buffer_pass1(
> * the bucket.
> */
> if (*bucket == NULL) {
> - bcp = (xfs_buf_cancel_t *)kmem_alloc(sizeof(xfs_buf_cancel_t),
> - KM_SLEEP);
> + bcp = kmem_alloc(sizeof(xfs_buf_cancel_t), KM_SLEEP);
> bcp->bc_blkno = blkno;
> bcp->bc_len = len;
> bcp->bc_refcount = 1;
> @@ -1696,8 +1695,7 @@ xlog_recover_do_buffer_pass1(
> nextp = nextp->bc_next;
> }
> ASSERT(prevp != NULL);
> - bcp = (xfs_buf_cancel_t *)kmem_alloc(sizeof(xfs_buf_cancel_t),
> - KM_SLEEP);
> + bcp = kmem_alloc(sizeof(xfs_buf_cancel_t), KM_SLEEP);
> bcp->bc_blkno = blkno;
> bcp->bc_len = len;
> bcp->bc_refcount = 1;
> @@ -2316,8 +2314,7 @@ xlog_recover_do_inode_trans(
> if (item->ri_buf[0].i_len == sizeof(xfs_inode_log_format_t)) {
> in_f = (xfs_inode_log_format_t *)item->ri_buf[0].i_addr;
> } else {
> - in_f = (xfs_inode_log_format_t *)kmem_alloc(
> - sizeof(xfs_inode_log_format_t), KM_SLEEP);
> + in_f = kmem_alloc(sizeof(xfs_inode_log_format_t), KM_SLEEP);
> need_free = 1;
> error = xfs_inode_item_format_convert(&item->ri_buf[0], in_f);
> if (error)
> @@ -3778,8 +3775,7 @@ xlog_do_log_recovery(
> * First do a pass to find all of the cancelled buf log items.
> * Store them in the buf_cancel_table for use in the second pass.
> */
> - log->l_buf_cancel_table =
> - (xfs_buf_cancel_t **)kmem_zalloc(XLOG_BC_TABLE_SIZE *
> + log->l_buf_cancel_table = kmem_zalloc(XLOG_BC_TABLE_SIZE *
> sizeof(xfs_buf_cancel_t*),
> KM_SLEEP);
> error = xlog_do_recovery_pass(log, head_blk, tail_blk,
> diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
> index 8570b82..282795e 100644
> --- a/fs/xfs/xfs_trans.c
> +++ b/fs/xfs/xfs_trans.c
> @@ -868,9 +868,8 @@ shut_us_down:
> } else if (nvec <= XFS_TRANS_LOGVEC_COUNT) {
> log_vector = log_vector_fast;
> } else {
> - log_vector = (xfs_log_iovec_t *)kmem_alloc(nvec *
> - sizeof(xfs_log_iovec_t),
> - KM_SLEEP);
> + log_vector = kmem_alloc(nvec * sizeof(xfs_log_iovec_t),
> + KM_SLEEP);
> }
>
> /*
> diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c
> index 23d276a..e1b90f0 100644
> --- a/fs/xfs/xfs_trans_inode.c
> +++ b/fs/xfs/xfs_trans_inode.c
> @@ -271,8 +271,7 @@ xfs_trans_inode_broot_debug(
> ASSERT((ip->i_df.if_broot != NULL) &&
> (ip->i_df.if_broot_bytes > 0));
> iip->ili_root_size = ip->i_df.if_broot_bytes;
> - iip->ili_orig_root =
> - (char*)kmem_alloc(iip->ili_root_size, KM_SLEEP);
> + iip->ili_orig_root = kmem_alloc(iip->ili_root_size, KM_SLEEP);
> memcpy(iip->ili_orig_root, (char*)(ip->i_df.if_broot),
> iip->ili_root_size);
> }
> diff --git a/fs/xfs/xfs_trans_item.c b/fs/xfs/xfs_trans_item.c
> index eb3fc57..49615dd 100644
> --- a/fs/xfs/xfs_trans_item.c
> +++ b/fs/xfs/xfs_trans_item.c
> @@ -54,8 +54,7 @@ xfs_trans_add_item(xfs_trans_t *tp, xfs_log_item_t *lip)
> * of them and put it at the front of the chunk list.
> */
> if (tp->t_items_free == 0) {
> - licp = (xfs_log_item_chunk_t*)
> - kmem_alloc(sizeof(xfs_log_item_chunk_t), KM_SLEEP);
> + licp = kmem_alloc(sizeof(xfs_log_item_chunk_t), KM_SLEEP);
> ASSERT(licp != NULL);
> /*
> * Initialize the chunk, and then
> @@ -460,8 +459,7 @@ xfs_trans_add_busy(xfs_trans_t *tp, xfs_agnumber_t
> ag, xfs_extlen_t idx)
> * of them and put it at the front of the chunk list.
> */
> if (tp->t_busy_free == 0) {
> - lbcp = (xfs_log_busy_chunk_t*)
> - kmem_alloc(sizeof(xfs_log_busy_chunk_t), KM_SLEEP);
> + lbcp = kmem_alloc(sizeof(xfs_log_busy_chunk_t), KM_SLEEP);
> ASSERT(lbcp != NULL);
> /*
> * Initialize the chunk, and then
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2009-04-09 12:44:00

by Jean Delvare

[permalink] [raw]
Subject: Re: [PATCH 13/56] i2c: Remove void casts

Hi Jack,

On Wed, 8 Apr 2009 12:21:45 +0100, Jack Stone wrote:
> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>

WARNING: Signed-off-by: is the preferred form

> ---
> drivers/i2c/i2c-core.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index b6f3a0d..1578645 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -1510,7 +1510,7 @@ struct i2c_adapter* i2c_get_adapter(int id)
> struct i2c_adapter *adapter;
>
> mutex_lock(&core_lock);
> - adapter = (struct i2c_adapter *)idr_find(&i2c_adapter_idr, id);
> + adapter = idr_find(&i2c_adapter_idr, id);
> if (adapter && !try_module_get(adapter->owner))
> adapter = NULL;
>

Applied, thanks.

--
Jean Delvare

2009-04-09 12:51:33

by Alan

[permalink] [raw]
Subject: Re: [PATCH 13/56] i2c: Remove void casts

On Thu, 9 Apr 2009 14:43:34 +0200
Jean Delvare <[email protected]> wrote:

> Hi Jack,
>
> On Wed, 8 Apr 2009 12:21:45 +0100, Jack Stone wrote:
> > Remove uneeded void casts
> >
> > Signed-Off-By: Jack Stone <[email protected]>
>
> WARNING: Signed-off-by: is the preferred form

Nothing actually cares, and if anyone does then we have software for the
mindless purpose of changing the case of words

Alan

2009-04-09 14:52:57

by Jean Delvare

[permalink] [raw]
Subject: Re: [PATCH 13/56] i2c: Remove void casts

Dear Alan,

On Thu, 9 Apr 2009 13:51:23 +0100, Alan Cox wrote:
> On Thu, 9 Apr 2009 14:43:34 +0200
> Jean Delvare <[email protected]> wrote:
>
> > Hi Jack,
> >
> > On Wed, 8 Apr 2009 12:21:45 +0100, Jack Stone wrote:
> > > Remove uneeded void casts
> > >
> > > Signed-Off-By: Jack Stone <[email protected]>
> >
> > WARNING: Signed-off-by: is the preferred form
>
> Nothing actually cares, and if anyone does then we have software for the
> mindless purpose of changing the case of words

scripts/checkpatch.pl does care, so I do too.

Thanks,
--
Jean Delvare

2009-04-09 17:37:53

by Felix Blyakher

[permalink] [raw]
Subject: Re: [PATCH 56/56] xfs: Remove void casts


On Apr 8, 2009, at 6:22 AM, Jack Stone wrote:

> Remove uneeded void casts
>
> Signed-Off-By: Jack Stone <[email protected]>

See comments below.

Reviewed-by: Felix Blyakher <[email protected]>

>
> ---
> fs/xfs/quota/xfs_dquot_item.c | 2 +-
> fs/xfs/support/ktrace.c | 6 +++---
> fs/xfs/xfs_attr_leaf.c | 2 +-
> fs/xfs/xfs_buf_item.c | 6 +++---
> fs/xfs/xfs_extfree_item.c | 8 ++++----
> fs/xfs/xfs_inode.c | 5 ++---
> fs/xfs/xfs_log_recover.c | 9 ++++-----
> fs/xfs/xfs_trans.c | 2 +-
> fs/xfs/xfs_trans_inode.c | 3 +--
> fs/xfs/xfs_trans_item.c | 6 ++----
> 10 files changed, 22 insertions(+), 27 deletions(-)
>
> diff --git a/fs/xfs/quota/xfs_dquot_item.c b/fs/xfs/quota/
> xfs_dquot_item.c
> index 1728f6a..a4d970a 100644
> --- a/fs/xfs/quota/xfs_dquot_item.c
> +++ b/fs/xfs/quota/xfs_dquot_item.c
> @@ -648,7 +648,7 @@ xfs_qm_qoff_logitem_init(
> {
> xfs_qoff_logitem_t *qf;
>
> - qf = (xfs_qoff_logitem_t*) kmem_zalloc(sizeof(xfs_qoff_logitem_t),
> KM_SLEEP);
> + qf = kmem_zalloc(sizeof(xfs_qoff_logitem_t), KM_SLEEP);
>
> qf->qql_item.li_type = XFS_LI_QUOTAOFF;
> if (start)
> diff --git a/fs/xfs/support/ktrace.c b/fs/xfs/support/ktrace.c
> index 2d494c2..3982acf 100644
> --- a/fs/xfs/support/ktrace.c
> +++ b/fs/xfs/support/ktrace.c
> @@ -58,7 +58,7 @@ ktrace_alloc(int nentries, unsigned int __nocast
> sleep)
> ktrace_entry_t *ktep;
> int entries;
>
> - ktp = (ktrace_t*)kmem_zone_alloc(ktrace_hdr_zone, sleep);
> + ktp = kmem_zone_alloc(ktrace_hdr_zone, sleep);
>
> if (ktp == (ktrace_t*)NULL) {
> /*
> @@ -75,10 +75,10 @@ ktrace_alloc(int nentries, unsigned int __nocast
> sleep)
> */
> entries = roundup_pow_of_two(nentries);
> if (entries == ktrace_zentries) {
> - ktep = (ktrace_entry_t*)kmem_zone_zalloc(ktrace_ent_zone,
> + ktep = kmem_zone_zalloc(ktrace_ent_zone,
> sleep);

Combine two lines.

>
> } else {
> - ktep = (ktrace_entry_t*)kmem_zalloc((entries * sizeof(*ktep)),
> + ktep = kmem_zalloc((entries * sizeof(*ktep)),
> sleep | KM_LARGE);

Ditto.

>
> }
>
> diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
> index afdc891..688e894 100644
> --- a/fs/xfs/xfs_attr_leaf.c
> +++ b/fs/xfs/xfs_attr_leaf.c
> @@ -2869,7 +2869,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **trans,
> xfs_inode_t *dp, xfs_dabuf_t *bp)
> * Allocate storage for a list of all the "remote" value extents.
> */
> size = count * sizeof(xfs_attr_inactive_list_t);
> - list = (xfs_attr_inactive_list_t *)kmem_alloc(size, KM_SLEEP);
> + list = kmem_alloc(size, KM_SLEEP);
>
> /*
> * Identify each of the "remote" value extents.
> diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
> index 92af409..431755a 100644
> --- a/fs/xfs/xfs_buf_item.c
> +++ b/fs/xfs/xfs_buf_item.c
> @@ -726,7 +726,7 @@ xfs_buf_item_init(
> chunks = (int)((XFS_BUF_COUNT(bp) + (XFS_BLI_CHUNK - 1)) >>
> XFS_BLI_SHIFT);
> map_size = (int)((chunks + NBWORD) >> BIT_TO_WORD_SHIFT);
>
> - bip = (xfs_buf_log_item_t*)kmem_zone_zalloc(xfs_buf_item_zone,
> + bip = kmem_zone_zalloc(xfs_buf_item_zone,
> KM_SLEEP);

Ditto.

>
> bip->bli_item.li_type = XFS_LI_BUF;
> bip->bli_item.li_ops = &xfs_buf_item_ops;
> @@ -751,9 +751,9 @@ xfs_buf_item_init(
> * the buffer to indicate which bytes the callers have asked
> * to have logged.
> */
> - bip->bli_orig = (char *)kmem_alloc(XFS_BUF_COUNT(bp), KM_SLEEP);
> + bip->bli_orig = kmem_alloc(XFS_BUF_COUNT(bp), KM_SLEEP);
> memcpy(bip->bli_orig, XFS_BUF_PTR(bp), XFS_BUF_COUNT(bp));
> - bip->bli_logged = (char *)kmem_zalloc(XFS_BUF_COUNT(bp) / NBBY,
> KM_SLEEP);
> + bip->bli_logged = kmem_zalloc(XFS_BUF_COUNT(bp) / NBBY, KM_SLEEP);
> #endif
>
> /*
> diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c
> index 05a4bdd..53ccdc4 100644
> --- a/fs/xfs/xfs_extfree_item.c
> +++ b/fs/xfs/xfs_extfree_item.c
> @@ -253,9 +253,9 @@ xfs_efi_init(xfs_mount_t *mp,
> if (nextents > XFS_EFI_MAX_FAST_EXTENTS) {
> size = (uint)(sizeof(xfs_efi_log_item_t) +
> ((nextents - 1) * sizeof(xfs_extent_t)));
> - efip = (xfs_efi_log_item_t*)kmem_zalloc(size, KM_SLEEP);
> + efip = kmem_zalloc(size, KM_SLEEP);
> } else {
> - efip = (xfs_efi_log_item_t*)kmem_zone_zalloc(xfs_efi_zone,
> + efip = kmem_zone_zalloc(xfs_efi_zone,
> KM_SLEEP);

Ditto.

>
> }
>
> @@ -548,9 +548,9 @@ xfs_efd_init(xfs_mount_t *mp,
> if (nextents > XFS_EFD_MAX_FAST_EXTENTS) {
> size = (uint)(sizeof(xfs_efd_log_item_t) +
> ((nextents - 1) * sizeof(xfs_extent_t)));
> - efdp = (xfs_efd_log_item_t*)kmem_zalloc(size, KM_SLEEP);
> + efdp = kmem_zalloc(size, KM_SLEEP);
> } else {
> - efdp = (xfs_efd_log_item_t*)kmem_zone_zalloc(xfs_efd_zone,
> + efdp = kmem_zone_zalloc(xfs_efd_zone,
> KM_SLEEP);

Ditto.

>
> }
>
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index e7ae08d..5ab6e3d 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -3453,7 +3453,7 @@ xfs_iext_add_indirect_multi(
> * (all extents past */
> if (nex2) {
> byte_diff = nex2 * sizeof(xfs_bmbt_rec_t);
> - nex2_ep = (xfs_bmbt_rec_t *) kmem_alloc(byte_diff, KM_NOFS);
> + nex2_ep = kmem_alloc(byte_diff, KM_NOFS);
> memmove(nex2_ep, &erp->er_extbuf[idx], byte_diff);
> erp->er_extcount -= nex2;
> xfs_iext_irec_update_extoffs(ifp, erp_idx + 1, -nex2);
> @@ -3842,8 +3842,7 @@ xfs_iext_realloc_indirect(
> if (new_size == 0) {
> xfs_iext_destroy(ifp);
> } else {
> - ifp->if_u1.if_ext_irec = (xfs_ext_irec_t *)
> - kmem_realloc(ifp->if_u1.if_ext_irec,
> + ifp->if_u1.if_ext_irec = kmem_realloc(ifp->if_u1.if_ext_irec,
> new_size, size, KM_NOFS);
> }
> }
> diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
> index 7ba4501..3037920 100644
> --- a/fs/xfs/xfs_log_recover.c
> +++ b/fs/xfs/xfs_log_recover.c
> @@ -1670,7 +1670,7 @@ xlog_recover_do_buffer_pass1(
> * the bucket.
> */
> if (*bucket == NULL) {
> - bcp = (xfs_buf_cancel_t *)kmem_alloc(sizeof(xfs_buf_cancel_t),
> + bcp = kmem_alloc(sizeof(xfs_buf_cancel_t),
> KM_SLEEP);

Ditto.

>
> bcp->bc_blkno = blkno;
> bcp->bc_len = len;
> @@ -1696,7 +1696,7 @@ xlog_recover_do_buffer_pass1(
> nextp = nextp->bc_next;
> }
> ASSERT(prevp != NULL);
> - bcp = (xfs_buf_cancel_t *)kmem_alloc(sizeof(xfs_buf_cancel_t),
> + bcp = kmem_alloc(sizeof(xfs_buf_cancel_t),
> KM_SLEEP);

Ditto.

>
> bcp->bc_blkno = blkno;
> bcp->bc_len = len;
> @@ -2316,7 +2316,7 @@ xlog_recover_do_inode_trans(
> if (item->ri_buf[0].i_len == sizeof(xfs_inode_log_format_t)) {
> in_f = (xfs_inode_log_format_t *)item->ri_buf[0].i_addr;
> } else {
> - in_f = (xfs_inode_log_format_t *)kmem_alloc(
> + in_f = kmem_alloc(
> sizeof(xfs_inode_log_format_t), KM_SLEEP);
> need_free = 1;
> error = xfs_inode_item_format_convert(&item->ri_buf[0], in_f);
> @@ -3778,8 +3778,7 @@ xlog_do_log_recovery(
> * First do a pass to find all of the cancelled buf log items.
> * Store them in the buf_cancel_table for use in the second pass.
> */
> - log->l_buf_cancel_table =
> - (xfs_buf_cancel_t **)kmem_zalloc(XLOG_BC_TABLE_SIZE *
> + log->l_buf_cancel_table = kmem_zalloc(XLOG_BC_TABLE_SIZE *
> sizeof(xfs_buf_cancel_t*),
> KM_SLEEP);
> error = xlog_do_recovery_pass(log, head_blk, tail_blk,
> diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
> index 8570b82..44d039d 100644
> --- a/fs/xfs/xfs_trans.c
> +++ b/fs/xfs/xfs_trans.c
> @@ -868,7 +868,7 @@ shut_us_down:
> } else if (nvec <= XFS_TRANS_LOGVEC_COUNT) {
> log_vector = log_vector_fast;
> } else {
> - log_vector = (xfs_log_iovec_t *)kmem_alloc(nvec *
> + log_vector = kmem_alloc(nvec *
> sizeof(xfs_log_iovec_t),

Ditto.

>
> KM_SLEEP);
> }
> diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c
> index 23d276a..e1b90f0 100644
> --- a/fs/xfs/xfs_trans_inode.c
> +++ b/fs/xfs/xfs_trans_inode.c
> @@ -271,8 +271,7 @@ xfs_trans_inode_broot_debug(
> ASSERT((ip->i_df.if_broot != NULL) &&
> (ip->i_df.if_broot_bytes > 0));
> iip->ili_root_size = ip->i_df.if_broot_bytes;
> - iip->ili_orig_root =
> - (char*)kmem_alloc(iip->ili_root_size, KM_SLEEP);
> + iip->ili_orig_root = kmem_alloc(iip->ili_root_size, KM_SLEEP);
> memcpy(iip->ili_orig_root, (char*)(ip->i_df.if_broot),
> iip->ili_root_size);
> }
> diff --git a/fs/xfs/xfs_trans_item.c b/fs/xfs/xfs_trans_item.c
> index eb3fc57..49615dd 100644
> --- a/fs/xfs/xfs_trans_item.c
> +++ b/fs/xfs/xfs_trans_item.c
> @@ -54,8 +54,7 @@ xfs_trans_add_item(xfs_trans_t *tp, xfs_log_item_t
> *lip)
> * of them and put it at the front of the chunk list.
> */
> if (tp->t_items_free == 0) {
> - licp = (xfs_log_item_chunk_t*)
> - kmem_alloc(sizeof(xfs_log_item_chunk_t), KM_SLEEP);
> + licp = kmem_alloc(sizeof(xfs_log_item_chunk_t), KM_SLEEP);
> ASSERT(licp != NULL);
> /*
> * Initialize the chunk, and then
> @@ -460,8 +459,7 @@ xfs_trans_add_busy(xfs_trans_t *tp,
> xfs_agnumber_t ag, xfs_extlen_t idx)
> * of them and put it at the front of the chunk list.
> */
> if (tp->t_busy_free == 0) {
> - lbcp = (xfs_log_busy_chunk_t*)
> - kmem_alloc(sizeof(xfs_log_busy_chunk_t), KM_SLEEP);
> + lbcp = kmem_alloc(sizeof(xfs_log_busy_chunk_t), KM_SLEEP);
> ASSERT(lbcp != NULL);
> /*
> * Initialize the chunk, and then
> --
> 1.5.4.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-
> kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

2009-04-09 18:16:00

by Jeremy Fitzhardinge

[permalink] [raw]
Subject: Re: [PATCH 55/56] xen: Remove void casts

Jack Stone wrote:
> [Added maintainer CCs]
> Jack Stone wrote:
>
>> Remove uneeded void casts
>>
>> Signed-Off-By: Jack Stone <[email protected]>
>>
Acked-by: Jeremy Fitzhardinge <[email protected]>


>> ---
>> drivers/xen/manage.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
>> index 0d61db1..89310fb 100644
>> --- a/drivers/xen/manage.c
>> +++ b/drivers/xen/manage.c
>> @@ -149,7 +149,7 @@ static void shutdown_handler(struct xenbus_watch *watch,
>> if (err)
>> return;
>>
>> - str = (char *)xenbus_read(xbt, "control", "shutdown", NULL);
>> + str = xenbus_read(xbt, "control", "shutdown", NULL);
>> /* Ignore read errors and empty reads. */
>> if (XENBUS_IS_ERR_READ(str)) {
>> xenbus_transaction_end(xbt, 1);
>>
>>
>
>

2009-04-09 21:08:54

by Al Viro

[permalink] [raw]
Subject: Re: [PATCH 05/56] block: Remove void casts

On Wed, Apr 08, 2009 at 01:31:43PM +0200, Bert Wesarg wrote:
> If typeof(c) == CommandList_struct*, that you could replace
> sizeof(CommandList_struct) with sizeof(*c) to make the expression
> shorter and fit into one line.

This is not commonly accepted as a good thing. In particular, I would
seriously ask you to avoid doing anything of that kind around fs/*

2009-04-13 09:32:46

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 56/56] xfs: Remove void casts

On Thu, Apr 09, 2009 at 12:37:08PM -0500, Felix Blyakher wrote:
>
> On Apr 8, 2009, at 6:22 AM, Jack Stone wrote:
>
>> Remove uneeded void casts
>>
>> Signed-Off-By: Jack Stone <[email protected]>
>
> See comments below.

Agree with the comments, als the subject line seems wrong, the patch
doesn't remove void casts, but casts from a void pointer to a typed
one which aren't nessecary.

Also please don't submit patches like this in a large series to the
world but separately to the listed maintainer / mailinglist of each
subsystem as there is no interdependency nor a general interest.

2009-04-13 09:35:28

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH 56/56] xfs: Remove void casts

Christoph Hellwig wrote:
> On Thu, Apr 09, 2009 at 12:37:08PM -0500, Felix Blyakher wrote:
>> On Apr 8, 2009, at 6:22 AM, Jack Stone wrote:
>>
>>> Remove uneeded void casts
>>>
>>> Signed-Off-By: Jack Stone <[email protected]>
>> See comments below.
>
> Agree with the comments, als the subject line seems wrong, the patch
> doesn't remove void casts, but casts from a void pointer to a typed
> one which aren't nessecary.
>
> Also please don't submit patches like this in a large series to the
> world but separately to the listed maintainer / mailinglist of each
> subsystem as there is no interdependency nor a general interest.

And what evil have I committed, to be cursed with being CC'd on every
damn one of these things?

Jeff



Subject: Re: [PATCH 15/56] ide: Remove void casts

On Thursday 09 April 2009 11:57:04 Jack Stone wrote:
> [Added maintainer CC]
> Jack Stone wrote:
> > Remove uneeded void casts
> >
> > Signed-Off-By: Jack Stone <[email protected]>

applied