kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [KJ] [Patch] kmemdup() cleanup in drivers/acpi/
@ 2006-10-23 20:14 Eric Sesterhenn
  2006-10-23 20:15 ` [KJ] [Patch] kmemdup() cleanup in drivers/base Eric Sesterhenn
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: Eric Sesterhenn @ 2006-10-23 20:14 UTC (permalink / raw)
  To: kernel-janitors

hi,

replace open coded kmemdup() to save some screen space,
and allow inlining/not inlining to be triggered by gcc.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.19-rc2-git7/drivers/acpi/scan.c.orig	2006-10-23 20:57:29.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/acpi/scan.c	2006-10-23 20:59:03.000000000 +0200
@@ -853,10 +853,8 @@ static void acpi_device_set_id(struct ac
 		device->flags.unique_id = 1;
 	}
 	if (cid_list) {
-		device->pnp.cid_list = kmalloc(cid_list->size, GFP_KERNEL);
-		if (device->pnp.cid_list)
-			memcpy(device->pnp.cid_list, cid_list, cid_list->size);
-		else
+		device->pnp.cid_list = kmemdup(cid_list, cid_list->size, GFP_KERNEL);
+		if (!device->pnp.cid_list)
 			printk(KERN_ERR "Memory allocation error\n");
 	}
 


_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* [KJ] [Patch] kmemdup() cleanup in drivers/base
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
@ 2006-10-23 20:15 ` Eric Sesterhenn
  2006-10-23 20:16 ` [KJ] [Patch] kmemdup() cleanup in drivers/ieee1394 Eric Sesterhenn
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Eric Sesterhenn @ 2006-10-23 20:15 UTC (permalink / raw)
  To: kernel-janitors

hi,

replace open coded kmemdup() to save some screen space,
and allow inlining/not inlining to be triggered by gcc.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.19-rc2-git7/drivers/base/platform.c.orig	2006-10-23 20:59:48.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/base/platform.c	2006-10-23 21:00:56.000000000 +0200
@@ -192,9 +192,8 @@ int platform_device_add_resources(struct
 {
 	struct resource *r;
 
-	r = kmalloc(sizeof(struct resource) * num, GFP_KERNEL);
+	r = kmemdup(res, sizeof(struct resource) * num, GFP_KERNEL);
 	if (r) {
-		memcpy(r, res, sizeof(struct resource) * num);
 		pdev->resource = r;
 		pdev->num_resources = num;
 	}
@@ -216,11 +215,10 @@ int platform_device_add_data(struct plat
 {
 	void *d;
 
-	d = kmalloc(size, GFP_KERNEL);
-	if (d) {
-		memcpy(d, data, size);
+	d = kmemdup(data, size, GFP_KERNEL);
+	if (d)
 		pdev->dev.platform_data = d;
-	}
+	
 	return d ? 0 : -ENOMEM;
 }
 EXPORT_SYMBOL_GPL(platform_device_add_data);


_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* [KJ] [Patch] kmemdup() cleanup in drivers/ieee1394
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
  2006-10-23 20:15 ` [KJ] [Patch] kmemdup() cleanup in drivers/base Eric Sesterhenn
@ 2006-10-23 20:16 ` Eric Sesterhenn
  2006-10-23 20:17 ` [KJ] [Patch] kmemdup() cleanup in drivers/infiniband Eric Sesterhenn
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Eric Sesterhenn @ 2006-10-23 20:16 UTC (permalink / raw)
  To: kernel-janitors

hi,

