aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-sysfs.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-04-29 01:58:46 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-20 18:15:01 -0400
commitd48593bf208e0d046c35fb0707ae5b23fef8c4ff (patch)
tree8ee1375b7c7725c11238716646266d9a6d7fbc9f /drivers/pci/pci-sysfs.c
parent8d790d74085833ba2a3e84b5bcd683be4981c29a (diff)
[PATCH] Make attributes names const char *
sysfs: make attributes and attribute_group's names const char * Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/pci-sysfs.c')
-rw-r--r--drivers/pci/pci-sysfs.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 6ca0061137a6..e8aad151175f 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -339,16 +339,17 @@ pci_create_resource_files(struct pci_dev *pdev)
339 if (!pci_resource_len(pdev, i)) 339 if (!pci_resource_len(pdev, i))
340 continue; 340 continue;
341 341
342 res_attr = kmalloc(sizeof(*res_attr) + 10, GFP_ATOMIC); 342 /* allocate attribute structure, piggyback attribute name */
343 res_attr = kcalloc(1, sizeof(*res_attr) + 10, GFP_ATOMIC);
343 if (res_attr) { 344 if (res_attr) {
344 memset(res_attr, 0, sizeof(*res_attr) + 10); 345 char *res_attr_name = (char *)(res_attr + 1);
346
345 pdev->res_attr[i] = res_attr; 347 pdev->res_attr[i] = res_attr;
346 /* Allocated above after the res_attr struct */ 348 sprintf(res_attr_name, "resource%d", i);
347 res_attr->attr.name = (char *)(res_attr + 1); 349 res_attr->attr.name = res_attr_name;
348 sprintf(res_attr->attr.name, "resource%d", i);
349 res_attr->size = pci_resource_len(pdev, i);
350 res_attr->attr.mode = S_IRUSR | S_IWUSR; 350 res_attr->attr.mode = S_IRUSR | S_IWUSR;
351 res_attr->attr.owner = THIS_MODULE; 351 res_attr->attr.owner = THIS_MODULE;
352 res_attr->size = pci_resource_len(pdev, i);
352 res_attr->mmap = pci_mmap_resource; 353 res_attr->mmap = pci_mmap_resource;
353 res_attr->private = &pdev->resource[i]; 354 res_attr->private = &pdev->resource[i];
354 sysfs_create_bin_file(&pdev->dev.kobj, res_attr); 355 sysfs_create_bin_file(&pdev->dev.kobj, res_attr);