Skip to content

Commit 48bc886

Browse files
Jiri Slaby (SUSE)bp3tk0v
authored andcommitted
EDAC: Remove dynamic attributes from edac_device_alloc_ctl_info()
Dynamic attributes are not passed from any caller of edac_device_alloc_ctl_info(). Drop this unused/untested functionality completely. Signed-off-by: Jiri Slaby (SUSE) <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Borislav Petkov (AMD) <[email protected]>
1 parent 9186695 commit 48bc886

15 files changed

+20
-79
lines changed

drivers/edac/altera_edac.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,7 @@ static int altr_edac_device_probe(struct platform_device *pdev)
737737
}
738738

739739
dci = edac_device_alloc_ctl_info(sizeof(*drvdata), ecc_name,
740-
1, ecc_name, 1, 0, NULL, 0,
741-
dev_instance++);
740+
1, ecc_name, 1, 0, dev_instance++);
742741

743742
if (!dci) {
744743
edac_printk(KERN_ERR, EDAC_DEVICE,
@@ -1514,7 +1513,7 @@ static int altr_portb_setup(struct altr_edac_device_dev *device)
15141513
/* Create the PortB EDAC device */
15151514
edac_idx = edac_device_alloc_index();
15161515
dci = edac_device_alloc_ctl_info(sizeof(*altdev), ecc_name, 1,
1517-
ecc_name, 1, 0, NULL, 0, edac_idx);
1516+
ecc_name, 1, 0, edac_idx);
15181517
if (!dci) {
15191518
edac_printk(KERN_ERR, EDAC_DEVICE,
15201519
"%s: Unable to allocate PortB EDAC device\n",
@@ -1921,8 +1920,7 @@ static int altr_edac_a10_device_add(struct altr_arria10_edac *edac,
19211920

19221921
edac_idx = edac_device_alloc_index();
19231922
dci = edac_device_alloc_ctl_info(sizeof(*altdev), ecc_name,
1924-
1, ecc_name, 1, 0, NULL, 0,
1925-
edac_idx);
1923+
1, ecc_name, 1, 0, edac_idx);
19261924

19271925
if (!dci) {
19281926
edac_printk(KERN_ERR, EDAC_DEVICE,

drivers/edac/amd8111_edac.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,7 @@ static int amd8111_dev_probe(struct pci_dev *dev,
366366
dev_info->edac_idx = edac_device_alloc_index();
367367
dev_info->edac_dev =
368368
edac_device_alloc_ctl_info(0, dev_info->ctl_name, 1,
369-
NULL, 0, 0,
370-
NULL, 0, dev_info->edac_idx);
369+
NULL, 0, 0, dev_info->edac_idx);
371370
if (!dev_info->edac_dev) {
372371
ret = -ENOMEM;
373372
goto err_dev_put;

drivers/edac/armada_xp_edac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ static int aurora_l2_probe(struct platform_device *pdev)
523523
dev_warn(&pdev->dev, "data ECC is not enabled\n");
524524

525525
dci = edac_device_alloc_ctl_info(sizeof(*drvdata),
526-
"cpu", 1, "L", 1, 2, NULL, 0, 0);
526+
"cpu", 1, "L", 1, 2, 0);
527527
if (!dci)
528528
return -ENOMEM;
529529

drivers/edac/cpc925_edac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ static void cpc925_add_edac_devices(void __iomem *vbase)
797797
dev_info->edac_idx = edac_device_alloc_index();
798798
dev_info->edac_dev =
799799
edac_device_alloc_ctl_info(0, dev_info->ctl_name,
800-
1, NULL, 0, 0, NULL, 0, dev_info->edac_idx);
800+
1, NULL, 0, 0, dev_info->edac_idx);
801801
if (!dev_info->edac_dev) {
802802
cpc925_printk(KERN_ERR, "No memory for edac device\n");
803803
goto err1;

drivers/edac/edac_device.c

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,12 @@ static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev)
5656
struct edac_device_ctl_info *
5757
edac_device_alloc_ctl_info(unsigned pvt_sz, char *dev_name, unsigned nr_instances,
5858
char *blk_name, unsigned nr_blocks, unsigned off_val,
59-
struct edac_dev_sysfs_block_attribute *attrib_spec,
60-
unsigned nr_attrib, int device_index)
59+
int device_index)
6160
{
62-
struct edac_dev_sysfs_block_attribute *dev_attrib, *attrib_p, *attrib;
6361
struct edac_device_block *dev_blk, *blk_p, *blk;
6462
struct edac_device_instance *dev_inst, *inst;
6563
struct edac_device_ctl_info *dev_ctl;
66-
unsigned instance, block, attr;
64+
unsigned instance, block;
6765
void *pvt;
6866
int err;
6967

@@ -85,15 +83,6 @@ edac_device_alloc_ctl_info(unsigned pvt_sz, char *dev_name, unsigned nr_instance
8583

8684
dev_ctl->blocks = dev_blk;
8785

88-
if (nr_attrib) {
89-
dev_attrib = kcalloc(nr_attrib, sizeof(struct edac_dev_sysfs_block_attribute),
90-
GFP_KERNEL);
91-
if (!dev_attrib)
92-
goto free;
93-
94-
dev_ctl->attribs = dev_attrib;
95-
}
96-
9786
if (pvt_sz) {
9887
pvt = kzalloc(pvt_sz, GFP_KERNEL);
9988
if (!pvt)
@@ -132,41 +121,6 @@ edac_device_alloc_ctl_info(unsigned pvt_sz, char *dev_name, unsigned nr_instance
132121

133122
edac_dbg(4, "instance=%d inst_p=%p block=#%d block_p=%p name='%s'\n",
134123
instance, inst, block, blk, blk->name);
135-
136-
/* if there are NO attributes OR no attribute pointer
137-
* then continue on to next block iteration
138-
*/
139-
if ((nr_attrib == 0) || (attrib_spec == NULL))
140-
continue;
141-
142-
/* setup the attribute array for this block */
143-
blk->nr_attribs = nr_attrib;
144-
attrib_p = &dev_attrib[block*nr_instances*nr_attrib];
145-
blk->block_attributes = attrib_p;
146-
147-
edac_dbg(4, "THIS BLOCK_ATTRIB=%p\n",
148-
blk->block_attributes);
149-
150-
/* Initialize every user specified attribute in this
151-
* block with the data the caller passed in
152-
* Each block gets its own copy of pointers,
153-
* and its unique 'value'
154-
*/
155-
for (attr = 0; attr < nr_attrib; attr++) {
156-
attrib = &attrib_p[attr];
157-
158-
/* populate the unique per attrib
159-
* with the code pointers and info
160-
*/
161-
attrib->attr = attrib_spec[attr].attr;
162-
attrib->show = attrib_spec[attr].show;
163-
164-
edac_dbg(4, "alloc-attrib=%p attrib_name='%s' attrib-spec=%p spec-name=%s\n",
165-
attrib, attrib->attr.name,
166-
&attrib_spec[attr],
167-
attrib_spec[attr].attr.name
168-
);
169-
}
170124
}
171125
}
172126

drivers/edac/edac_device.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ struct edac_device_ctl_info {
208208
u32 nr_instances;
209209
struct edac_device_instance *instances;
210210
struct edac_device_block *blocks;
211-
struct edac_dev_sysfs_block_attribute *attribs;
212211

213212
/* Event counters for the this whole EDAC Device */
214213
struct edac_device_counter counters;
@@ -236,8 +235,6 @@ extern struct edac_device_ctl_info *edac_device_alloc_ctl_info(
236235
char *edac_device_name, unsigned nr_instances,
237236
char *edac_block_name, unsigned nr_blocks,
238237
unsigned offset_value,
239-
struct edac_dev_sysfs_block_attribute *block_attributes,
240-
unsigned nr_attribs,
241238
int device_index);
242239

243240
/* The offset value can be:
@@ -347,7 +344,6 @@ static inline void __edac_device_free_ctl_info(struct edac_device_ctl_info *ci)
347344
{
348345
if (ci) {
349346
kfree(ci->pvt_info);
350-
kfree(ci->attribs);
351347
kfree(ci->blocks);
352348
kfree(ci->instances);
353349
kfree(ci);

drivers/edac/highbank_l2_edac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static int highbank_l2_err_probe(struct platform_device *pdev)
5454
int res = 0;
5555

5656
dci = edac_device_alloc_ctl_info(sizeof(*drvdata), "cpu",
57-
1, "L", 1, 2, NULL, 0, 0);
57+
1, "L", 1, 2, 0);
5858
if (!dci)
5959
return -ENOMEM;
6060

drivers/edac/mpc85xx_edac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ static int mpc85xx_l2_err_probe(struct platform_device *op)
496496
return -ENOMEM;
497497

498498
edac_dev = edac_device_alloc_ctl_info(sizeof(*pdata),
499-
"cpu", 1, "L", 1, 2, NULL, 0,
499+
"cpu", 1, "L", 1, 2,
500500
edac_dev_idx);
501501
if (!edac_dev) {
502502
devres_release_group(&op->dev, mpc85xx_l2_err_probe);

drivers/edac/octeon_edac-l2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static int octeon_l2c_probe(struct platform_device *pdev)
138138

139139
/* 'Tags' are block 0, 'Data' is block 1*/
140140
l2c = edac_device_alloc_ctl_info(0, "l2c", num_tads, "l2c", 2, 0,
141-
NULL, 0, edac_device_alloc_index());
141+
edac_device_alloc_index());
142142
if (!l2c)
143143
return -ENOMEM;
144144

drivers/edac/octeon_edac-pc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static int co_cache_error_probe(struct platform_device *pdev)
9292
platform_set_drvdata(pdev, p);
9393

9494
p->ed = edac_device_alloc_ctl_info(0, "cpu", num_possible_cpus(),
95-
"cache", 2, 0, NULL, 0,
95+
"cache", 2, 0,
9696
edac_device_alloc_index());
9797
if (!p->ed)
9898
goto err;

0 commit comments

Comments
 (0)