[zaptel-commits] russell: branch group/vldtmf r1295 - /team/group/vldtmf/zaptel.c

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Sun Aug 13 13:58:53 MST 2006


Author: russell
Date: Sun Aug 13 15:58:52 2006
New Revision: 1295

URL: http://svn.digium.com/view/zaptel?rev=1295&view=rev
Log:
minor optimization to copy the entire dtmf tones list in one call to memcpy
instead of one for each tone

Modified:
    team/group/vldtmf/zaptel.c

Modified: team/group/vldtmf/zaptel.c
URL: http://svn.digium.com/view/zaptel/team/group/vldtmf/zaptel.c?rev=1295&r1=1294&r2=1295&view=diff
==============================================================================
--- team/group/vldtmf/zaptel.c (original)
+++ team/group/vldtmf/zaptel.c Sun Aug 13 15:58:52 2006
@@ -6921,14 +6921,14 @@
 #endif /* CONFIG_DEVFS_FS */
 
 	if (!(dtmf_tones_continuous = kmalloc(sizeof(dtmf_tones), GFP_KERNEL))) {
-		printk(KERN_ERR "Unable to allocate memory for continuous DTMF tones list!\n");
+		printk(KERN_ERR "Zaptel: THERE IS A CRISIS IN THE BATCAVE!"
+			" Unable to allocate memory for continuous DTMF tones list!\n");
 		return -ENOMEM;
 	}
 
-	for (i = 0; i < (sizeof(dtmf_tones) / sizeof(dtmf_tones[0])); i++) {
-		memcpy(dtmf_tones_continuous + i, dtmf_tones + i, sizeof(dtmf_tones_continuous[i]));
+	memcpy(dtmf_tones_continuous, dtmf_tones, sizeof(dtmf_tones));
+	for (i = 0; i < (sizeof(dtmf_tones) / sizeof(dtmf_tones[0])); i++)
 		dtmf_tones_continuous[i].next = dtmf_tones_continuous + i;
-	}
 
 	printk(KERN_INFO "Zapata Telephony Interface Registered on major %d\n", ZT_MAJOR);
 	printk(KERN_INFO "Zaptel Version: %s Echo Canceller: %s\n", ZAPTEL_VERSION,



More information about the zaptel-commits mailing list