Skip to content

Commit e5cb966

Browse files
osctobedavem330
authored andcommitted
net: fix section mismatches
Fix build warnings like the following: WARNING: drivers/net/built-in.o(.data+0x12434): Section mismatch in reference from the variable madgemc_driver to the variable .init.data:madgemc_adapter_ids And add some consts to EISA device ID tables along the way. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2b7b431 commit e5cb966

File tree

10 files changed

+72
-68
lines changed

10 files changed

+72
-68
lines changed

drivers/net/3c509.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static int max_interrupt_work = 10;
185185
static int nopnp;
186186
#endif
187187

188-
static int __devinit el3_common_init(struct net_device *dev);
188+
static int el3_common_init(struct net_device *dev);
189189
static void el3_common_remove(struct net_device *dev);
190190
static ushort id_read_eeprom(int index);
191191
static ushort read_eeprom(int ioaddr, int index);
@@ -395,7 +395,7 @@ static struct isa_driver el3_isa_driver = {
395395
static int isa_registered;
396396

397397
#ifdef CONFIG_PNP
398-
static struct pnp_device_id el3_pnp_ids[] = {
398+
static const struct pnp_device_id el3_pnp_ids[] __devinitconst = {
399399
{ .id = "TCM5090" }, /* 3Com Etherlink III (TP) */
400400
{ .id = "TCM5091" }, /* 3Com Etherlink III */
401401
{ .id = "TCM5094" }, /* 3Com Etherlink III (combo) */
@@ -478,7 +478,7 @@ static int pnp_registered;
478478
#endif /* CONFIG_PNP */
479479

480480
#ifdef CONFIG_EISA
481-
static struct eisa_device_id el3_eisa_ids[] = {
481+
static const struct eisa_device_id el3_eisa_ids[] __devinitconst = {
482482
{ "TCM5090" },
483483
{ "TCM5091" },
484484
{ "TCM5092" },
@@ -508,7 +508,7 @@ static int eisa_registered;
508508
#ifdef CONFIG_MCA
509509
static int el3_mca_probe(struct device *dev);
510510

511-
static short el3_mca_adapter_ids[] __initdata = {
511+
static const short el3_mca_adapter_ids[] __devinitconst = {
512512
0x627c,
513513
0x627d,
514514
0x62db,
@@ -517,7 +517,7 @@ static short el3_mca_adapter_ids[] __initdata = {
517517
0x0000
518518
};
519519

520-
static char *el3_mca_adapter_names[] __initdata = {
520+
static const char *const el3_mca_adapter_names[] __devinitconst = {
521521
"3Com 3c529 EtherLink III (10base2)",
522522
"3Com 3c529 EtherLink III (10baseT)",
523523
"3Com 3c529 EtherLink III (test mode)",
@@ -601,7 +601,7 @@ static void el3_common_remove (struct net_device *dev)
601601
}
602602

603603
#ifdef CONFIG_MCA
604-
static int __init el3_mca_probe(struct device *device)
604+
static int __devinit el3_mca_probe(struct device *device)
605605
{
606606
/* Based on Erik Nygren's (nygren@mit.edu) 3c529 patch,
607607
* heavily modified by Chris Beauregard
@@ -671,7 +671,7 @@ static int __init el3_mca_probe(struct device *device)
671671
#endif /* CONFIG_MCA */
672672

673673
#ifdef CONFIG_EISA
674-
static int __init el3_eisa_probe (struct device *device)
674+
static int __devinit el3_eisa_probe (struct device *device)
675675
{
676676
short i;
677677
int ioaddr, irq, if_port;

drivers/net/3c59x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,14 +901,14 @@ static const struct dev_pm_ops vortex_pm_ops = {
901901
#endif /* !CONFIG_PM */
902902

903903
#ifdef CONFIG_EISA
904-
static struct eisa_device_id vortex_eisa_ids[] = {
904+
static const struct eisa_device_id vortex_eisa_ids[] __devinitconst = {
905905
{ "TCM5920", CH_3C592 },
906906
{ "TCM5970", CH_3C597 },
907907
{ "" }
908908
};
909909
MODULE_DEVICE_TABLE(eisa, vortex_eisa_ids);
910910

911-
static int __init vortex_eisa_probe(struct device *device)
911+
static int __devinit vortex_eisa_probe(struct device *device)
912912
{
913913
void __iomem *ioaddr;
914914
struct eisa_device *edev;

drivers/net/depca.c

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -331,18 +331,18 @@ static struct {
331331
"DE422",\
332332
""}
333333

334-
static char* __initdata depca_signature[] = DEPCA_SIGNATURE;
334+
static const char* const depca_signature[] __devinitconst = DEPCA_SIGNATURE;
335335

336336
enum depca_type {
337337
DEPCA, de100, de101, de200, de201, de202, de210, de212, de422, unknown
338338
};
339339

340-
static char depca_string[] = "depca";
340+
static const char depca_string[] = "depca";
341341

342342
static int depca_device_remove (struct device *device);
343343

344344
#ifdef CONFIG_EISA
345-
static struct eisa_device_id depca_eisa_ids[] = {
345+
static const struct eisa_device_id depca_eisa_ids[] __devinitconst = {
346346
{ "DEC4220", de422 },
347347
{ "" }
348348
};
@@ -367,19 +367,19 @@ static struct eisa_driver depca_eisa_driver = {
367367
#define DE210_ID 0x628d
368368
#define DE212_ID 0x6def
369369

370-
static short depca_mca_adapter_ids[] = {
370+
static const short depca_mca_adapter_ids[] __devinitconst = {
371371
DE210_ID,
372372
DE212_ID,
373373
0x0000
374374
};
375375

376-
static char *depca_mca_adapter_name[] = {
376+
static const char *depca_mca_adapter_name[] = {
377377
"DEC EtherWORKS MC Adapter (DE210)",
378378
"DEC EtherWORKS MC Adapter (DE212)",
379379
NULL
380380
};
381381

382-
static enum depca_type depca_mca_adapter_type[] = {
382+
static const enum depca_type depca_mca_adapter_type[] = {
383383
de210,
384384
de212,
385385
0
@@ -541,10 +541,9 @@ static void SetMulticastFilter(struct net_device *dev);
541541
static int load_packet(struct net_device *dev, struct sk_buff *skb);
542542
static void depca_dbg_open(struct net_device *dev);
543543

544-
static u_char de1xx_irq[] __initdata = { 2, 3, 4, 5, 7, 9, 0 };
545-
static u_char de2xx_irq[] __initdata = { 5, 9, 10, 11, 15, 0 };
546-
static u_char de422_irq[] __initdata = { 5, 9, 10, 11, 0 };
547-
static u_char *depca_irq;
544+
static const u_char de1xx_irq[] __devinitconst = { 2, 3, 4, 5, 7, 9, 0 };
545+
static const u_char de2xx_irq[] __devinitconst = { 5, 9, 10, 11, 15, 0 };
546+
static const u_char de422_irq[] __devinitconst = { 5, 9, 10, 11, 0 };
548547

549548
static int irq;
550549
static int io;
@@ -580,7 +579,7 @@ static const struct net_device_ops depca_netdev_ops = {
580579
.ndo_validate_addr = eth_validate_addr,
581580
};
582581

583-
static int __init depca_hw_init (struct net_device *dev, struct device *device)
582+
static int __devinit depca_hw_init (struct net_device *dev, struct device *device)
584583
{
585584
struct depca_private *lp;
586585
int i, j, offset, netRAM, mem_len, status = 0;
@@ -748,6 +747,7 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
748747
if (dev->irq < 2) {
749748
unsigned char irqnum;
750749
unsigned long irq_mask, delay;
750+
const u_char *depca_irq;
751751

752752
irq_mask = probe_irq_on();
753753

@@ -770,6 +770,7 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
770770
break;
771771

772772
default:
773+
depca_irq = NULL;
773774
break; /* Not reached */
774775
}
775776

@@ -1302,7 +1303,7 @@ static void SetMulticastFilter(struct net_device *dev)
13021303
}
13031304
}
13041305

1305-
static int __init depca_common_init (u_long ioaddr, struct net_device **devp)
1306+
static int __devinit depca_common_init (u_long ioaddr, struct net_device **devp)
13061307
{
13071308
int status = 0;
13081309

@@ -1333,7 +1334,7 @@ static int __init depca_common_init (u_long ioaddr, struct net_device **devp)
13331334
/*
13341335
** Microchannel bus I/O device probe
13351336
*/
1336-
static int __init depca_mca_probe(struct device *device)
1337+
static int __devinit depca_mca_probe(struct device *device)
13371338
{
13381339
unsigned char pos[2];
13391340
unsigned char where;
@@ -1457,7 +1458,7 @@ static int __init depca_mca_probe(struct device *device)
14571458
** ISA bus I/O device probe
14581459
*/
14591460

1460-
static void __init depca_platform_probe (void)
1461+
static void __devinit depca_platform_probe (void)
14611462
{
14621463
int i;
14631464
struct platform_device *pldev;
@@ -1497,7 +1498,7 @@ static void __init depca_platform_probe (void)
14971498
}
14981499
}
14991500

1500-
static enum depca_type __init depca_shmem_probe (ulong *mem_start)
1501+
static enum depca_type __devinit depca_shmem_probe (ulong *mem_start)
15011502
{
15021503
u_long mem_base[] = DEPCA_RAM_BASE_ADDRESSES;
15031504
enum depca_type adapter = unknown;
@@ -1558,7 +1559,7 @@ static int __devinit depca_isa_probe (struct platform_device *device)
15581559
*/
15591560

15601561
#ifdef CONFIG_EISA
1561-
static int __init depca_eisa_probe (struct device *device)
1562+
static int __devinit depca_eisa_probe (struct device *device)
15621563
{
15631564
enum depca_type adapter = unknown;
15641565
struct eisa_device *edev;
@@ -1629,7 +1630,7 @@ static int __devexit depca_device_remove (struct device *device)
16291630
** and Boot (readb) ROM. This will also give us a clue to the network RAM
16301631
** base address.
16311632
*/
1632-
static int __init DepcaSignature(char *name, u_long base_addr)
1633+
static int __devinit DepcaSignature(char *name, u_long base_addr)
16331634
{
16341635
u_int i, j, k;
16351636
void __iomem *ptr;

drivers/net/hp100.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,14 @@ struct hp100_private {
188188
* variables
189189
*/
190190
#ifdef CONFIG_ISA
191-
static const char *hp100_isa_tbl[] = {
191+
static const char *const hp100_isa_tbl[] __devinitconst = {
192192
"HWPF150", /* HP J2573 rev A */
193193
"HWP1950", /* HP J2573 */
194194
};
195195
#endif
196196

197197
#ifdef CONFIG_EISA
198-
static struct eisa_device_id hp100_eisa_tbl[] = {
198+
static const struct eisa_device_id hp100_eisa_tbl[] __devinitconst = {
199199
{ "HWPF180" }, /* HP J2577 rev A */
200200
{ "HWP1920" }, /* HP 27248B */
201201
{ "HWP1940" }, /* HP J2577 */
@@ -336,7 +336,7 @@ static __devinit const char *hp100_read_id(int ioaddr)
336336
}
337337

338338
#ifdef CONFIG_ISA
339-
static __init int hp100_isa_probe1(struct net_device *dev, int ioaddr)
339+
static __devinit int hp100_isa_probe1(struct net_device *dev, int ioaddr)
340340
{
341341
const char *sig;
342342
int i;
@@ -372,7 +372,7 @@ static __init int hp100_isa_probe1(struct net_device *dev, int ioaddr)
372372
* EISA and PCI are handled by device infrastructure.
373373
*/
374374

375-
static int __init hp100_isa_probe(struct net_device *dev, int addr)
375+
static int __devinit hp100_isa_probe(struct net_device *dev, int addr)
376376
{
377377
int err = -ENODEV;
378378

@@ -396,7 +396,7 @@ static int __init hp100_isa_probe(struct net_device *dev, int addr)
396396
#endif /* CONFIG_ISA */
397397

398398
#if !defined(MODULE) && defined(CONFIG_ISA)
399-
struct net_device * __init hp100_probe(int unit)
399+
struct net_device * __devinit hp100_probe(int unit)
400400
{
401401
struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private));
402402
int err;
@@ -2843,7 +2843,7 @@ static void cleanup_dev(struct net_device *d)
28432843
}
28442844

28452845
#ifdef CONFIG_EISA
2846-
static int __init hp100_eisa_probe (struct device *gendev)
2846+
static int __devinit hp100_eisa_probe (struct device *gendev)
28472847
{
28482848
struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private));
28492849
struct eisa_device *edev = to_eisa_device(gendev);

drivers/net/ibmlana.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -895,12 +895,12 @@ static int ibmlana_irq;
895895
static int ibmlana_io;
896896
static int startslot; /* counts through slots when probing multiple devices */
897897

898-
static short ibmlana_adapter_ids[] __initdata = {
898+
static const short ibmlana_adapter_ids[] __devinitconst = {
899899
IBM_LANA_ID,
900900
0x0000
901901
};
902902

903-
static char *ibmlana_adapter_names[] __devinitdata = {
903+
static const char *const ibmlana_adapter_names[] __devinitconst = {
904904
"IBM LAN Adapter/A",
905905
NULL
906906
};

0 commit comments

Comments
 (0)