linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/21] Remove unnecessary kmalloc casts
@ 2010-06-01  3:23 Joe Perches
  2010-06-01  3:23 ` [PATCH 01/21] arch/cris: " Joe Perches
                   ` (20 more replies)
  0 siblings, 21 replies; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel

Joe Perches (21):
  arch/cris: Remove unnecessary kmalloc casts
  arch/powerpc: Remove unnecessary kmalloc casts
  arch/x86/kernel/tlb_uv.c: Remove unnecessary kmalloc casts
  drivers/block/cciss_scsi.c: Remove unnecessary kmalloc casts
  drivers/gpu/drm: Remove unnecessary kmalloc casts
  drivers/i2c/i2c-dev.c: Remove unnecessary kmalloc casts
  drivers/isdn/capi/capidrv.c: Remove unnecessary kmalloc casts
  drivers/media: Remove unnecesary kmalloc casts
  drivers/message/i2o/i20_config.c: Remove unnecessary kmalloc casts
  drivers/net/gianfar.c: Remove unnecessary kmalloc casts
  drivers/net/tulip/eeprom.c: Remove unnecessary kmalloc casts
  drivers/net/vxge/vxge-main.c: Remove unnecessary kmalloc casts
  drivers/net/wireless/ipw2x00/ipw2100.c: Remove unnecessary kmalloc casts
  drivers/parisc/iosapic.c: Remove unnecessary kzalloc cast
  drivers/s390: Remove unnecessary kmalloc casts
  drivers/serial/icom.c: Remove unnecessary kmalloc casts
  drivers/usb/storage/isd200.c: Remove unnecessary kmalloc casts
  fs/ufs/util.c: Remove unnecessary kmalloc casts
  net/ipv4/igmp.c: Remove unnecessary kmalloc casts
  net/ipv6/mcast.c: Remove unnecessary kmalloc casts
  net/sctp/protocol.c: Remove unnecessary kmalloc casts

 arch/cris/arch-v32/mm/intmem.c         |   13 +++++--------
 arch/powerpc/kernel/nvram_64.c         |    3 +--
 arch/powerpc/kvm/book3s.c              |    4 ++--
 arch/x86/kernel/tlb_uv.c               |   15 +++++++--------
 drivers/block/cciss_scsi.c             |    3 +--
 drivers/gpu/drm/drm_sman.c             |    4 +---
 drivers/gpu/drm/i915/i915_dma.c        |    3 +--
 drivers/i2c/i2c-dev.c                  |    4 +---
 drivers/isdn/capi/capidrv.c            |    3 +--
 drivers/media/dvb/siano/smscoreapi.c   |    4 +---
 drivers/media/video/w9968cf.c          |    3 +--
 drivers/message/i2o/i2o_config.c       |    3 +--
 drivers/net/gianfar.c                  |    8 ++++----
 drivers/net/tulip/eeprom.c             |   10 +++++-----
 drivers/net/vxge/vxge-main.c           |    4 +---
 drivers/net/wireless/ipw2x00/ipw2100.c |   18 +++++++-----------
 drivers/parisc/iosapic.c               |    4 ++--
 drivers/s390/block/dasd_devmap.c       |    3 +--
 drivers/s390/char/con3215.c            |    4 ++--
 drivers/serial/icom.c                  |    3 +--
 drivers/usb/storage/isd200.c           |    3 +--
 fs/ufs/util.c                          |    3 +--
 net/ipv4/igmp.c                        |    3 +--
 net/ipv6/mcast.c                       |    3 +--
 net/sctp/protocol.c                    |    3 +--
 25 files changed, 51 insertions(+), 80 deletions(-)


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 01/21] arch/cris: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  3:23 ` [PATCH 02/21] arch/powerpc: " Joe Perches
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel

And separate declaration from allocation
Still no error checking on failure, but it probably doesn't matter.

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/cris/arch-v32/mm/intmem.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/arch/cris/arch-v32/mm/intmem.c b/arch/cris/arch-v32/mm/intmem.c
index 9e8b69c..1b17d92 100644
--- a/arch/cris/arch-v32/mm/intmem.c
+++ b/arch/cris/arch-v32/mm/intmem.c
@@ -33,8 +33,8 @@ static void crisv32_intmem_init(void)
 {
 	static int initiated = 0;
 	if (!initiated) {
-		struct intmem_allocation* alloc =
-		  (struct intmem_allocation*)kmalloc(sizeof *alloc, GFP_KERNEL);
+		struct intmem_allocation* alloc;
+		alloc = kmalloc(sizeof *alloc, GFP_KERNEL);
 		INIT_LIST_HEAD(&intmem_allocations);
 		intmem_virtual = ioremap(MEM_INTMEM_START + RESERVED_SIZE,
 					 MEM_INTMEM_SIZE - RESERVED_SIZE);
@@ -62,9 +62,8 @@ void* crisv32_intmem_alloc(unsigned size, unsigned align)
 		if (allocation->status == STATUS_FREE &&
 		    allocation->size >= size + alignment) {
 			if (allocation->size > size + alignment) {
-				struct intmem_allocation* alloc =
-					(struct intmem_allocation*)
-					kmalloc(sizeof *alloc, GFP_ATOMIC);
+				struct intmem_allocation* alloc;
+				alloc = kmalloc(sizeof *alloc, GFP_ATOMIC);
 				alloc->status = STATUS_FREE;
 				alloc->size = allocation->size - size -
 					alignment;
@@ -74,9 +73,7 @@ void* crisv32_intmem_alloc(unsigned size, unsigned align)
 
 				if (alignment) {
 					struct intmem_allocation *tmp;
-					tmp = (struct intmem_allocation *)
-						kmalloc(sizeof *tmp,
-							GFP_ATOMIC);
+					tmp = kmalloc(sizeof *tmp, GFP_ATOMIC);
 					tmp->offset = allocation->offset;
 					tmp->size = alignment;
 					tmp->status = STATUS_FREE;
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 02/21] arch/powerpc: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
  2010-06-01  3:23 ` [PATCH 01/21] arch/cris: " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  3:23 ` [PATCH 03/21] arch/x86/kernel/tlb_uv.c: " Joe Perches
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Avi Kivity, Marcelo Tosatti, Alexander Graf, kvm, kvm-ppc

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/powerpc/kernel/nvram_64.c |    3 +--
 arch/powerpc/kvm/book3s.c      |    4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index 9cf197f..99c6dab 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -502,8 +502,7 @@ static int __init nvram_scan_partitions(void)
 			       "detected: 0-length partition\n");
 			goto out;
 		}
