[svn-commits] sruffell: linux/trunk r9585 - in /linux/trunk/drivers/dahdi: ./ wcb4xxp/ wct4...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Mon Jan 3 18:26:33 UTC 2011
Author: sruffell
Date: Mon Jan 3 12:26:29 2011
New Revision: 9585
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9585
Log:
'dahdi_copy_string()' -> 'strlcpy()'
There is already a safe string copying function in all the kernels DAHDI
currently supports.
Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Acked-by: Kinsey Moore <kmoore at digium.com>
Modified:
linux/trunk/drivers/dahdi/dahdi-base.c
linux/trunk/drivers/dahdi/dahdi_dummy.c
linux/trunk/drivers/dahdi/dahdi_dynamic.c
linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c
linux/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c
linux/trunk/drivers/dahdi/dahdi_transcode.c
linux/trunk/drivers/dahdi/tor2.c
linux/trunk/drivers/dahdi/wcb4xxp/base.c
linux/trunk/drivers/dahdi/wcfxo.c
linux/trunk/drivers/dahdi/wct1xxp.c
linux/trunk/drivers/dahdi/wct4xxp/base.c
linux/trunk/drivers/dahdi/wctdm.c
linux/trunk/drivers/dahdi/wcte11xp.c
Modified: linux/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=9585&r1=9584&r2=9585
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Mon Jan 3 12:26:29 2011
@@ -3038,7 +3038,7 @@
ptr = (char *) ptr + sizeof(*z);
space -= sizeof(*z);
- dahdi_copy_string(z->name, work->th.name, sizeof(z->name));
+ strlcpy(z->name, work->th.name, sizeof(z->name));
for (x = 0; x < DAHDI_MAX_CADENCE; x++)
z->ringcadence[x] = work->th.ringcadence[x];
@@ -3855,7 +3855,7 @@
param.pulsebreaktime = chan->pulsebreaktime;
param.pulseaftertime = chan->pulseaftertime;
param.spanno = (chan->span) ? chan->span->spanno : 0;
- dahdi_copy_string(param.name, chan->name, sizeof(param.name));
+ strlcpy(param.name, chan->name, sizeof(param.name));
param.chanpos = chan->chanpos;
param.sigcap = chan->sigcap;
/* Return current law */
@@ -3943,8 +3943,8 @@
spaninfo.spanno = s->spanno; /* put the span # in here */
spaninfo.totalspans = span_count();
- dahdi_copy_string(spaninfo.desc, s->desc, sizeof(spaninfo.desc));
- dahdi_copy_string(spaninfo.name, s->name, sizeof(spaninfo.name));
+ strlcpy(spaninfo.desc, s->desc, sizeof(spaninfo.desc));
+ strlcpy(spaninfo.name, s->name, sizeof(spaninfo.name));
spaninfo.alarms = s->alarms; /* get alarm status */
spaninfo.rxlevel = s->rxlevel; /* get rx level */
spaninfo.txlevel = s->txlevel; /* get tx level */
@@ -3971,20 +3971,20 @@
spaninfo.lineconfig = s->lineconfig;
spaninfo.irq = s->irq;
spaninfo.linecompat = s->linecompat;
- dahdi_copy_string(spaninfo.lboname, dahdi_lboname(s->lbo),
+ strlcpy(spaninfo.lboname, dahdi_lboname(s->lbo),
sizeof(spaninfo.lboname));
if (s->manufacturer) {
- dahdi_copy_string(spaninfo.manufacturer, s->manufacturer,
+ strlcpy(spaninfo.manufacturer, s->manufacturer,
sizeof(spaninfo.manufacturer));
}
if (s->devicetype) {
- dahdi_copy_string(spaninfo.devicetype, s->devicetype,
+ strlcpy(spaninfo.devicetype, s->devicetype,
sizeof(spaninfo.devicetype));
}
- dahdi_copy_string(spaninfo.location, s->location,
+ strlcpy(spaninfo.location, s->location,
sizeof(spaninfo.location));
if (s->spantype) {
- dahdi_copy_string(spaninfo.spantype, s->spantype,
+ strlcpy(spaninfo.spantype, s->spantype,
sizeof(spaninfo.spantype));
}
@@ -4031,10 +4031,10 @@
spaninfo_v1.spanno = s->spanno; /* put the span # in here */
spaninfo_v1.totalspans = 0;
spaninfo_v1.totalspans = span_count();
- dahdi_copy_string(spaninfo_v1.desc,
+ strlcpy(spaninfo_v1.desc,
s->desc,
sizeof(spaninfo_v1.desc));
- dahdi_copy_string(spaninfo_v1.name,
+ strlcpy(spaninfo_v1.name,
s->name,
sizeof(spaninfo_v1.name));
spaninfo_v1.alarms = s->alarms;
@@ -4056,28 +4056,28 @@
spaninfo_v1.lineconfig = s->lineconfig;
spaninfo_v1.irq = s->irq;
spaninfo_v1.linecompat = s->linecompat;
- dahdi_copy_string(spaninfo_v1.lboname,
+ strlcpy(spaninfo_v1.lboname,
dahdi_lboname(s->lbo),
sizeof(spaninfo_v1.lboname));
if (s->manufacturer) {
- dahdi_copy_string(spaninfo_v1.manufacturer,
+ strlcpy(spaninfo_v1.manufacturer,
s->manufacturer,
sizeof(spaninfo_v1.manufacturer));
}
if (s->devicetype) {
- dahdi_copy_string(spaninfo_v1.devicetype,
+ strlcpy(spaninfo_v1.devicetype,
s->devicetype,
sizeof(spaninfo_v1.devicetype));
}
- dahdi_copy_string(spaninfo_v1.location,
+ strlcpy(spaninfo_v1.location,
s->location,
sizeof(spaninfo_v1.location));
if (s->spantype) {
- dahdi_copy_string(spaninfo_v1.spantype,
+ strlcpy(spaninfo_v1.spantype,
s->spantype,
sizeof(spaninfo_v1.spantype));
}
@@ -4644,7 +4644,7 @@
size_t space = sizeof(vi.echo_canceller) - 1;
memset(&vi, 0, sizeof(vi));
- dahdi_copy_string(vi.version, DAHDI_VERSION, sizeof(vi.version));
+ strlcpy(vi.version, DAHDI_VERSION, sizeof(vi.version));
read_lock(&ecfactory_list_lock);
list_for_each_entry(cur, &ecfactory_list, list) {
strncat(vi.echo_canceller + strlen(vi.echo_canceller),
@@ -4818,7 +4818,8 @@
rv = -EBUSY;
break;
}
- dahdi_copy_string(chan->txdialbuf + strlen(chan->txdialbuf), tdo->dialstr, DAHDI_MAX_DTMF_BUF - strlen(chan->txdialbuf));
+ strlcpy(chan->txdialbuf + strlen(chan->txdialbuf), tdo->dialstr,
+ DAHDI_MAX_DTMF_BUF - strlen(chan->txdialbuf));
if (!chan->dialing) {
chan->dialing = 1;
__do_dtmf(chan);
Modified: linux/trunk/drivers/dahdi/dahdi_dummy.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_dummy.c?view=diff&rev=9585&r1=9584&r2=9585
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_dummy.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_dummy.c Mon Jan 3 12:26:29 2011
@@ -210,7 +210,8 @@
sprintf(ztd->span.name, "DAHDI_DUMMY/1");
snprintf(ztd->span.desc, sizeof(ztd->span.desc) - 1, "%s (source: " CLOCK_SRC ") %d", ztd->span.name, 1);
sprintf(ztd->chan->name, "DAHDI_DUMMY/%d/%d", 1, 0);
- dahdi_copy_string(ztd->span.devicetype, "DAHDI Dummy Timing", sizeof(ztd->span.devicetype));
+ strlcpy(ztd->span.devicetype, "DAHDI Dummy Timing",
+ sizeof(ztd->span.devicetype));
ztd->chan->chanpos = 1;
ztd->span.chans = &ztd->chan;
ztd->span.channels = 0; /* no channels on our span */
Modified: linux/trunk/drivers/dahdi/dahdi_dynamic.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_dynamic.c?view=diff&rev=9585&r1=9584&r2=9585
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_dynamic.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_dynamic.c Mon Jan 3 12:26:29 2011
@@ -604,8 +604,8 @@
}
/* Setup parameters properly assuming we're going to be okay. */
- dahdi_copy_string(d->dname, dds->driver, sizeof(d->dname));
- dahdi_copy_string(d->addr, dds->addr, sizeof(d->addr));
+ strlcpy(d->dname, dds->driver, sizeof(d->dname));
+ strlcpy(d->addr, dds->addr, sizeof(d->addr));
d->timing = dds->timing;
sprintf(d->span.name, "DYN/%s/%s", dds->driver, dds->addr);
sprintf(d->span.desc, "Dynamic '%s' span at '%s'",
Modified: linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c?view=diff&rev=9585&r1=9584&r2=9585
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c Mon Jan 3 12:26:29 2011
@@ -306,12 +306,12 @@
memset(z, 0, sizeof(struct ztdeth));
/* Address should be <dev>/<macaddr>[/subaddr] */
- dahdi_copy_string(tmp, addr, sizeof(tmp));
+ strlcpy(tmp, addr, sizeof(tmp));
tmp2 = strchr(tmp, '/');
if (tmp2) {
*tmp2 = '\0';
tmp2++;
- dahdi_copy_string(z->ethdev, tmp, sizeof(z->ethdev));
+ strlcpy(z->ethdev, tmp, sizeof(z->ethdev));
} else {
printk(KERN_NOTICE "Invalid TDMoE address (no device) '%s'\n", addr);
kfree(z);
Modified: linux/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c?view=diff&rev=9585&r1=9584&r2=9585
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c Mon Jan 3 12:26:29 2011
@@ -609,7 +609,7 @@
z->rcvbuf = kmalloc(bufsize, GFP_KERNEL);
/* Address should be <dev>/<macaddr>/subaddr */
- dahdi_copy_string(src, addr, sizeof(src));
+ strlcpy(src, addr, sizeof(src));
/* replace all / with space; otherwise kernel sscanf does not work */
src_ptr = src;
while (*src_ptr) {
Modified: linux/trunk/drivers/dahdi/dahdi_transcode.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_transcode.c?view=diff&rev=9585&r1=9584&r2=9585
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_transcode.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_transcode.c Mon Jan 3 12:26:29 2011
@@ -328,7 +328,7 @@
return -ENOSYS;
}
- dahdi_copy_string(info.name, tc->name, sizeof(info.name));
+ strlcpy(info.name, tc->name, sizeof(info.name));
info.numchannels = tc->numchannels;
info.srcfmts = tc->srcfmts;
info.dstfmts = tc->dstfmts;
Modified: linux/trunk/drivers/dahdi/tor2.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/tor2.c?view=diff&rev=9585&r1=9584&r2=9585
==============================================================================
--- linux/trunk/drivers/dahdi/tor2.c (original)
+++ linux/trunk/drivers/dahdi/tor2.c Mon Jan 3 12:26:29 2011
@@ -284,7 +284,7 @@
"Tormenta 2 (PCI) Quad %s Card %d Span %d",
(tor->cardtype == TYPE_T1) ? "T1" : "E1", tor->num, x + 1);
s->manufacturer = "Digium";
- dahdi_copy_string(s->devicetype, tor->type, sizeof(s->devicetype));
+ strlcpy(s->devicetype, tor->type, sizeof(s->devicetype));
snprintf(s->location, sizeof(s->location) - 1,
"PCI Bus %02d Slot %02d", tor->pci->bus->number, PCI_SLOT(tor->pci->devfn) + 1);
if (tor->cardtype == TYPE_T1) {
Modified: linux/trunk/drivers/dahdi/wcb4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcb4xxp/base.c?view=diff&rev=9585&r1=9584&r2=9585
==============================================================================
--- linux/trunk/drivers/dahdi/wcb4xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcb4xxp/base.c Mon Jan 3 12:26:29 2011
@@ -2492,7 +2492,8 @@
sprintf(bspan->span.name, "B4/%d/%d", b4->cardno, i+1);
sprintf(bspan->span.desc, "B4XXP (PCI) Card %d Span %d", b4->cardno, i+1);
bspan->span.manufacturer = "Digium";
- dahdi_copy_string(bspan->span.devicetype, b4->variety, sizeof(bspan->span.devicetype));
+ strlcpy(bspan->span.devicetype, b4->variety,
+ sizeof(bspan->span.devicetype));
sprintf(bspan->span.location, "PCI Bus %02d Slot %02d",
b4->pdev->bus->number, PCI_SLOT(b4->pdev->devfn) + 1);
Modified: linux/trunk/drivers/dahdi/wcfxo.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcfxo.c?view=diff&rev=9585&r1=9584&r2=9585
==============================================================================
--- linux/trunk/drivers/dahdi/wcfxo.c (original)
+++ linux/trunk/drivers/dahdi/wcfxo.c Mon Jan 3 12:26:29 2011
@@ -654,7 +654,7 @@
snprintf(wc->span.location, sizeof(wc->span.location) - 1,
"PCI Bus %02d Slot %02d", wc->dev->bus->number, PCI_SLOT(wc->dev->devfn) + 1);
wc->span.manufacturer = "Digium";
- dahdi_copy_string(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype));
+ strlcpy(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype));
wc->chan->sigcap = DAHDI_SIG_FXSKS | DAHDI_SIG_FXSLS | DAHDI_SIG_SF;
wc->chan->chanpos = 1;
wc->span.chans = &wc->chan;
Modified: linux/trunk/drivers/dahdi/wct1xxp.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wct1xxp.c?view=diff&rev=9585&r1=9584&r2=9585
==============================================================================
--- linux/trunk/drivers/dahdi/wct1xxp.c (original)
+++ linux/trunk/drivers/dahdi/wct1xxp.c Mon Jan 3 12:26:29 2011
@@ -771,7 +771,7 @@
sprintf(wc->span.name, "WCT1/%d", wc->num);
snprintf(wc->span.desc, sizeof(wc->span.desc) - 1, "%s Card %d", wc->variety, wc->num);
wc->span.manufacturer = "Digium";
- dahdi_copy_string(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype));
+ strlcpy(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype));
snprintf(wc->span.location, sizeof(wc->span.location) - 1,
"PCI Bus %02d Slot %02d", wc->dev->bus->number, PCI_SLOT(wc->dev->devfn) + 1);
wc->span.irq = wc->dev->irq;
Modified: linux/trunk/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wct4xxp/base.c?view=diff&rev=9585&r1=9584&r2=9585
==============================================================================
--- linux/trunk/drivers/dahdi/wct4xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wct4xxp/base.c Mon Jan 3 12:26:29 2011
@@ -2016,7 +2016,8 @@
for (x = 0; x < wc->numspans; x++) {
ts = wc->tspans[x];
- dahdi_copy_string(ts->span.devicetype, wc->variety, sizeof(ts->span.devicetype));
+ strlcpy(ts->span.devicetype, wc->variety,
+ sizeof(ts->span.devicetype));
if (wc->vpm == T4_VPM_PRESENT) {
if (!wc->vpm450m)
strncat(ts->span.devicetype, " (VPM400M)", sizeof(ts->span.devicetype) - 1);
Modified: linux/trunk/drivers/dahdi/wctdm.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wctdm.c?view=diff&rev=9585&r1=9584&r2=9585
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm.c (original)
+++ linux/trunk/drivers/dahdi/wctdm.c Mon Jan 3 12:26:29 2011
@@ -2370,7 +2370,7 @@
snprintf(wc->span.location, sizeof(wc->span.location) - 1,
"PCI Bus %02d Slot %02d", wc->dev->bus->number, PCI_SLOT(wc->dev->devfn) + 1);
wc->span.manufacturer = "Digium";
- dahdi_copy_string(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype));
+ strlcpy(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype));
if (alawoverride) {
printk(KERN_INFO "ALAW override parameter detected. Device will be operating in ALAW\n");
wc->span.deflaw = DAHDI_LAW_ALAW;
Modified: linux/trunk/drivers/dahdi/wcte11xp.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcte11xp.c?view=diff&rev=9585&r1=9584&r2=9585
==============================================================================
--- linux/trunk/drivers/dahdi/wcte11xp.c (original)
+++ linux/trunk/drivers/dahdi/wcte11xp.c Mon Jan 3 12:26:29 2011
@@ -978,7 +978,7 @@
sprintf(wc->span.name, "WCT1/%d", wc->num);
snprintf(wc->span.desc, sizeof(wc->span.desc) - 1, "%s Card %d", wc->variety, wc->num);
wc->span.manufacturer = "Digium";
- dahdi_copy_string(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype));
+ strlcpy(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype));
snprintf(wc->span.location, sizeof(wc->span.location) - 1,
"PCI Bus %02d Slot %02d", wc->dev->bus->number, PCI_SLOT(wc->dev->devfn) + 1);
wc->span.irq = wc->dev->irq;
More information about the svn-commits
mailing list