replace open coded kmemdup() to save some screen space,
and allow inlining/not inlining to be triggered by gcc.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.19-rc2-git7/drivers/ieee1394/nodemgr.c.orig	2006-10-23 21:04:32.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/ieee1394/nodemgr.c	2006-10-23 21:05:07.000000000 +0200
@@ -976,10 +976,9 @@ static struct unit_directory *nodemgr_pr
 			/* Logical Unit Number */
 			if (kv->key.type = CSR1212_KV_TYPE_IMMEDIATE) {
 				if (ud->flags & UNIT_DIRECTORY_HAS_LUN) {
-					ud_child = kmalloc(sizeof(*ud_child), GFP_KERNEL);
+					ud_child = kmemdup(ud, sizeof(*ud_child), GFP_KERNEL);
 					if (!ud_child)
 						goto unit_directory_error;
-					memcpy(ud_child, ud, sizeof(*ud_child));
 					nodemgr_register_device(ne, ud_child, &ne->device);
 					ud_child = NULL;
 					
--- linux-2.6.19-rc2-git7/drivers/ieee1394/pcilynx.c.orig	2006-10-23 21:05:17.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/ieee1394/pcilynx.c	2006-10-23 21:05:55.000000000 +0200
@@ -1428,10 +1428,9 @@ static int __devinit add_card(struct pci
         	struct i2c_algo_bit_data i2c_adapter_data;
 
         	error = -ENOMEM;
-		i2c_ad = kmalloc(sizeof(*i2c_ad), SLAB_KERNEL);
+		i2c_ad = kmemdup(&bit_ops, sizeof(*i2c_ad), SLAB_KERNEL);
         	if (!i2c_ad) FAIL("failed to allocate I2C adapter memory");
 
-		memcpy(i2c_ad, &bit_ops, sizeof(struct i2c_adapter));
                 i2c_adapter_data = bit_data;
                 i2c_ad->algo_data = &i2c_adapter_data;
                 i2c_adapter_data.data = lynx;


_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* [KJ] [Patch] kmemdup() cleanup in drivers/infiniband
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
  2006-10-23 20:15 ` [KJ] [Patch] kmemdup() cleanup in drivers/base Eric Sesterhenn
  2006-10-23 20:16 ` [KJ] [Patch] kmemdup() cleanup in drivers/ieee1394 Eric Sesterhenn
@ 2006-10-23 20:17 ` Eric Sesterhenn
  2006-10-23 20:18 ` [KJ] [Patch] kmemdup() cleanup in drivers/media/video Eric Sesterhenn
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Eric Sesterhenn @ 2006-10-23 20:17 UTC (permalink / raw)
  To: kernel-janitors

hi,

replace open coded kmemdup() to save some screen space,
and allow inlining/not inlining to be triggered by gcc.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.19-rc2-git7/drivers/infiniband/core/cm.c.orig	2006-10-23 21:07:38.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/infiniband/core/cm.c	2006-10-23 21:08:07.000000000 +0200
@@ -240,11 +240,10 @@ static void * cm_copy_private_data(const
 	if (!private_data || !private_data_len)
 		return NULL;
 
-	data = kmalloc(private_data_len, GFP_KERNEL);
+	data = kmemdup(private_data, private_data_len, GFP_KERNEL);
 	if (!data)
 		return ERR_PTR(-ENOMEM);
 
-	memcpy(data, private_data, private_data_len);
 	return data;
 }
 
--- linux-2.6.19-rc2-git7/drivers/infiniband/core/ucm.c.orig	2006-10-23 21:08:16.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/infiniband/core/ucm.c	2006-10-23 21:08:58.000000000 +0200
@@ -328,20 +328,18 @@ static int ib_ucm_event_process(struct i
 	}
 
 	if (uvt->data_len) {
-		uvt->data = kmalloc(uvt->data_len, GFP_KERNEL);
+		uvt->data = kmemdup(evt->private_data, uvt->data_len, GFP_KERNEL);
 		if (!uvt->data)
 			goto err1;
 
-		memcpy(uvt->data, evt->private_data, uvt->data_len);
 		uvt->resp.present |= IB_UCM_PRES_DATA;
 	}
 
 	if (uvt->info_len) {
-		uvt->info = kmalloc(uvt->info_len, GFP_KERNEL);
+		uvt->info = kmemdup(info, uvt->info_len, GFP_KERNEL);
 		if (!uvt->info)
 			goto err2;
 
-		memcpy(uvt->info, info, uvt->info_len);
 		uvt->resp.present |= IB_UCM_PRES_INFO;
 	}
 	return 0;
--- linux-2.6.19-rc2-git7/drivers/infiniband/core/iwcm.c.orig	2006-10-23 21:09:11.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/infiniband/core/iwcm.c	2006-10-23 21:09:32.000000000 +0200
@@ -140,10 +140,9 @@ static int copy_private_data(struct iwcm
 {
 	void *p;
 
-	p = kmalloc(event->private_data_len, GFP_ATOMIC);
+	p = kmemdup(event->private_data, event->private_data_len, GFP_ATOMIC);
 	if (!p)
 		return -ENOMEM;
-	memcpy(p, event->private_data, event->private_data_len);
 	event->private_data = p;
 	return 0;
 }
--- linux-2.6.19-rc2-git7/drivers/infiniband/hw/mthca/mthca_provider.c.orig	2006-10-23 21:09:57.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/infiniband/hw/mthca/mthca_provider.c	2006-10-23 21:10:28.000000000 +0200
@@ -1100,11 +1100,10 @@ static struct ib_fmr *mthca_alloc_fmr(st
 	struct mthca_fmr *fmr;
 	int err;
 
-	fmr = kmalloc(sizeof *fmr, GFP_KERNEL);
+	fmr = kmemdup(fmr_attr, sizeof *fmr, GFP_KERNEL);
 	if (!fmr)
 		return ERR_PTR(-ENOMEM);
 
-	memcpy(&fmr->attr, fmr_attr, sizeof *fmr_attr);
 	err = mthca_fmr_alloc(to_mdev(pd->device), to_mpd(pd)->pd_num,
 			     convert_access(mr_access_flags), fmr);
 


_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* [KJ] [Patch] kmemdup() cleanup in drivers/media/video
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (2 preceding siblings ...)
  2006-10-23 20:17 ` [KJ] [Patch] kmemdup() cleanup in drivers/infiniband Eric Sesterhenn
@ 2006-10-23 20:18 ` Eric Sesterhenn
  2006-10-23 20:19 ` [KJ] [Patch] kmemdup() cleanup in drivers/message Eric Sesterhenn
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Eric Sesterhenn @ 2006-10-23 20:18 UTC (permalink / raw)
  To: kernel-janitors

hi,

replace open coded kmemdup() to save some screen space,
and allow inlining/not inlining to be triggered by gcc.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.19-rc2-git7/drivers/media/video/ovcamchip/ovcamchip_core.c.orig	2006-10-23 21:13:43.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/media/video/ovcamchip/ovcamchip_core.c	2006-10-23 21:14:04.000000000 +0200
@@ -307,12 +307,11 @@ static int ovcamchip_attach(struct i2c_a
 		return -ENODEV;
 	}
 
-	c = kmalloc(sizeof *c, GFP_KERNEL);
+	c = kmemdup(&client_template, sizeof *c, GFP_KERNEL);
 	if (!c) {
 		rc = -ENOMEM;
 		goto no_client;
 	}
-	memcpy(c, &client_template, sizeof *c);
 	c->adapter = adap;
 	strcpy(c->name, "OV????");
 
--- linux-2.6.19-rc2-git7/drivers/media/video/pvrusb2/pvrusb2-io.c.orig	2006-10-23 21:15:34.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/media/video/pvrusb2/pvrusb2-io.c	2006-10-23 21:16:17.000000000 +0200
@@ -351,9 +351,8 @@ static int pvr2_stream_buffer_count(stru
 		if (scnt < sp->buffer_slot_count) {
 			struct pvr2_buffer **nb = NULL;
 			if (scnt) {
-				nb = kmalloc(scnt * sizeof(*nb),GFP_KERNEL);
+				nb = kmemdup(sp->buffers, scnt * sizeof(*nb),GFP_KERNEL);
 				if (!nb) return -ENOMEM;
-				memcpy(nb,sp->buffers,scnt * sizeof(*nb));
 			}
 			kfree(sp->buffers);
 			sp->buffers = nb;
--- linux-2.6.19-rc2-git7/drivers/media/video/saa5246a.c.orig	2006-10-23 21:16:46.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/media/video/saa5246a.c	2006-10-23 21:17:19.000000000 +0200
@@ -80,12 +80,11 @@ static int saa5246a_attach(struct i2c_ad
 	struct saa5246a_device *t;
 
 	printk(KERN_INFO "saa5246a: teletext chip found.\n");
-	client=kmalloc(sizeof(*client), GFP_KERNEL);
+	client=kmemdup(&client_template, sizeof(*client), GFP_KERNEL);
 	if(client=NULL)
 		return -ENOMEM;
 	client_template.adapter = adap;
 	client_template.addr = addr;
-	memcpy(client, &client_template, sizeof(*client));
 	t = kzalloc(sizeof(*t), GFP_KERNEL);
 	if(t=NULL)
 	{
--- linux-2.6.19-rc2-git7/drivers/media/video/tuner-3036.c.orig	2006-10-23 21:18:30.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/media/video/tuner-3036.c	2006-10-23 21:18:44.000000000 +0200
@@ -121,10 +121,9 @@ tuner_attach(struct i2c_adapter *adap, i
 	client_template.adapter = adap;
 	client_template.addr = addr;
 
-	client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
+	client = kmemdup(&client_template, sizeof(struct i2c_client), GFP_KERNEL);
 	if (client = NULL)
 		return -ENOMEM;
-	memcpy(client, &client_template, sizeof(struct i2c_client));
 
 	printk("tuner: SAB3036 found, status %02x\n", tuner_getstatus(client));
 
--- linux-2.6.19-rc2-git7/drivers/media/video/tvp5150.c.orig	2006-10-23 21:19:27.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/media/video/tvp5150.c	2006-10-23 21:19:43.000000000 +0200
@@ -1066,10 +1066,9 @@ static int tvp5150_detect_client(struct 
 	     I2C_FUNC_SMBUS_READ_BYTE | I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
 		return 0;
 
-	c = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
+	c = kmemdup(&client_template, sizeof(struct i2c_client), GFP_KERNEL);
 	if (c = 0)
 		return -ENOMEM;
-	memcpy(c, &client_template, sizeof(struct i2c_client));
 
 	core = kzalloc(sizeof(struct tvp5150), GFP_KERNEL);
 	if (core = 0) {


_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* [KJ] [Patch] kmemdup() cleanup in drivers/message
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (3 preceding siblings ...)
  2006-10-23 20:18 ` [KJ] [Patch] kmemdup() cleanup in drivers/media/video Eric Sesterhenn
@ 2006-10-23 20:19 ` Eric Sesterhenn
  2006-10-23 20:20 ` [KJ] [Patch] kmemdup() cleanup in drivers/net Eric Sesterhenn
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Eric Sesterhenn @ 2006-10-23 20:19 UTC (permalink / raw)
  To: kernel-janitors

hi,

replace open coded kmemdup() to save some screen space,
and allow inlining/not inlining to be triggered by gcc.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.19-rc2-git7/drivers/message/fusion/mptbase.c.orig	2006-10-23 21:22:37.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/message/fusion/mptbase.c	2006-10-23 21:23:14.000000000 +0200
@@ -4846,9 +4846,8 @@ mpt_read_ioc_pg_3(MPT_ADAPTER *ioc)
 	cfg.physAddr = ioc3_dma;
 	cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
 	if (mpt_config(ioc, &cfg) = 0) {
-		mem = kmalloc(iocpage3sz, GFP_ATOMIC);
+		mem = kmemdup((u8 *) pIoc3, iocpage3sz, GFP_ATOMIC);
 		if (mem) {
-			memcpy(mem, (u8 *)pIoc3, iocpage3sz);
 			ioc->raid_data.pIocPg3 = (IOCPage3_t *) mem;
 		}
 	}


_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* [KJ] [Patch] kmemdup() cleanup in drivers/net
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (4 preceding siblings ...)
  2006-10-23 20:19 ` [KJ] [Patch] kmemdup() cleanup in drivers/message Eric Sesterhenn
@ 2006-10-23 20:20 ` Eric Sesterhenn
  2006-10-23 20:21 ` [KJ] [Patch] kmemdup() cleanup in drivers/parport Eric Sesterhenn
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Eric Sesterhenn @ 2006-10-23 20:20 UTC (permalink / raw)
  To: kernel-janitors

hi,

replace open coded kmemdup() to save some screen space,
and allow inlining/not inlining to be triggered by gcc.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.19-rc2-git7/drivers/net/tulip/de2104x.c.orig	2006-10-23 21:24:42.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/net/tulip/de2104x.c	2006-10-23 21:25:08.000000000 +0200
@@ -1906,9 +1906,7 @@ fill_defaults:
 			de->media[i].csr15 = t21041_csr15[i];
 	}
 
-	de->ee_data = kmalloc(DE_EEPROM_SIZE, GFP_KERNEL);
-	if (de->ee_data)
-		memcpy(de->ee_data, &ee_data[0], DE_EEPROM_SIZE);
+	de->ee_data = kmemdup(&ee_data[0], DE_EEPROM_SIZE, GFP_KERNEL);
 
 	return;
 
--- linux-2.6.19-rc2-git7/drivers/net/wireless/ipw2100.c.orig	2006-10-23 21:26:26.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/net/wireless/ipw2100.c	2006-10-23 21:27:14.000000000 +0200
@@ -7568,11 +7568,10 @@ static int ipw2100_wx_set_genie(struct n
 		return -EINVAL;
 
 	if (wrqu->data.length) {
-		buf = kmalloc(wrqu->data.length, GFP_KERNEL);
+		buf = kmemdup(extra, wrqu->data.length, GFP_KERNEL);
 		if (buf = NULL)
 			return -ENOMEM;
 
-		memcpy(buf, extra, wrqu->data.length);
 		kfree(ieee->wpa_ie);
 		ieee->wpa_ie = buf;
 		ieee->wpa_ie_len = wrqu->data.length;


_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* [KJ] [Patch] kmemdup() cleanup in drivers/parport
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (5 preceding siblings ...)
  2006-10-23 20:20 ` [KJ] [Patch] kmemdup() cleanup in drivers/net Eric Sesterhenn
@ 2006-10-23 20:21 ` Eric Sesterhenn
  2006-10-23 20:22 ` [KJ] [Patch] kmemdup() cleanup in drivers/pci/ Eric Sesterhenn
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Eric Sesterhenn @ 2006-10-23 20:21 UTC (permalink / raw)
  To: kernel-janitors

hi,

replace open coded kmemdup() to save some screen space,
and allow inlining/not inlining to be triggered by gcc.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.19-rc2-git7/drivers/parport/parport_sunbpp.c.orig	2006-10-23 21:28:36.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/parport/parport_sunbpp.c	2006-10-23 21:28:54.000000000 +0200
@@ -309,12 +309,10 @@ static int __devinit init_one_port(struc
 	size = sdev->reg_addrs[0].reg_size;
 	dma = PARPORT_DMA_NONE;
 
-	ops = kmalloc(sizeof(struct parport_operations), GFP_KERNEL);
+	ops = kmemdup(&parport_sunbpp_ops, sizeof(struct parport_operations), GFP_KERNEL);
         if (!ops)
 		goto out_unmap;
 
-        memcpy (ops, &parport_sunbpp_ops, sizeof (struct parport_operations));
-
 	dprintk(("register_port\n"));
 	if (!(p = parport_register_port((unsigned long)base, irq, dma, ops)))
 		goto out_free_ops;
--- linux-2.6.19-rc2-git7/drivers/parport/procfs.c.orig	2006-10-23 21:29:06.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/parport/procfs.c	2006-10-23 21:29:40.000000000 +0200
@@ -381,10 +381,9 @@ int parport_proc_register(struct parport
 	struct parport_sysctl_table *t;
 	int i;
 
-	t = kmalloc(sizeof(*t), GFP_KERNEL);
+	t = kmemdup(&parport_sysctl_template, sizeof(*t), GFP_KERNEL);
 	if (t = NULL)
 		return -ENOMEM;
-	memcpy(t, &parport_sysctl_template, sizeof(*t));
 
 	t->device_dir[0].extra1 = port;
 
@@ -429,10 +428,9 @@ int parport_device_proc_register(struct 
 	struct parport_device_sysctl_table *t;
 	struct parport * port = device->port;
 	
-	t = kmalloc(sizeof(*t), GFP_KERNEL);
+	t = kmemdup(&parport_device_sysctl_template, sizeof(*t), GFP_KERNEL);
 	if (t = NULL)
 		return -ENOMEM;
-	memcpy(t, &parport_device_sysctl_template, sizeof(*t));
 
 	t->dev_dir[0].child = t->parport_dir;
 	t->parport_dir[0].child = t->port_dir;


_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* [KJ] [Patch] kmemdup() cleanup in drivers/pci/
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (6 preceding siblings ...)
  2006-10-23 20:21 ` [KJ] [Patch] kmemdup() cleanup in drivers/parport Eric Sesterhenn
@ 2006-10-23 20:22 ` Eric Sesterhenn
  2006-10-23 20:42 ` [KJ] [Patch] kmemdup() cleanup in drivers/message Matthew Wilcox
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Eric Sesterhenn @ 2006-10-23 20:22 UTC (permalink / raw)
  To: kernel-janitors

hi,

replace open coded kmemdup() to save some screen space,
and allow inlining/not inlining to be triggered by gcc.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.19-rc2-git7/drivers/pci/hotplug/acpiphp_ibm.c.orig	2006-10-23 21:30:51.000000000 +0200
+++ linux-2.6.19-rc2-git7/drivers/pci/hotplug/acpiphp_ibm.c	2006-10-23 21:31:31.000000000 +0200
@@ -160,10 +160,8 @@ static union apci_descriptor *ibm_slot_f
 		ret = des;
 
 ibm_slot_done:
-	if (ret) {
-		ret = kmalloc(sizeof(union apci_descriptor), GFP_KERNEL);
-		memcpy(ret, des, sizeof(union apci_descriptor));
-	}
+	if (ret)
+		ret = kmemdup(des, sizeof(union apci_descriptor), GFP_KERNEL);
 	kfree(table);
 	return ret;
 }


_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [Patch] kmemdup() cleanup in drivers/message
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (7 preceding siblings ...)
  2006-10-23 20:22 ` [KJ] [Patch] kmemdup() cleanup in drivers/pci/ Eric Sesterhenn
@ 2006-10-23 20:42 ` Matthew Wilcox
  2006-10-24  3:05 ` [KJ] [Patch] kmemdup() cleanup in drivers/infiniband Roland Dreier
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Matthew Wilcox @ 2006-10-23 20:42 UTC (permalink / raw)
  To: kernel-janitors

On Mon, Oct 23, 2006 at 10:19:10PM +0200, Eric Sesterhenn wrote:
>  	if (mpt_config(ioc, &cfg) = 0) {
> -		mem = kmalloc(iocpage3sz, GFP_ATOMIC);
> +		mem = kmemdup((u8 *) pIoc3, iocpage3sz, GFP_ATOMIC);
>  		if (mem) {
> -			memcpy(mem, (u8 *)pIoc3, iocpage3sz);
>  			ioc->raid_data.pIocPg3 = (IOCPage3_t *) mem;

I don't think the cast is really needed
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [Patch] kmemdup() cleanup in drivers/infiniband
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (8 preceding siblings ...)
  2006-10-23 20:42 ` [KJ] [Patch] kmemdup() cleanup in drivers/message Matthew Wilcox
@ 2006-10-24  3:05 ` Roland Dreier
  2006-10-24  8:26 ` [KJ] [Patch] kmemdup() cleanup in drivers/pci/ Alexey Dobriyan
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Roland Dreier @ 2006-10-24  3:05 UTC (permalink / raw)
  To: kernel-janitors

Looks good to me.  I will queue this for 2.6.20, thanks.

 - R.
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [Patch] kmemdup() cleanup in drivers/pci/
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (9 preceding siblings ...)
  2006-10-24  3:05 ` [KJ] [Patch] kmemdup() cleanup in drivers/infiniband Roland Dreier
@ 2006-10-24  8:26 ` Alexey Dobriyan
  2006-10-24 14:53 ` Eric Sesterhenn / Snakebyte
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Alexey Dobriyan @ 2006-10-24  8:26 UTC (permalink / raw)
  To: kernel-janitors

On Mon, Oct 23, 2006 at 10:22:57PM +0200, Eric Sesterhenn wrote:
> replace open coded kmemdup() to save some screen space,
> and allow inlining/not inlining to be triggered by gcc.

Patches are OK, btw what inlining/non inlining you are referring too?

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [Patch] kmemdup() cleanup in drivers/pci/
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (10 preceding siblings ...)
  2006-10-24  8:26 ` [KJ] [Patch] kmemdup() cleanup in drivers/pci/ Alexey Dobriyan
@ 2006-10-24 14:53 ` Eric Sesterhenn / Snakebyte
  2006-10-24 16:36 ` walter harms
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Eric Sesterhenn / Snakebyte @ 2006-10-24 14:53 UTC (permalink / raw)
  To: kernel-janitors

* Alexey Dobriyan (adobriyan@gmail.com) wrote:
> On Mon, Oct 23, 2006 at 10:22:57PM +0200, Eric Sesterhenn wrote:
> > replace open coded kmemdup() to save some screen space,
> > and allow inlining/not inlining to be triggered by gcc.
> 
> Patches are OK, btw what inlining/non inlining you are referring too?

the -O3 -Os compiler flags, where gcc might make the inlining
decission accordingly.

Greetings, Eric

-- 
 www.cobra-basket.de -- just my stuff
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [Patch] kmemdup() cleanup in drivers/pci/
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (11 preceding siblings ...)
  2006-10-24 14:53 ` Eric Sesterhenn / Snakebyte
@ 2006-10-24 16:36 ` walter harms
  2006-10-24 17:51 ` Alexey Dobriyan
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: walter harms @ 2006-10-24 16:36 UTC (permalink / raw)
  To: kernel-janitors

Hi eric,
to add some cream you may like to use (i did not check the types):
ret = kmemdup(des, sizeof(*des), GFP_KERNEL);
that make it independet of the type.

re,
 wh


Eric Sesterhenn wrote:
> hi,
> 
> replace open coded kmemdup() to save some screen space,
> and allow inlining/not inlining to be triggered by gcc.
> 
> Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
> 
> --- linux-2.6.19-rc2-git7/drivers/pci/hotplug/acpiphp_ibm.c.orig	2006-10-23 21:30:51.000000000 +0200
> +++ linux-2.6.19-rc2-git7/drivers/pci/hotplug/acpiphp_ibm.c	2006-10-23 21:31:31.000000000 +0200
> @@ -160,10 +160,8 @@ static union apci_descriptor *ibm_slot_f
>  		ret = des;
>  
>  ibm_slot_done:
> -	if (ret) {
> -		ret = kmalloc(sizeof(union apci_descriptor), GFP_KERNEL);
> -		memcpy(ret, des, sizeof(union apci_descriptor));
> -	}
> +	if (ret)
> +		ret = kmemdup(des, sizeof(union apci_descriptor), GFP_KERNEL);
>  	kfree(table);
>  	return ret;
>  }
> 
> 
> _______________________________________________
> Kernel-janitors mailing list
> Kernel-janitors@lists.osdl.org
> https://lists.osdl.org/mailman/listinfo/kernel-janitors
> 
> 
> 
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [Patch] kmemdup() cleanup in drivers/pci/
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (12 preceding siblings ...)
  2006-10-24 16:36 ` walter harms
@ 2006-10-24 17:51 ` Alexey Dobriyan
  2006-10-24 18:09 ` Matthew Wilcox
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Alexey Dobriyan @ 2006-10-24 17:51 UTC (permalink / raw)
  To: kernel-janitors

On Tue, Oct 24, 2006 at 06:36:35PM +0200, walter harms wrote:
> to add some cream you may like to use (i did not check the types):
> ret = kmemdup(des, sizeof(*des), GFP_KERNEL);
> that make it independet of the type.

When this was last discussed on l-k, it was shown that some prefer

	sizeof(*p)

some
	sizeof(struct foo)

so patches to make one style dominant are not welcome.

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [Patch] kmemdup() cleanup in drivers/pci/
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (13 preceding siblings ...)
  2006-10-24 17:51 ` Alexey Dobriyan
@ 2006-10-24 18:09 ` Matthew Wilcox
  2006-10-26 19:04 ` [KJ] [Patch] kmemdup() cleanup in drivers/scsi Eric Sesterhenn
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Matthew Wilcox @ 2006-10-24 18:09 UTC (permalink / raw)
  To: kernel-janitors

On Tue, Oct 24, 2006 at 09:51:23PM +0400, Alexey Dobriyan wrote:
> On Tue, Oct 24, 2006 at 06:36:35PM +0200, walter harms wrote:
> > to add some cream you may like to use (i did not check the types):
> > ret = kmemdup(des, sizeof(*des), GFP_KERNEL);
> > that make it independet of the type.
> 
> When this was last discussed on l-k, it was shown that some prefer
> 
> 	sizeof(*p)
> 
> some
> 	sizeof(struct foo)
> 
> so patches to make one style dominant are not welcome.

Chapter 14 of CodingStyle says those other people are wrong.
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* [KJ] [Patch] kmemdup() cleanup in drivers/scsi
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (14 preceding siblings ...)
  2006-10-24 18:09 ` Matthew Wilcox
@ 2006-10-26 19:04 ` Eric Sesterhenn
  2006-10-26 19:07 ` [KJ] [Patch] kmemdup() cleanup in drivers/video/ Eric Sesterhenn
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Eric Sesterhenn @ 2006-10-26 19:04 UTC (permalink / raw)
  To: kernel-janitors

hi,

replace open coded kmemdup() to save some screen space,
and allow inlining/not inlining to be triggered by gcc.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.19-rc3-git1/drivers/scsi/megaraid.c.orig	2006-10-26 19:03:16.000000000 +0200
+++ linux-2.6.19-rc3-git1/drivers/scsi/megaraid.c	2006-10-26 19:04:30.000000000 +0200
@@ -2087,12 +2087,10 @@ megaraid_abort_and_reset(adapter_t *adap
 static inline int
 make_local_pdev(adapter_t *adapter, struct pci_dev **pdev)
 {
-	*pdev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL);
+	*pdev = kmemdup(adapter->dev, sizeof(struct pci_dev), GFP_KERNEL);
 
 	if( *pdev = NULL ) return -1;
 
-	memcpy(*pdev, adapter->dev, sizeof(struct pci_dev));
-
 	if( pci_set_dma_mask(*pdev, DMA_32BIT_MASK) != 0 ) {
 		kfree(*pdev);
 		return -1;


_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* [KJ] [Patch] kmemdup() cleanup in drivers/video/
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (15 preceding siblings ...)
  2006-10-26 19:04 ` [KJ] [Patch] kmemdup() cleanup in drivers/scsi Eric Sesterhenn
@ 2006-10-26 19:07 ` Eric Sesterhenn
  2006-10-29 19:00 ` [KJ] [Patch] kmemdup() cleanup in drivers/media/video Alexey Dobriyan
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: Eric Sesterhenn @ 2006-10-26 19:07 UTC (permalink / raw)
  To: kernel-janitors

hi,

replace open coded kmemdup() to save some screen space,
and allow inlining/not inlining to be triggered by gcc.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.19-rc3-git1/drivers/video/aty/radeon_monitor.c.orig	2006-10-26 20:02:44.000000000 +0200
+++ linux-2.6.19-rc3-git1/drivers/video/aty/radeon_monitor.c	2006-10-26 20:03:05.000000000 +0200
@@ -104,10 +104,9 @@ static int __devinit radeon_parse_montyp
 	if (pedid = NULL)
 		return mt;
 
-	tmp = (u8 *)kmalloc(EDID_LENGTH, GFP_KERNEL);
+	tmp = kmemdup(pedid, EDID_LENGTH, GFP_KERNEL);
 	if (!tmp)
 		return mt;
-	memcpy(tmp, pedid, EDID_LENGTH);
 	*out_EDID = tmp;
 	return mt;
 }
--- linux-2.6.19-rc3-git1/drivers/video/i810/i810-i2c.c.orig	2006-10-26 20:03:36.000000000 +0200
+++ linux-2.6.19-rc3-git1/drivers/video/i810/i810-i2c.c	2006-10-26 20:03:55.000000000 +0200
@@ -162,9 +162,7 @@ int i810_probe_i2c_connector(struct fb_i
 
 		if (e != NULL) {
 			DPRINTK("i810-i2c: Getting EDID from BIOS\n");
-			edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
-			if (edid)
-				memcpy(edid, e, EDID_LENGTH);
+			edid = kmemdup(e, EDID_LENGTH, GFP_KERNEL);
 		}
 	}
 
--- linux-2.6.19-rc3-git1/drivers/video/intelfb/intelfbdrv.c.orig	2006-10-26 20:04:22.000000000 +0200
+++ linux-2.6.19-rc3-git1/drivers/video/intelfb/intelfbdrv.c	2006-10-26 20:04:47.000000000 +0200
@@ -1058,10 +1058,9 @@ intelfb_init_var(struct intelfb_info *di
 		u8 *edid_d = NULL;
 
 		if (edid_s) {
-			edid_d = kmalloc(EDID_LENGTH, GFP_KERNEL);
+			edid_d = kmemdup(edid_s, EDID_LENGTH, GFP_KERNEL);
 
 			if (edid_d) {
-				memcpy(edid_d, edid_s, EDID_LENGTH);
 				fb_edid_to_monspecs(edid_d,
 						    &dinfo->info->monspecs);
 				kfree(edid_d);
--- linux-2.6.19-rc3-git1/drivers/video/nvidia/nv_i2c.c.orig	2006-10-26 20:05:17.000000000 +0200
+++ linux-2.6.19-rc3-git1/drivers/video/nvidia/nv_i2c.c	2006-10-26 20:05:30.000000000 +0200
@@ -210,11 +210,8 @@ int nvidia_probe_i2c_connector(struct fb
 		/* try to get from firmware */
 		const u8 *e = fb_firmware_edid(info->device);
 
-		if (e != NULL) {
-			edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
-			if (edid)
-				memcpy(edid, e, EDID_LENGTH);
-		}
+		if (e != NULL)
+			edid = kmemdup(e, EDID_LENGTH, GFP_KERNEL);
 	}
 
 	*out_edid = edid;
--- linux-2.6.19-rc3-git1/drivers/video/nvidia/nv_of.c.orig	2006-10-26 20:05:55.000000000 +0200
+++ linux-2.6.19-rc3-git1/drivers/video/nvidia/nv_of.c	2006-10-26 20:06:16.000000000 +0200
@@ -72,10 +72,9 @@ int nvidia_probe_of_connector(struct fb_
 		}
 	}
 	if (pedid) {
-		*out_edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
+		*out_edid = kmemdup(pedid, EDID_LENGTH, GFP_KERNEL);
 		if (*out_edid = NULL)
 			return -1;
-		memcpy(*out_edid, pedid, EDID_LENGTH);
 		printk(KERN_DEBUG "nvidiafb: Found OF EDID for head %d\n", conn);
 		return 0;
 	}
--- linux-2.6.19-rc3-git1/drivers/video/savage/savagefb-i2c.c.orig	2006-10-26 20:06:53.000000000 +0200
+++ linux-2.6.19-rc3-git1/drivers/video/savage/savagefb-i2c.c	2006-10-26 20:07:13.000000000 +0200
@@ -227,11 +227,8 @@ int savagefb_probe_i2c_connector(struct 
 		/* try to get from firmware */
 		const u8 *e = fb_firmware_edid(info->device);
 
-		if (e) {
-			edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
-			if (edid)
-				memcpy(edid, e, EDID_LENGTH);
-		}
+		if (e)
+			edid = kmemdup(e, EDID_LENGTH, GFP_KERNEL);
 	}
 
 	*out_edid = edid;


_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [Patch] kmemdup() cleanup in drivers/media/video
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (16 preceding siblings ...)
  2006-10-26 19:07 ` [KJ] [Patch] kmemdup() cleanup in drivers/video/ Eric Sesterhenn
@ 2006-10-29 19:00 ` Alexey Dobriyan
  2006-10-29 19:02 ` [KJ] [Patch] kmemdup() cleanup in drivers/message Alexey Dobriyan
  2006-11-06  8:13 ` [KJ] [Patch] kmemdup() cleanup in drivers/net Jeff Garzik
  19 siblings, 0 replies; 21+ messages in thread
From: Alexey Dobriyan @ 2006-10-29 19:00 UTC (permalink / raw)
  To: kernel-janitors

On Mon, Oct 23, 2006 at 10:18:23PM +0200, Eric Sesterhenn wrote:
> --- linux-2.6.19-rc2-git7/drivers/media/video/saa5246a.c.orig
> +++ linux-2.6.19-rc2-git7/drivers/media/video/saa5246a.c
> @@ -80,12 +80,11 @@ static int saa5246a_attach(struct i2c_ad
>  	struct saa5246a_device *t;
>
>  	printk(KERN_INFO "saa5246a: teletext chip found.\n");
> -	client=kmalloc(sizeof(*client), GFP_KERNEL);
> +	client=kmemdup(&client_template, sizeof(*client), GFP_KERNEL);
>  	if(client=NULL)
>  		return -ENOMEM;
>  	client_template.adapter = adap;
>  	client_template.addr = addr;
> -	memcpy(client, &client_template, sizeof(*client));

I've dropped this chunk. Transformation is not identical. OTOH, some
other driver does assignments before kmalloc().

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [Patch] kmemdup() cleanup in drivers/message
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (17 preceding siblings ...)
  2006-10-29 19:00 ` [KJ] [Patch] kmemdup() cleanup in drivers/media/video Alexey Dobriyan
@ 2006-10-29 19:02 ` Alexey Dobriyan
  2006-11-06  8:13 ` [KJ] [Patch] kmemdup() cleanup in drivers/net Jeff Garzik
  19 siblings, 0 replies; 21+ messages in thread
From: Alexey Dobriyan @ 2006-10-29 19:02 UTC (permalink / raw)
  To: kernel-janitors

On Mon, Oct 23, 2006 at 02:42:37PM -0600, Matthew Wilcox wrote:
> On Mon, Oct 23, 2006 at 10:19:10PM +0200, Eric Sesterhenn wrote:
> >  	if (mpt_config(ioc, &cfg) = 0) {
> > -		mem = kmalloc(iocpage3sz, GFP_ATOMIC);
> > +		mem = kmemdup((u8 *) pIoc3, iocpage3sz, GFP_ATOMIC);
> >  		if (mem) {
> > -			memcpy(mem, (u8 *)pIoc3, iocpage3sz);
> >  			ioc->raid_data.pIocPg3 = (IOCPage3_t *) mem;
>
> I don't think the cast is really needed

Agree. {} also became unneeded. Fixed locally.

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [Patch] kmemdup() cleanup in drivers/net
  2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
                   ` (18 preceding siblings ...)
  2006-10-29 19:02 ` [KJ] [Patch] kmemdup() cleanup in drivers/message Alexey Dobriyan
@ 2006-11-06  8:13 ` Jeff Garzik
  19 siblings, 0 replies; 21+ messages in thread
From: Jeff Garzik @ 2006-11-06  8:13 UTC (permalink / raw)
  To: kernel-janitors

Eric Sesterhenn wrote:
> hi,
> 
> replace open coded kmemdup() to save some screen space,
> and allow inlining/not inlining to be triggered by gcc.
> 
> Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
> 
> --- linux-2.6.19-rc2-git7/drivers/net/tulip/de2104x.c.orig	2006-10-23 21:24:42.000000000 +0200
> +++ linux-2.6.19-rc2-git7/drivers/net/tulip/de2104x.c	2006-10-23 21:25:08.000000000 +0200

> --- linux-2.6.19-rc2-git7/drivers/net/wireless/ipw2100.c.orig	2006-10-23 21:26:26.000000000 +0200
> +++ linux-2.6.19-rc2-git7/drivers/net/wireless/ipw2100.c	2006-10-23 21:27:14.000000000 +0200


applied

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2006-11-06  8:13 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-23 20:14 [KJ] [Patch] kmemdup() cleanup in drivers/acpi/ Eric Sesterhenn
2006-10-23 20:15 ` [KJ] [Patch] kmemdup() cleanup in drivers/base Eric Sesterhenn
2006-10-23 20:16 ` [KJ] [Patch] kmemdup() cleanup in drivers/ieee1394 Eric Sesterhenn
2006-10-23 20:17 ` [KJ] [Patch] kmemdup() cleanup in drivers/infiniband Eric Sesterhenn
2006-10-23 20:18 ` [KJ] [Patch] kmemdup() cleanup in drivers/media/video Eric Sesterhenn
2006-10-23 20:19 ` [KJ] [Patch] kmemdup() cleanup in drivers/message Eric Sesterhenn
2006-10-23 20:20 ` [KJ] [Patch] kmemdup() cleanup in drivers/net Eric Sesterhenn
2006-10-23 20:21 ` [KJ] [Patch] kmemdup() cleanup in drivers/parport Eric Sesterhenn
2006-10-23 20:22 ` [KJ] [Patch] kmemdup() cleanup in drivers/pci/ Eric Sesterhenn
2006-10-23 20:42 ` [KJ] [Patch] kmemdup() cleanup in drivers/message Matthew Wilcox
2006-10-24  3:05 ` [KJ] [Patch] kmemdup() cleanup in drivers/infiniband Roland Dreier
2006-10-24  8:26 ` [KJ] [Patch] kmemdup() cleanup in drivers/pci/ Alexey Dobriyan
2006-10-24 14:53 ` Eric Sesterhenn / Snakebyte
2006-10-24 16:36 ` walter harms
2006-10-24 17:51 ` Alexey Dobriyan
2006-10-24 18:09 ` Matthew Wilcox
2006-10-26 19:04 ` [KJ] [Patch] kmemdup() cleanup in drivers/scsi Eric Sesterhenn
2006-10-26 19:07 ` [KJ] [Patch] kmemdup() cleanup in drivers/video/ Eric Sesterhenn
2006-10-29 19:00 ` [KJ] [Patch] kmemdup() cleanup in drivers/media/video Alexey Dobriyan
2006-10-29 19:02 ` [KJ] [Patch] kmemdup() cleanup in drivers/message Alexey Dobriyan
2006-11-06  8:13 ` [KJ] [Patch] kmemdup() cleanup in drivers/net Jeff Garzik

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).