-		tmp_part = (struct nvram_partition *)
-			kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
+		tmp_part = kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
 		err = -ENOMEM;
 		if (!tmp_part) {
 			printk(KERN_ERR "nvram_scan_partitions: kmalloc failed\n");
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index b998abf..2a8b9b6 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -1248,8 +1248,8 @@ struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, unsigned int id)
 
 	memset(vcpu_book3s, 0, sizeof(struct kvmppc_vcpu_book3s));
 
-	vcpu_book3s->shadow_vcpu = (struct kvmppc_book3s_shadow_vcpu *)
-		kzalloc(sizeof(*vcpu_book3s->shadow_vcpu), GFP_KERNEL);
+	vcpu_book3s->shadow_vcpu = kzalloc(sizeof(*vcpu_book3s->shadow_vcpu),
+					   GFP_KERNEL);
 	if (!vcpu_book3s->shadow_vcpu)
 		goto free_vcpu;
 
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 03/21] arch/x86/kernel/tlb_uv.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
  2010-06-01  3:23 ` [PATCH 01/21] arch/cris: " Joe Perches
  2010-06-01  3:23 ` [PATCH 02/21] arch/powerpc: " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  3:23 ` [PATCH 04/21] drivers/block/cciss_scsi.c: " Joe Perches
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel

And convert a kmalloc/memset to kzalloc

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/x86/kernel/tlb_uv.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/x86/kernel/tlb_uv.c b/arch/x86/kernel/tlb_uv.c
index 7fea555..4c0a5e8 100644
--- a/arch/x86/kernel/tlb_uv.c
+++ b/arch/x86/kernel/tlb_uv.c
@@ -1141,8 +1141,9 @@ uv_activation_descriptor_init(int node, int pnode)
 	 * each bau_desc is 64 bytes; there are 8 (UV_ITEMS_PER_DESCRIPTOR)
 	 * per cpu; and up to 32 (UV_ADP_SIZE) cpu's per uvhub
 	 */
-	bau_desc = (struct bau_desc *)kmalloc_node(sizeof(struct bau_desc)*
-		UV_ADP_SIZE*UV_ITEMS_PER_DESCRIPTOR, GFP_KERNEL, node);
+	bau_desc = kmalloc_node(sizeof(struct bau_desc) *
+				UV_ADP_SIZE * UV_ITEMS_PER_DESCRIPTOR,
+				GFP_KERNEL, node);
 	BUG_ON(!bau_desc);
 
 	pa = uv_gpa(bau_desc); /* need the real nasid*/
@@ -1200,9 +1201,9 @@ uv_payload_queue_init(int node, int pnode)
 	struct bau_payload_queue_entry *pqp_malloc;
 	struct bau_control *bcp;
 
-	pqp = (struct bau_payload_queue_entry *) kmalloc_node(
-		(DEST_Q_SIZE + 1) * sizeof(struct bau_payload_queue_entry),
-		GFP_KERNEL, node);
+	pqp = kmalloc_node((DEST_Q_SIZE + 1) *
+			   sizeof(struct bau_payload_queue_entry),
+			   GFP_KERNEL, node);
 	BUG_ON(!pqp);
 	pqp_malloc = pqp;
 
@@ -1286,9 +1287,7 @@ static void uv_init_per_cpu(int nuvhubs)
 	};
 	struct uvhub_desc *uvhub_descs;
 
-	uvhub_descs = (struct uvhub_desc *)
-		kmalloc(nuvhubs * sizeof(struct uvhub_desc), GFP_KERNEL);
-	memset(uvhub_descs, 0, nuvhubs * sizeof(struct uvhub_desc));
+	uvhub_descs = kzalloc(nuvhubs * sizeof(struct uvhub_desc), GFP_KERNEL);
 	for_each_present_cpu(cpu) {
 		bcp = &per_cpu(bau_control, cpu);
 		memset(bcp, 0, sizeof(struct bau_control));
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 04/21] drivers/block/cciss_scsi.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (2 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 03/21] arch/x86/kernel/tlb_uv.c: " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01 15:26   ` Miller, Mike (OS Dev)
  2010-06-01  3:23 ` [PATCH 05/21] drivers/gpu/drm: " Joe Perches
                   ` (16 subsequent siblings)
  20 siblings, 1 reply; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mike Miller, iss_storagedev

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/block/cciss_scsi.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
index e1d0e2c..ffd8470 100644
--- a/drivers/block/cciss_scsi.c
+++ b/drivers/block/cciss_scsi.c
@@ -702,8 +702,7 @@ cciss_scsi_setup(int cntl_num)
 	struct cciss_scsi_adapter_data_t * shba;
 
 	ccissscsi[cntl_num].ndevices = 0;
