diff options
author | Jean Delvare <khali@linux-fr.org> | 2009-01-07 08:29:18 -0500 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2009-01-07 08:29:18 -0500 |
commit | 66c7acf61dc6b27954bb9ceb8617d447ac03734a (patch) | |
tree | 181d26436a00e62e9fc52df1b38740eaa23730d6 /drivers/i2c/busses | |
parent | 1561bfe59ca011d9a749dad4d96c2c22ebc86a4a (diff) |
i2c: Use snprintf to set adapter names
Use snprintf instead of sprintf to set adapter names, it's safer.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r-- | drivers/i2c/busses/i2c-ali1563.c | 4 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-amd756-s4882.c | 4 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-amd756.c | 5 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-at91.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-sis5595.c | 4 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-sis630.c | 4 |
6 files changed, 12 insertions, 11 deletions
diff --git a/drivers/i2c/busses/i2c-ali1563.c b/drivers/i2c/busses/i2c-ali1563.c index fc3e5b026423..dd9e796fad69 100644 --- a/drivers/i2c/busses/i2c-ali1563.c +++ b/drivers/i2c/busses/i2c-ali1563.c | |||
@@ -399,8 +399,8 @@ static int __devinit ali1563_probe(struct pci_dev * dev, | |||
399 | if ((error = ali1563_setup(dev))) | 399 | if ((error = ali1563_setup(dev))) |
400 | goto exit; | 400 | goto exit; |
401 | ali1563_adapter.dev.parent = &dev->dev; | 401 | ali1563_adapter.dev.parent = &dev->dev; |
402 | sprintf(ali1563_adapter.name,"SMBus ALi 1563 Adapter @ %04x", | 402 | snprintf(ali1563_adapter.name, sizeof(ali1563_adapter.name), |
403 | ali1563_smba); | 403 | "SMBus ALi 1563 Adapter @ %04x", ali1563_smba); |
404 | if ((error = i2c_add_adapter(&ali1563_adapter))) | 404 | if ((error = i2c_add_adapter(&ali1563_adapter))) |
405 | goto exit_shutdown; | 405 | goto exit_shutdown; |
406 | return 0; | 406 | return 0; |
diff --git a/drivers/i2c/busses/i2c-amd756-s4882.c b/drivers/i2c/busses/i2c-amd756-s4882.c index 8ba2bcf727d3..378fcb5d5783 100644 --- a/drivers/i2c/busses/i2c-amd756-s4882.c +++ b/drivers/i2c/busses/i2c-amd756-s4882.c | |||
@@ -197,8 +197,8 @@ static int __init amd756_s4882_init(void) | |||
197 | for (i = 1; i < 5; i++) { | 197 | for (i = 1; i < 5; i++) { |
198 | s4882_algo[i] = *(amd756_smbus.algo); | 198 | s4882_algo[i] = *(amd756_smbus.algo); |
199 | s4882_adapter[i] = amd756_smbus; | 199 | s4882_adapter[i] = amd756_smbus; |
200 | sprintf(s4882_adapter[i].name, | 200 | snprintf(s4882_adapter[i].name, sizeof(s4882_adapter[i].name), |
201 | "SMBus 8111 adapter (CPU%d)", i-1); | 201 | "SMBus 8111 adapter (CPU%d)", i-1); |
202 | s4882_adapter[i].algo = s4882_algo+i; | 202 | s4882_adapter[i].algo = s4882_algo+i; |
203 | s4882_adapter[i].dev.parent = amd756_smbus.dev.parent; | 203 | s4882_adapter[i].dev.parent = amd756_smbus.dev.parent; |
204 | } | 204 | } |
diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c index 424dad6f18d8..36bee5b9c952 100644 --- a/drivers/i2c/busses/i2c-amd756.c +++ b/drivers/i2c/busses/i2c-amd756.c | |||
@@ -380,8 +380,9 @@ static int __devinit amd756_probe(struct pci_dev *pdev, | |||
380 | /* set up the sysfs linkage to our parent device */ | 380 | /* set up the sysfs linkage to our parent device */ |
381 | amd756_smbus.dev.parent = &pdev->dev; | 381 | amd756_smbus.dev.parent = &pdev->dev; |
382 | 382 | ||
383 | sprintf(amd756_smbus.name, "SMBus %s adapter at %04x", | 383 | snprintf(amd756_smbus.name, sizeof(amd756_smbus.name), |
384 | chipname[id->driver_data], amd756_ioport); | 384 | "SMBus %s adapter at %04x", chipname[id->driver_data], |
385 | amd756_ioport); | ||
385 | 386 | ||
386 | error = i2c_add_adapter(&amd756_smbus); | 387 | error = i2c_add_adapter(&amd756_smbus); |
387 | if (error) { | 388 | if (error) { |
diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c index 9efb02137254..67d9dc5b351b 100644 --- a/drivers/i2c/busses/i2c-at91.c +++ b/drivers/i2c/busses/i2c-at91.c | |||
@@ -222,7 +222,7 @@ static int __devinit at91_i2c_probe(struct platform_device *pdev) | |||
222 | rc = -ENOMEM; | 222 | rc = -ENOMEM; |
223 | goto fail2; | 223 | goto fail2; |
224 | } | 224 | } |
225 | sprintf(adapter->name, "AT91"); | 225 | snprintf(adapter->name, sizeof(adapter->name), "AT91"); |
226 | adapter->algo = &at91_algorithm; | 226 | adapter->algo = &at91_algorithm; |
227 | adapter->class = I2C_CLASS_HWMON; | 227 | adapter->class = I2C_CLASS_HWMON; |
228 | adapter->dev.parent = &pdev->dev; | 228 | adapter->dev.parent = &pdev->dev; |
diff --git a/drivers/i2c/busses/i2c-sis5595.c b/drivers/i2c/busses/i2c-sis5595.c index dfc2d5eb6a68..8ce2daff985c 100644 --- a/drivers/i2c/busses/i2c-sis5595.c +++ b/drivers/i2c/busses/i2c-sis5595.c | |||
@@ -389,8 +389,8 @@ static int __devinit sis5595_probe(struct pci_dev *dev, const struct pci_device_ | |||
389 | /* set up the sysfs linkage to our parent device */ | 389 | /* set up the sysfs linkage to our parent device */ |
390 | sis5595_adapter.dev.parent = &dev->dev; | 390 | sis5595_adapter.dev.parent = &dev->dev; |
391 | 391 | ||
392 | sprintf(sis5595_adapter.name, "SMBus SIS5595 adapter at %04x", | 392 | snprintf(sis5595_adapter.name, sizeof(sis5595_adapter.name), |
393 | sis5595_base + SMB_INDEX); | 393 | "SMBus SIS5595 adapter at %04x", sis5595_base + SMB_INDEX); |
394 | err = i2c_add_adapter(&sis5595_adapter); | 394 | err = i2c_add_adapter(&sis5595_adapter); |
395 | if (err) { | 395 | if (err) { |
396 | release_region(sis5595_base + SMB_INDEX, 2); | 396 | release_region(sis5595_base + SMB_INDEX, 2); |
diff --git a/drivers/i2c/busses/i2c-sis630.c b/drivers/i2c/busses/i2c-sis630.c index e7c4b790da54..9c9c016ff2b5 100644 --- a/drivers/i2c/busses/i2c-sis630.c +++ b/drivers/i2c/busses/i2c-sis630.c | |||
@@ -487,8 +487,8 @@ static int __devinit sis630_probe(struct pci_dev *dev, const struct pci_device_i | |||
487 | /* set up the sysfs linkage to our parent device */ | 487 | /* set up the sysfs linkage to our parent device */ |
488 | sis630_adapter.dev.parent = &dev->dev; | 488 | sis630_adapter.dev.parent = &dev->dev; |
489 | 489 | ||
490 | sprintf(sis630_adapter.name, "SMBus SIS630 adapter at %04x", | 490 | snprintf(sis630_adapter.name, sizeof(sis630_adapter.name), |
491 | acpi_base + SMB_STS); | 491 | "SMBus SIS630 adapter at %04x", acpi_base + SMB_STS); |
492 | 492 | ||
493 | return i2c_add_adapter(&sis630_adapter); | 493 | return i2c_add_adapter(&sis630_adapter); |
494 | } | 494 | } |