-	shba = (struct cciss_scsi_adapter_data_t *)
-		kmalloc(sizeof(*shba), GFP_KERNEL);	
+	shba = kmalloc(sizeof(*shba), GFP_KERNEL);
 	if (shba == NULL)
 		return;
 	shba->scsi_host = NULL;
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 05/21] drivers/gpu/drm: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (3 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 04/21] drivers/block/cciss_scsi.c: " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  3:23 ` [PATCH 06/21] drivers/i2c/i2c-dev.c: " Joe Perches
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: David Airlie, dri-devel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/gpu/drm/drm_sman.c      |    4 +---
 drivers/gpu/drm/i915/i915_dma.c |    3 +--
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/drm_sman.c b/drivers/gpu/drm/drm_sman.c
index 463aed9..3466458 100644
--- a/drivers/gpu/drm/drm_sman.c
+++ b/drivers/gpu/drm/drm_sman.c
@@ -59,9 +59,7 @@ drm_sman_init(struct drm_sman * sman, unsigned int num_managers,
 {
 	int ret = 0;
 
-	sman->mm = (struct drm_sman_mm *) kcalloc(num_managers,
-						  sizeof(*sman->mm),
-						  GFP_KERNEL);
+	sman->mm = kcalloc(num_managers, sizeof(*sman->mm), GFP_KERNEL);
 	if (!sman->mm) {
 		ret = -ENOMEM;
 		goto out;
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 2a6b5de..f3d5d9f 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1821,8 +1821,7 @@ int i915_driver_open(struct drm_device *dev, struct drm_file *file_priv)
 	struct drm_i915_file_private *i915_file_priv;
 
 	DRM_DEBUG_DRIVER("\n");
-	i915_file_priv = (struct drm_i915_file_private *)
-	    kmalloc(sizeof(*i915_file_priv), GFP_KERNEL);
+	i915_file_priv = kmalloc(sizeof(*i915_file_priv), GFP_KERNEL);
 
 	if (!i915_file_priv)
 		return -ENOMEM;
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 06/21] drivers/i2c/i2c-dev.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (4 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 05/21] drivers/gpu/drm: " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01 10:57   ` Jean Delvare
  2010-06-01  3:23 ` [PATCH 07/21] drivers/isdn/capi/capidrv.c: " Joe Perches
                   ` (14 subsequent siblings)
  20 siblings, 1 reply; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jean Delvare (PC drivers, core), Ben Dooks (embedded platforms),
	linux-i2c

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/i2c/i2c-dev.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index e0694e4..b3fcb59 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -219,9 +219,7 @@ static noinline int i2cdev_ioctl_rdrw(struct i2c_client *client,
 	if (rdwr_arg.nmsgs > I2C_RDRW_IOCTL_MAX_MSGS)
 		return -EINVAL;
 
-	rdwr_pa = (struct i2c_msg *)
-		kmalloc(rdwr_arg.nmsgs * sizeof(struct i2c_msg),
-		GFP_KERNEL);
+	rdwr_pa = kmalloc(rdwr_arg.nmsgs * sizeof(struct i2c_msg), GFP_KERNEL);
 	if (!rdwr_pa)
 		return -ENOMEM;
 
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 07/21] drivers/isdn/capi/capidrv.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (5 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 06/21] drivers/i2c/i2c-dev.c: " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  3:23 ` [PATCH 08/21] drivers/media: Remove unnecesary " Joe Perches
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/isdn/capi/capidrv.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c
index bf55ed5..02e0182 100644
--- a/drivers/isdn/capi/capidrv.c
+++ b/drivers/isdn/capi/capidrv.c
@@ -469,8 +469,7 @@ static int capidrv_add_ack(struct capidrv_ncci *nccip,
 {
 	struct ncci_datahandle_queue *n, **pp;
 
-	n = (struct ncci_datahandle_queue *)
-		kmalloc(sizeof(struct ncci_datahandle_queue), GFP_ATOMIC);
+	n = kmalloc(sizeof(struct ncci_datahandle_queue), GFP_ATOMIC);
 	if (!n) {
 	   printk(KERN_ERR "capidrv: kmalloc ncci_datahandle failed\n");
 	   return -1;
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 08/21] drivers/media: Remove unnecesary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (6 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 07/21] drivers/isdn/capi/capidrv.c: " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  3:23 ` [PATCH 09/21] drivers/message/i2o/i20_config.c: Remove unnecessary " Joe Perches
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Luca Risolia, linux-usb, linux-media

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/media/dvb/siano/smscoreapi.c |    4 +---
 drivers/media/video/w9968cf.c        |    3 +--
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c
index 0c87a3c..828bcc2 100644
--- a/drivers/media/dvb/siano/smscoreapi.c
+++ b/drivers/media/dvb/siano/smscoreapi.c
@@ -116,9 +116,7 @@ static struct smscore_registry_entry_t *smscore_find_registry(char *devpath)
 			return entry;
 		}
 	}
-	entry = (struct smscore_registry_entry_t *)
-			kmalloc(sizeof(struct smscore_registry_entry_t),
-				GFP_KERNEL);
+	entry = kmalloc(sizeof(struct smscore_registry_entry_t), GFP_KERNEL);
 	if (entry) {
 		entry->mode = default_mode;
 		strcpy(entry->devpath, devpath);
diff --git a/drivers/media/video/w9968cf.c b/drivers/media/video/w9968cf.c
index d807eea..591fc6d 100644
--- a/drivers/media/video/w9968cf.c
+++ b/drivers/media/video/w9968cf.c
@@ -3429,8 +3429,7 @@ w9968cf_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
 	else
 		return -ENODEV;
 
-	cam = (struct w9968cf_device*)
-		  kzalloc(sizeof(struct w9968cf_device), GFP_KERNEL);
+	cam = kzalloc(sizeof(struct w9968cf_device), GFP_KERNEL);
 	if (!cam)
 		return -ENOMEM;
 
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 09/21] drivers/message/i2o/i20_config.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (7 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 08/21] drivers/media: Remove unnecesary " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  3:23 ` [PATCH 10/21] drivers/net/gianfar.c: " Joe Perches
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/message/i2o/i2o_config.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
index c4b117f..3be46c5 100644
--- a/drivers/message/i2o/i2o_config.c
+++ b/drivers/message/i2o/i2o_config.c
@@ -1041,8 +1041,7 @@ static long i2o_cfg_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
 
 static int cfg_open(struct inode *inode, struct file *file)
 {
-	struct i2o_cfg_info *tmp =
-	    (struct i2o_cfg_info *)kmalloc(sizeof(struct i2o_cfg_info),
+	struct i2o_cfg_info *tmp = kmalloc(sizeof(struct i2o_cfg_info),
 					   GFP_KERNEL);
 	unsigned long flags;
 
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 10/21] drivers/net/gianfar.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (8 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 09/21] drivers/message/i2o/i20_config.c: Remove unnecessary " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  7:17   ` David Miller
  2010-06-01  3:23 ` [PATCH 11/21] drivers/net/tulip/eeprom.c: " Joe Perches
                   ` (10 subsequent siblings)
  20 siblings, 1 reply; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/gianfar.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 1830f31..ab54821 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -681,8 +681,8 @@ static int gfar_of_init(struct of_device *ofdev, struct net_device **pdev)
 		priv->rx_queue[i] = NULL;
 
 	for (i = 0; i < priv->num_tx_queues; i++) {
-		priv->tx_queue[i] =  (struct gfar_priv_tx_q *)kzalloc(
-				sizeof (struct gfar_priv_tx_q), GFP_KERNEL);
+		priv->tx_queue[i] = kzalloc(sizeof(struct gfar_priv_tx_q),
+					    GFP_KERNEL);
 		if (!priv->tx_queue[i]) {
 			err = -ENOMEM;
 			goto tx_alloc_failed;
@@ -694,8 +694,8 @@ static int gfar_of_init(struct of_device *ofdev, struct net_device **pdev)
 	}
 
 	for (i = 0; i < priv->num_rx_queues; i++) {
-		priv->rx_queue[i] = (struct gfar_priv_rx_q *)kzalloc(
-					sizeof (struct gfar_priv_rx_q), GFP_KERNEL);
+		priv->rx_queue[i] = kzalloc(sizeof(struct gfar_priv_rx_q),
+					    GFP_KERNEL);
 		if (!priv->rx_queue[i]) {
 			err = -ENOMEM;
 			goto rx_alloc_failed;
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 11/21] drivers/net/tulip/eeprom.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (9 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 10/21] drivers/net/gianfar.c: " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  7:17   ` David Miller
  2010-06-01  3:23 ` [PATCH 12/21] drivers/net/vxge/vxge-main.c: " Joe Perches
                   ` (9 subsequent siblings)
  20 siblings, 1 reply; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Grant Grundler, Kyle McMartin, netdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/tulip/eeprom.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c
index 6002e65..3031ed9 100644
--- a/drivers/net/tulip/eeprom.c
+++ b/drivers/net/tulip/eeprom.c
@@ -120,8 +120,8 @@ static void __devinit tulip_build_fake_mediatable(struct tulip_private *tp)
 			  0x00, 0x06  /* ttm bit map */
 			};
 
-		tp->mtable = (struct mediatable *)
-			kmalloc(sizeof(struct mediatable) + sizeof(struct medialeaf), GFP_KERNEL);
+		tp->mtable = kmalloc(sizeof(struct mediatable) +
+				     sizeof(struct medialeaf), GFP_KERNEL);
 
 		if (tp->mtable == NULL)
 			return; /* Horrible, impossible failure. */
@@ -227,9 +227,9 @@ subsequent_board:
 		        return;
 		}
 
-		mtable = (struct mediatable *)
-			kmalloc(sizeof(struct mediatable) + count*sizeof(struct medialeaf),
-					GFP_KERNEL);
+		mtable = kmalloc(sizeof(struct mediatable) +
+				 count * sizeof(struct medialeaf),
+				 GFP_KERNEL);
 		if (mtable == NULL)
 			return;				/* Horrible, impossible failure. */
 		last_mediatable = tp->mtable = mtable;
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 12/21] drivers/net/vxge/vxge-main.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (10 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 11/21] drivers/net/tulip/eeprom.c: " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  3:23 ` [PATCH 13/21] drivers/net/wireless/ipw2x00/ipw2100.c: " Joe Perches
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/vxge/vxge-main.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index b504bd5..3c43430 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -4350,9 +4350,7 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre)
 
 	/* Copy the station mac address to the list */
 	for (i = 0; i < vdev->no_of_vpath; i++) {
-		entry =	(struct vxge_mac_addrs *)
-				kzalloc(sizeof(struct vxge_mac_addrs),
-					GFP_KERNEL);
+		entry =	kzalloc(sizeof(struct vxge_mac_addrs), GFP_KERNEL);
 		if (NULL == entry) {
 			vxge_debug_init(VXGE_ERR,
 				"%s: mac_addr_list : memory allocation failed",
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 13/21] drivers/net/wireless/ipw2x00/ipw2100.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (11 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 12/21] drivers/net/vxge/vxge-main.c: " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  3:23 ` [PATCH 14/21] drivers/parisc/iosapic.c: Remove unnecessary kzalloc cast Joe Perches
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: Zhu Yi, Reinette Chatre, Intel Linux Wireless, linux-wireless

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/ipw2x00/ipw2100.c |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 0bd4dfa..18ebd60 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -3467,10 +3467,8 @@ static int ipw2100_msg_allocate(struct ipw2100_priv *priv)
 	dma_addr_t p;
 
 	priv->msg_buffers =
-	    (struct ipw2100_tx_packet *)kmalloc(IPW_COMMAND_POOL_SIZE *
-						sizeof(struct
-						       ipw2100_tx_packet),
-						GFP_KERNEL);
+	    kmalloc(IPW_COMMAND_POOL_SIZE * sizeof(struct ipw2100_tx_packet),
+		    GFP_KERNEL);
 	if (!priv->msg_buffers) {
 		printk(KERN_ERR DRV_NAME ": %s: PCI alloc failed for msg "
 		       "buffers.\n", priv->net_dev->name);
@@ -4499,10 +4497,8 @@ static int ipw2100_tx_allocate(struct ipw2100_priv *priv)
 	}
 
 	priv->tx_buffers =
-	    (struct ipw2100_tx_packet *)kmalloc(TX_PENDED_QUEUE_LENGTH *
-						sizeof(struct
-						       ipw2100_tx_packet),
-						GFP_ATOMIC);
+	    kmalloc(TX_PENDED_QUEUE_LENGTH * sizeof(struct ipw2100_tx_packet),
+		    GFP_ATOMIC);
 	if (!priv->tx_buffers) {
 		printk(KERN_ERR DRV_NAME
 		       ": %s: alloc failed form tx buffers.\n",
@@ -4651,9 +4647,9 @@ static int ipw2100_rx_allocate(struct ipw2100_priv *priv)
 	/*
 	 * allocate packets
 	 */
-	priv->rx_buffers = (struct ipw2100_rx_packet *)
-	    kmalloc(RX_QUEUE_LENGTH * sizeof(struct ipw2100_rx_packet),
-		    GFP_KERNEL);
+	priv->rx_buffers = kmalloc(RX_QUEUE_LENGTH *
+				   sizeof(struct ipw2100_rx_packet),
+				   GFP_KERNEL);
 	if (!priv->rx_buffers) {
 		IPW_DEBUG_INFO("can't allocate rx packet buffer table\n");
 
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 14/21] drivers/parisc/iosapic.c: Remove unnecessary kzalloc cast
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (12 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 13/21] drivers/net/wireless/ipw2x00/ipw2100.c: " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01 21:02   ` Grant Grundler
  2010-06-01  3:23 ` [PATCH 15/21] drivers/s390: Remove unnecessary kmalloc casts Joe Perches
                   ` (6 subsequent siblings)
  20 siblings, 1 reply; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: Kyle McMartin, Helge Deller, James E.J. Bottomley, linux-parisc

Convert kzalloc to kcalloc

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/parisc/iosapic.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c
index c768367..3e6f56c 100644
--- a/drivers/parisc/iosapic.c
+++ b/drivers/parisc/iosapic.c
@@ -891,8 +891,8 @@ void *iosapic_register(unsigned long hpa)
 	isi->isi_version = iosapic_rd_version(isi);
 	isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1;
 
-	vip = isi->isi_vector = (struct vector_info *)
-		kzalloc(sizeof(struct vector_info) * isi->isi_num_vectors, GFP_KERNEL);
+	vip = isi->isi_vector = kcalloc(isi->isi_num_vectors,
+					sizeof(struct vector_info), GFP_KERNEL);
 	if (vip == NULL) {
 		kfree(isi);
 		return NULL;
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 15/21] drivers/s390: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (13 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 14/21] drivers/parisc/iosapic.c: Remove unnecessary kzalloc cast Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  3:23 ` [PATCH 16/21] drivers/serial/icom.c: " Joe Perches
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/s390/block/dasd_devmap.c |    3 +--
 drivers/s390/char/con3215.c      |    4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index 34d51dd..8c962dc 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -409,8 +409,7 @@ dasd_add_busid(const char *bus_id, int features)
 	struct dasd_devmap *devmap, *new, *tmp;
 	int hash;
 
-	new = (struct dasd_devmap *)
-		kzalloc(sizeof(struct dasd_devmap), GFP_KERNEL);
+	new = kzalloc(sizeof(struct dasd_devmap), GFP_KERNEL);
 	if (!new)
 		return ERR_PTR(-ENOMEM);
 	spin_lock(&dasd_devmap_lock);
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index 59ec073..6752c42 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -888,8 +888,8 @@ static int __init con3215_init(void)
 	if (IS_ERR(cdev))
 		return -ENODEV;
 
-	raw3215[0] = raw = (struct raw3215_info *)
-		kzalloc(sizeof(struct raw3215_info), GFP_KERNEL | GFP_DMA);
+	raw3215[0] = raw = kzalloc(sizeof(struct raw3215_info),
+				   GFP_KERNEL | GFP_DMA);
 	raw->buffer = kzalloc(RAW3215_BUFFER_SIZE, GFP_KERNEL | GFP_DMA);
 	raw->inbuf = kzalloc(RAW3215_INBUF_SIZE, GFP_KERNEL | GFP_DMA);
 	raw->cdev = cdev;
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 16/21] drivers/serial/icom.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (14 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 15/21] drivers/s390: Remove unnecessary kmalloc casts Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  3:23 ` [PATCH 17/21] drivers/usb/storage/isd200.c: " Joe Perches
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/serial/icom.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/icom.c b/drivers/serial/icom.c
index 53a4682..105e25c 100644
--- a/drivers/serial/icom.c
+++ b/drivers/serial/icom.c
@@ -1416,8 +1416,7 @@ static int __devinit icom_alloc_adapter(struct icom_adapter
 	struct icom_adapter *cur_adapter_entry;
 	struct list_head *tmp;
 
-	icom_adapter = (struct icom_adapter *)
-	    kzalloc(sizeof(struct icom_adapter), GFP_KERNEL);
+	icom_adapter = kzalloc(sizeof(struct icom_adapter), GFP_KERNEL);
 
 	if (!icom_adapter) {
 		return -ENOMEM;
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 17/21] drivers/usb/storage/isd200.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (15 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 16/21] drivers/serial/icom.c: " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  3:23 ` [PATCH 18/21] fs/ufs/util.c: " Joe Perches
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Matthew Dharm, linux-usb, usb-storage

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/usb/storage/isd200.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c
index e9cbc14..6b9982c 100644
--- a/drivers/usb/storage/isd200.c
+++ b/drivers/usb/storage/isd200.c
@@ -1456,8 +1456,7 @@ static int isd200_init_info(struct us_data *us)
 	int retStatus = ISD200_GOOD;
 	struct isd200_info *info;
 
-	info = (struct isd200_info *)
-			kzalloc(sizeof(struct isd200_info), GFP_KERNEL);
+	info = kzalloc(sizeof(struct isd200_info), GFP_KERNEL);
 	if (!info)
 		retStatus = ISD200_ERROR;
 	else {
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 18/21] fs/ufs/util.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (16 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 17/21] drivers/usb/storage/isd200.c: " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  3:23 ` [PATCH 19/21] net/ipv4/igmp.c: " Joe Perches
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Evgeniy Dushistov

Signed-off-by: Joe Perches <joe@perches.com>
---
 fs/ufs/util.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/ufs/util.c b/fs/ufs/util.c
index 85a7fc9..9c44f32 100644
--- a/fs/ufs/util.c
+++ b/fs/ufs/util.c
@@ -26,8 +26,7 @@ struct ufs_buffer_head * _ubh_bread_ (struct ufs_sb_private_info * uspi,
 	count = size >> uspi->s_fshift;
 	if (count > UFS_MAXFRAG)
 		return NULL;
-	ubh = (struct ufs_buffer_head *)
-		kmalloc (sizeof (struct ufs_buffer_head), GFP_KERNEL);
+	ubh = kmalloc(sizeof(struct ufs_buffer_head), GFP_KERNEL);
 	if (!ubh)
 		return NULL;
 	ubh->fragment = fragment;
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 19/21] net/ipv4/igmp.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (17 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 18/21] fs/ufs/util.c: " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  7:17   ` David Miller
  2010-06-01  3:23 ` [PATCH 20/21] net/ipv6/mcast.c: " Joe Perches
  2010-06-01  3:23 ` [PATCH 21/21] net/sctp/protocol.c: " Joe Perches
  20 siblings, 1 reply; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: David S. Miller, Alexey Kuznetsov, Pekka Savola (ipv6),
	James Morris, Hideaki YOSHIFUJI, Patrick McHardy, netdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/ipv4/igmp.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 5fff865..250cb5e 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1646,8 +1646,7 @@ static int sf_setstate(struct ip_mc_list *pmc)
 				if (dpsf->sf_inaddr == psf->sf_inaddr)
 					break;
 			if (!dpsf) {
-				dpsf = (struct ip_sf_list *)
-					kmalloc(sizeof(*dpsf), GFP_ATOMIC);
+				dpsf = kmalloc(sizeof(*dpsf), GFP_ATOMIC);
 				if (!dpsf)
 					continue;
 				*dpsf = *psf;
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 20/21] net/ipv6/mcast.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (18 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 19/21] net/ipv4/igmp.c: " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-01  7:17   ` David Miller
  2010-06-01  3:23 ` [PATCH 21/21] net/sctp/protocol.c: " Joe Perches
  20 siblings, 1 reply; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: David S. Miller, Alexey Kuznetsov, Pekka Savola (ipv6),
	James Morris, Hideaki YOSHIFUJI, Patrick McHardy, netdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/ipv6/mcast.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 59f1881..7b5fb43 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1995,8 +1995,7 @@ static int sf_setstate(struct ifmcaddr6 *pmc)
 				    &psf->sf_addr))
 					break;
 			if (!dpsf) {
-				dpsf = (struct ip6_sf_list *)
-					kmalloc(sizeof(*dpsf), GFP_ATOMIC);
+				dpsf = kmalloc(sizeof(*dpsf), GFP_ATOMIC);
 				if (!dpsf)
 					continue;
 				*dpsf = *psf;
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [PATCH 21/21] net/sctp/protocol.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
                   ` (19 preceding siblings ...)
  2010-06-01  3:23 ` [PATCH 20/21] net/ipv6/mcast.c: " Joe Perches
@ 2010-06-01  3:23 ` Joe Perches
  2010-06-02 17:30   ` Vlad Yasevich
  20 siblings, 1 reply; 30+ messages in thread
From: Joe Perches @ 2010-06-01  3:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Vlad Yasevich, Sridhar Samudrala, linux-sctp

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/sctp/protocol.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 1827498..fef38be 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1216,8 +1216,7 @@ SCTP_STATIC __init int sctp_init(void)
 
 	/* Allocate and initialize the endpoint hash table.  */
 	sctp_ep_hashsize = 64;
-	sctp_ep_hashtable = (struct sctp_hashbucket *)
-		kmalloc(64 * sizeof(struct sctp_hashbucket), GFP_KERNEL);
+	sctp_ep_hashtable = kmalloc(64 * sizeof(struct sctp_hashbucket), GFP_KERNEL);
 	if (!sctp_ep_hashtable) {
 		printk(KERN_ERR "SCTP: Failed endpoint_hash alloc.\n");
 		status = -ENOMEM;
-- 
1.7.0.3.311.g6a6955


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* Re: [PATCH 19/21] net/ipv4/igmp.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 ` [PATCH 19/21] net/ipv4/igmp.c: " Joe Perches
@ 2010-06-01  7:17   ` David Miller
  0 siblings, 0 replies; 30+ messages in thread
From: David Miller @ 2010-06-01  7:17 UTC (permalink / raw)
  To: joe; +Cc: linux-kernel, kuznet, pekkas, jmorris, yoshfuji, kaber, netdev

From: Joe Perches <joe@perches.com>
Date: Mon, 31 May 2010 20:23:21 -0700

> Signed-off-by: Joe Perches <joe@perches.com>

Applied.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 20/21] net/ipv6/mcast.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 ` [PATCH 20/21] net/ipv6/mcast.c: " Joe Perches
@ 2010-06-01  7:17   ` David Miller
  0 siblings, 0 replies; 30+ messages in thread
From: David Miller @ 2010-06-01  7:17 UTC (permalink / raw)
  To: joe; +Cc: linux-kernel, kuznet, pekkas, jmorris, yoshfuji, kaber, netdev

From: Joe Perches <joe@perches.com>
Date: Mon, 31 May 2010 20:23:22 -0700

> Signed-off-by: Joe Perches <joe@perches.com>

Applied.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 10/21] drivers/net/gianfar.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 ` [PATCH 10/21] drivers/net/gianfar.c: " Joe Perches
@ 2010-06-01  7:17   ` David Miller
  0 siblings, 0 replies; 30+ messages in thread
From: David Miller @ 2010-06-01  7:17 UTC (permalink / raw)
  To: joe; +Cc: linux-kernel, netdev

From: Joe Perches <joe@perches.com>
Date: Mon, 31 May 2010 20:23:12 -0700

> Signed-off-by: Joe Perches <joe@perches.com>

Applied.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 11/21] drivers/net/tulip/eeprom.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 ` [PATCH 11/21] drivers/net/tulip/eeprom.c: " Joe Perches
@ 2010-06-01  7:17   ` David Miller
  0 siblings, 0 replies; 30+ messages in thread
From: David Miller @ 2010-06-01  7:17 UTC (permalink / raw)
  To: joe; +Cc: linux-kernel, grundler, kyle, netdev

From: Joe Perches <joe@perches.com>
Date: Mon, 31 May 2010 20:23:13 -0700

> Signed-off-by: Joe Perches <joe@perches.com>

Applied.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 06/21] drivers/i2c/i2c-dev.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 ` [PATCH 06/21] drivers/i2c/i2c-dev.c: " Joe Perches
@ 2010-06-01 10:57   ` Jean Delvare
  0 siblings, 0 replies; 30+ messages in thread
From: Jean Delvare @ 2010-06-01 10:57 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, Ben Dooks (embedded platforms), linux-i2c

Hi Joe,

On Mon, 31 May 2010 20:23:08 -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/i2c/i2c-dev.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
> index e0694e4..b3fcb59 100644
> --- a/drivers/i2c/i2c-dev.c
> +++ b/drivers/i2c/i2c-dev.c
> @@ -219,9 +219,7 @@ static noinline int i2cdev_ioctl_rdrw(struct i2c_client *client,
>  	if (rdwr_arg.nmsgs > I2C_RDRW_IOCTL_MAX_MSGS)
>  		return -EINVAL;
>  
> -	rdwr_pa = (struct i2c_msg *)
> -		kmalloc(rdwr_arg.nmsgs * sizeof(struct i2c_msg),
> -		GFP_KERNEL);
> +	rdwr_pa = kmalloc(rdwr_arg.nmsgs * sizeof(struct i2c_msg), GFP_KERNEL);
>  	if (!rdwr_pa)
>  		return -ENOMEM;
>  

Applied, thanks.

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 30+ messages in thread

* RE: [PATCH 04/21] drivers/block/cciss_scsi.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 ` [PATCH 04/21] drivers/block/cciss_scsi.c: " Joe Perches
@ 2010-06-01 15:26   ` Miller, Mike (OS Dev)
  0 siblings, 0 replies; 30+ messages in thread
From: Miller, Mike (OS Dev) @ 2010-06-01 15:26 UTC (permalink / raw)
  To: Joe Perches, linux-kernel@vger.kernel.org; +Cc: ISS StorageDev

 

> -----Original Message-----
> From: Joe Perches [mailto:joe@perches.com] 
> Sent: Monday, May 31, 2010 10:23 PM
> To: linux-kernel@vger.kernel.org
> Cc: Miller, Mike (OS Dev); ISS StorageDev
> Subject: [PATCH 04/21] drivers/block/cciss_scsi.c: Remove 
> unnecessary kmalloc casts
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Acked-by: Mike Miller <mike.miller@hp.com>

> ---
>  drivers/block/cciss_scsi.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/block/cciss_scsi.c 
> b/drivers/block/cciss_scsi.c index e1d0e2c..ffd8470 100644
> --- a/drivers/block/cciss_scsi.c
> +++ b/drivers/block/cciss_scsi.c
> @@ -702,8 +702,7 @@ cciss_scsi_setup(int cntl_num)
>  	struct cciss_scsi_adapter_data_t * shba;
>  
>  	ccissscsi[cntl_num].ndevices = 0;
> -	shba = (struct cciss_scsi_adapter_data_t *)
> -		kmalloc(sizeof(*shba), GFP_KERNEL);	
> +	shba = kmalloc(sizeof(*shba), GFP_KERNEL);
>  	if (shba == NULL)
>  		return;
>  	shba->scsi_host = NULL;
> --
> 1.7.0.3.311.g6a6955
> 
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 14/21] drivers/parisc/iosapic.c: Remove unnecessary kzalloc cast
  2010-06-01  3:23 ` [PATCH 14/21] drivers/parisc/iosapic.c: Remove unnecessary kzalloc cast Joe Perches
@ 2010-06-01 21:02   ` Grant Grundler
  0 siblings, 0 replies; 30+ messages in thread
From: Grant Grundler @ 2010-06-01 21:02 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel, Kyle McMartin, Helge Deller, James E.J. Bottomley,
	linux-parisc

On Mon, May 31, 2010 at 08:23:16PM -0700, Joe Perches wrote:
> Convert kzalloc to kcalloc
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Reviewed-by: Grant Grundler <grundler@parisc-linux.org>

thanks,
grant

> ---
>  drivers/parisc/iosapic.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c
> index c768367..3e6f56c 100644
> --- a/drivers/parisc/iosapic.c
> +++ b/drivers/parisc/iosapic.c
> @@ -891,8 +891,8 @@ void *iosapic_register(unsigned long hpa)
>  	isi->isi_version = iosapic_rd_version(isi);
>  	isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1;
>  
> -	vip = isi->isi_vector = (struct vector_info *)
> -		kzalloc(sizeof(struct vector_info) * isi->isi_num_vectors, GFP_KERNEL);
> +	vip = isi->isi_vector = kcalloc(isi->isi_num_vectors,
> +					sizeof(struct vector_info), GFP_KERNEL);
>  	if (vip == NULL) {
>  		kfree(isi);
>  		return NULL;
> -- 
> 1.7.0.3.311.g6a6955
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 21/21] net/sctp/protocol.c: Remove unnecessary kmalloc casts
  2010-06-01  3:23 ` [PATCH 21/21] net/sctp/protocol.c: " Joe Perches
@ 2010-06-02 17:30   ` Vlad Yasevich
  0 siblings, 0 replies; 30+ messages in thread
From: Vlad Yasevich @ 2010-06-02 17:30 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, Sridhar Samudrala, linux-sctp

ACK

-vlad

Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  net/sctp/protocol.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
> index 1827498..fef38be 100644
> --- a/net/sctp/protocol.c
> +++ b/net/sctp/protocol.c
> @@ -1216,8 +1216,7 @@ SCTP_STATIC __init int sctp_init(void)
>  
>  	/* Allocate and initialize the endpoint hash table.  */
>  	sctp_ep_hashsize = 64;
> -	sctp_ep_hashtable = (struct sctp_hashbucket *)
> -		kmalloc(64 * sizeof(struct sctp_hashbucket), GFP_KERNEL);
> +	sctp_ep_hashtable = kmalloc(64 * sizeof(struct sctp_hashbucket), GFP_KERNEL);
>  	if (!sctp_ep_hashtable) {
>  		printk(KERN_ERR "SCTP: Failed endpoint_hash alloc.\n");
>  		status = -ENOMEM;

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2010-06-02 17:40 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-01  3:23 [PATCH 00/21] Remove unnecessary kmalloc casts Joe Perches
2010-06-01  3:23 ` [PATCH 01/21] arch/cris: " Joe Perches
2010-06-01  3:23 ` [PATCH 02/21] arch/powerpc: " Joe Perches
2010-06-01  3:23 ` [PATCH 03/21] arch/x86/kernel/tlb_uv.c: " Joe Perches
2010-06-01  3:23 ` [PATCH 04/21] drivers/block/cciss_scsi.c: " Joe Perches
2010-06-01 15:26   ` Miller, Mike (OS Dev)
2010-06-01  3:23 ` [PATCH 05/21] drivers/gpu/drm: " Joe Perches
2010-06-01  3:23 ` [PATCH 06/21] drivers/i2c/i2c-dev.c: " Joe Perches
2010-06-01 10:57   ` Jean Delvare
2010-06-01  3:23 ` [PATCH 07/21] drivers/isdn/capi/capidrv.c: " Joe Perches
2010-06-01  3:23 ` [PATCH 08/21] drivers/media: Remove unnecesary " Joe Perches
2010-06-01  3:23 ` [PATCH 09/21] drivers/message/i2o/i20_config.c: Remove unnecessary " Joe Perches
2010-06-01  3:23 ` [PATCH 10/21] drivers/net/gianfar.c: " Joe Perches
2010-06-01  7:17   ` David Miller
2010-06-01  3:23 ` [PATCH 11/21] drivers/net/tulip/eeprom.c: " Joe Perches
2010-06-01  7:17   ` David Miller
2010-06-01  3:23 ` [PATCH 12/21] drivers/net/vxge/vxge-main.c: " Joe Perches
2010-06-01  3:23 ` [PATCH 13/21] drivers/net/wireless/ipw2x00/ipw2100.c: " Joe Perches
2010-06-01  3:23 ` [PATCH 14/21] drivers/parisc/iosapic.c: Remove unnecessary kzalloc cast Joe Perches
2010-06-01 21:02   ` Grant Grundler
2010-06-01  3:23 ` [PATCH 15/21] drivers/s390: Remove unnecessary kmalloc casts Joe Perches
2010-06-01  3:23 ` [PATCH 16/21] drivers/serial/icom.c: " Joe Perches
2010-06-01  3:23 ` [PATCH 17/21] drivers/usb/storage/isd200.c: " Joe Perches
2010-06-01  3:23 ` [PATCH 18/21] fs/ufs/util.c: " Joe Perches
2010-06-01  3:23 ` [PATCH 19/21] net/ipv4/igmp.c: " Joe Perches
2010-06-01  7:17   ` David Miller
2010-06-01  3:23 ` [PATCH 20/21] net/ipv6/mcast.c: " Joe Perches
2010-06-01  7:17   ` David Miller
2010-06-01  3:23 ` [PATCH 21/21] net/sctp/protocol.c: " Joe Perches
2010-06-02 17:30   ` Vlad Yasevich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).