Skip to content

Commit bd721ea

Browse files
Fabian Fredericktorvalds
authored andcommitted
treewide: replace obsolete _refok by __ref
There was only one use of __initdata_refok and __exit_refok __init_refok was used 46 times against 82 for __ref. Those definitions are obsolete since commit 312b148 ("Introduce new section reference annotations tags: __ref, __refdata, __refconst") This patch removes the following compatibility definitions and replaces them treewide. /* compatibility defines */ #define __init_refok __ref #define __initdata_refok __refdata #define __exit_refok __ref I can also provide separate patches if necessary. (One patch per tree and check in 1 month or 2 to remove old definitions) [[email protected]: coding-style fixes] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Fabian Frederick <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Sam Ravnborg <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent ca945e7 commit bd721ea

File tree

36 files changed

+46
-53
lines changed

36 files changed

+46
-53
lines changed

arch/alpha/kernel/machvec_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
#define __initmv __initdata
138138
#define ALIAS_MV(x)
139139
#else
140-
#define __initmv __initdata_refok
140+
#define __initmv __refdata
141141

142142
/* GCC actually has a syntax for defining aliases, but is under some
143143
delusion that you shouldn't be able to declare it extern somewhere

arch/arc/mm/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void __init mem_init(void)
220220
/*
221221
* free_initmem: Free all the __init memory.
222222
*/
223-
void __init_refok free_initmem(void)
223+
void __ref free_initmem(void)
224224
{
225225
free_initmem_default(-1);
226226
}

arch/arm/mach-integrator/impd1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,11 @@ static struct impd1_device impd1_devs[] = {
320320
#define IMPD1_VALID_IRQS 0x00000bffU
321321

322322
/*
323-
* As this module is bool, it is OK to have this as __init_refok() - no
323+
* As this module is bool, it is OK to have this as __ref() - no
324324
* probe calls will be done after the initial system bootup, as devices
325325
* are discovered as part of the machine startup.
326326
*/
327-
static int __init_refok impd1_probe(struct lm_device *dev)
327+
static int __ref impd1_probe(struct lm_device *dev)
328328
{
329329
struct impd1_module *impd1;
330330
int irq_base;

arch/arm/mach-mv78xx0/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ void __init mv78xx0_init_early(void)
343343
DDR_WINDOW_CPU1_BASE, DDR_WINDOW_CPU_SZ);
344344
}
345345

346-
void __init_refok mv78xx0_timer_init(void)
346+
void __ref mv78xx0_timer_init(void)
347347
{
348348
orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
349349
IRQ_MV78XX0_TIMER_1, get_tclk());

arch/blackfin/mm/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void __init free_initrd_mem(unsigned long start, unsigned long end)
112112
}
113113
#endif
114114

115-
void __init_refok free_initmem(void)
115+
void __ref free_initmem(void)
116116
{
117117
#if defined CONFIG_RAMKERNEL && !defined CONFIG_MPU
118118
free_initmem_default(-1);

arch/hexagon/mm/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void __init mem_init(void)
9393
* Todo: free pages between __init_begin and __init_end; possibly
9494
* some devtree related stuff as well.
9595
*/
96-
void __init_refok free_initmem(void)
96+
void __ref free_initmem(void)
9797
{
9898
}
9999

arch/ia64/kernel/mca.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1831,7 +1831,7 @@ format_mca_init_stack(void *mca_data, unsigned long offset,
18311831
}
18321832

18331833
/* Caller prevents this from being called after init */
1834-
static void * __init_refok mca_bootmem(void)
1834+
static void * __ref mca_bootmem(void)
18351835
{
18361836
return __alloc_bootmem(sizeof(struct ia64_mca_cpu),
18371837
KERNEL_STACK_SIZE, 0);

arch/microblaze/mm/init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,15 +414,15 @@ void __init *early_get_page(void)
414414

415415
#endif /* CONFIG_MMU */
416416

417-
void * __init_refok alloc_maybe_bootmem(size_t size, gfp_t mask)
417+
void * __ref alloc_maybe_bootmem(size_t size, gfp_t mask)
418418
{
419419
if (mem_init_done)
420420
return kmalloc(size, mask);
421421
else
422422
return alloc_bootmem(size);
423423
}
424424

425-
void * __init_refok zalloc_maybe_bootmem(size_t size, gfp_t mask)
425+
void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)
426426
{
427427
void *p;
428428

arch/microblaze/mm/pgtable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ unsigned long iopa(unsigned long addr)
234234
return pa;
235235
}
236236

237-
__init_refok pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
237+
__ref pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
238238
unsigned long address)
239239
{
240240
pte_t *pte;

arch/mips/mm/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
504504

505505
void (*free_init_pages_eva)(void *begin, void *end) = NULL;
506506

507-
void __init_refok free_initmem(void)
507+
void __ref free_initmem(void)
508508
{
509509
prom_free_prom_memory();
510510
/*

arch/mips/txx9/generic/pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ static int txx9_i8259_irq_setup(int irq)
268268
return err;
269269
}
270270

271-
static void __init_refok quirk_slc90e66_bridge(struct pci_dev *dev)
271+
static void __ref quirk_slc90e66_bridge(struct pci_dev *dev)
272272
{
273273
int irq; /* PCI/ISA Bridge interrupt */
274274
u8 reg_64;

arch/nios2/mm/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void __init free_initrd_mem(unsigned long start, unsigned long end)
8989
}
9090
#endif
9191

92-
void __init_refok free_initmem(void)
92+
void __ref free_initmem(void)
9393
{
9494
free_initmem_default(-1);
9595
}

arch/openrisc/mm/ioremap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static unsigned int fixmaps_used __initdata;
3838
* have to convert them into an offset in a page-aligned mapping, but the
3939
* caller shouldn't need to know that small detail.
4040
*/
41-
void __iomem *__init_refok
41+
void __iomem *__ref
4242
__ioremap(phys_addr_t addr, unsigned long size, pgprot_t prot)
4343
{
4444
phys_addr_t p;
@@ -116,7 +116,7 @@ void iounmap(void *addr)
116116
* the memblock infrastructure.
117117
*/
118118

119-
pte_t __init_refok *pte_alloc_one_kernel(struct mm_struct *mm,
119+
pte_t __ref *pte_alloc_one_kernel(struct mm_struct *mm,
120120
unsigned long address)
121121
{
122122
pte_t *pte;

arch/powerpc/lib/alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <asm/setup.h>
77

88

9-
void * __init_refok zalloc_maybe_bootmem(size_t size, gfp_t mask)
9+
void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)
1010
{
1111
void *p;
1212

arch/powerpc/mm/pgtable_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void pgd_free(struct mm_struct *mm, pgd_t *pgd)
7979
#endif
8080
}
8181

82-
__init_refok pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
82+
__ref pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
8383
{
8484
pte_t *pte;
8585

arch/powerpc/platforms/powermac/setup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,12 +353,12 @@ static int pmac_late_init(void)
353353
machine_late_initcall(powermac, pmac_late_init);
354354

355355
/*
356-
* This is __init_refok because we check for "initializing" before
356+
* This is __ref because we check for "initializing" before
357357
* touching any of the __init sensitive things and "initializing"
358358
* will be false after __init time. This can't be __init because it
359359
* can be called whenever a disk is first accessed.
360360
*/
361-
void __init_refok note_bootable_part(dev_t dev, int part, int goodness)
361+
void __ref note_bootable_part(dev_t dev, int part, int goodness)
362362
{
363363
char *p;
364364

arch/powerpc/platforms/ps3/device-init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static int __init ps3_setup_gelic_device(
189189
return result;
190190
}
191191

192-
static int __init_refok ps3_setup_uhc_device(
192+
static int __ref ps3_setup_uhc_device(
193193
const struct ps3_repository_device *repo, enum ps3_match_id match_id,
194194
enum ps3_interrupt_type interrupt_type, enum ps3_reg_type reg_type)
195195
{

arch/powerpc/sysdev/msi_bitmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ int msi_bitmap_reserve_dt_hwirqs(struct msi_bitmap *bmp)
112112
return 0;
113113
}
114114

115-
int __init_refok msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
115+
int __ref msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
116116
struct device_node *of_node)
117117
{
118118
int size;

arch/score/mm/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
9191
}
9292
#endif
9393

94-
void __init_refok free_initmem(void)
94+
void __ref free_initmem(void)
9595
{
9696
free_initmem_default(POISON_FREE_INITMEM);
9797
}

arch/sh/drivers/pci/pci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ pcibios_bus_report_status_early(struct pci_channel *hose,
221221
* We can't use pci_find_device() here since we are
222222
* called from interrupt context.
223223
*/
224-
static void __init_refok
224+
static void __ref
225225
pcibios_bus_report_status(struct pci_bus *bus, unsigned int status_mask,
226226
int warn)
227227
{
@@ -256,7 +256,7 @@ pcibios_bus_report_status(struct pci_bus *bus, unsigned int status_mask,
256256
pcibios_bus_report_status(dev->subordinate, status_mask, warn);
257257
}
258258

259-
void __init_refok pcibios_report_status(unsigned int status_mask, int warn)
259+
void __ref pcibios_report_status(unsigned int status_mask, int warn)
260260
{
261261
struct pci_channel *hose;
262262

arch/sh/mm/ioremap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* have to convert them into an offset in a page-aligned mapping, but the
3535
* caller shouldn't need to know that small detail.
3636
*/
37-
void __iomem * __init_refok
37+
void __iomem * __ref
3838
__ioremap_caller(phys_addr_t phys_addr, unsigned long size,
3939
pgprot_t pgprot, void *caller)
4040
{

arch/x86/mm/init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ static int __meminit save_mr(struct map_range *mr, int nr_range,
208208
* adjust the page_size_mask for small range to go with
209209
* big page size instead small one if nearby are ram too.
210210
*/
211-
static void __init_refok adjust_range_page_size_mask(struct map_range *mr,
211+
static void __ref adjust_range_page_size_mask(struct map_range *mr,
212212
int nr_range)
213213
{
214214
int i;
@@ -396,7 +396,7 @@ bool pfn_range_is_mapped(unsigned long start_pfn, unsigned long end_pfn)
396396
* This runs before bootmem is initialized and gets pages directly from
397397
* the physical memory. To access them they are temporarily mapped.
398398
*/
399-
unsigned long __init_refok init_memory_mapping(unsigned long start,
399+
unsigned long __ref init_memory_mapping(unsigned long start,
400400
unsigned long end)
401401
{
402402
struct map_range mr[NR_RANGE_MR];

arch/x86/platform/efi/early_printk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ early_initcall(early_efi_map_fb);
4444
* In case earlyprintk=efi,keep we have the whole framebuffer mapped already
4545
* so just return the offset efi_fb + start.
4646
*/
47-
static __init_refok void *early_efi_map(unsigned long start, unsigned long len)
47+
static __ref void *early_efi_map(unsigned long start, unsigned long len)
4848
{
4949
unsigned long base;
5050

@@ -56,7 +56,7 @@ static __init_refok void *early_efi_map(unsigned long start, unsigned long len)
5656
return early_ioremap(base + start, len);
5757
}
5858

59-
static __init_refok void early_efi_unmap(void *addr, unsigned long len)
59+
static __ref void early_efi_unmap(void *addr, unsigned long len)
6060
{
6161
if (!efi_fb)
6262
early_iounmap(addr, len);

drivers/acpi/osl.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ static void acpi_unmap(acpi_physical_address pg_off, void __iomem *vaddr)
309309
* During early init (when acpi_gbl_permanent_mmap has not been set yet) this
310310
* routine simply calls __acpi_map_table() to get the job done.
311311
*/
312-
void __iomem *__init_refok
312+
void __iomem *__ref
313313
acpi_os_map_iomem(acpi_physical_address phys, acpi_size size)
314314
{
315315
struct acpi_ioremap *map;
@@ -362,8 +362,7 @@ acpi_os_map_iomem(acpi_physical_address phys, acpi_size size)
362362
}
363363
EXPORT_SYMBOL_GPL(acpi_os_map_iomem);
364364

365-
void *__init_refok
366-
acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
365+
void *__ref acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
367366
{
368367
return (void *)acpi_os_map_iomem(phys, size);
369368
}

drivers/base/node.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ int unregister_cpu_under_node(unsigned int cpu, unsigned int nid)
370370
#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
371371
#define page_initialized(page) (page->lru.next)
372372

373-
static int __init_refok get_nid_for_pfn(unsigned long pfn)
373+
static int __ref get_nid_for_pfn(unsigned long pfn)
374374
{
375375
struct page *page;
376376

drivers/clk/clkdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ struct clk_lookup_alloc {
250250
char con_id[MAX_CON_ID];
251251
};
252252

253-
static struct clk_lookup * __init_refok
253+
static struct clk_lookup * __ref
254254
vclkdev_alloc(struct clk_hw *hw, const char *con_id, const char *dev_fmt,
255255
va_list ap)
256256
{
@@ -287,7 +287,7 @@ vclkdev_create(struct clk_hw *hw, const char *con_id, const char *dev_fmt,
287287
return cl;
288288
}
289289

290-
struct clk_lookup * __init_refok
290+
struct clk_lookup * __ref
291291
clkdev_alloc(struct clk *clk, const char *con_id, const char *dev_fmt, ...)
292292
{
293293
struct clk_lookup *cl;

drivers/pci/xen-pcifront.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ static int pcifront_detach_devices(struct pcifront_device *pdev)
10861086
return err;
10871087
}
10881088

1089-
static void __init_refok pcifront_backend_changed(struct xenbus_device *xdev,
1089+
static void __ref pcifront_backend_changed(struct xenbus_device *xdev,
10901090
enum xenbus_state be_state)
10911091
{
10921092
struct pcifront_device *pdev = dev_get_drvdata(&xdev->dev);

drivers/video/logo/logo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ static int __init fb_logo_late_init(void)
3636

3737
late_initcall(fb_logo_late_init);
3838

39-
/* logo's are marked __initdata. Use __init_refok to tell
39+
/* logo's are marked __initdata. Use __ref to tell
4040
* modpost that it is intended that this function uses data
4141
* marked __initdata.
4242
*/
43-
const struct linux_logo * __init_refok fb_find_logo(int depth)
43+
const struct linux_logo * __ref fb_find_logo(int depth)
4444
{
4545
const struct linux_logo *logo = NULL;
4646

include/acpi/acpi_io.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
1313
}
1414
#endif
1515

16-
void __iomem *__init_refok
16+
void __iomem *__ref
1717
acpi_os_map_iomem(acpi_physical_address phys, acpi_size size);
1818
void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size);
1919
void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size);

include/linux/init.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@
7777
#define __refdata __section(.ref.data)
7878
#define __refconst __constsection(.ref.rodata)
7979

80-
/* compatibility defines */
81-
#define __init_refok __ref
82-
#define __initdata_refok __refdata
83-
#define __exit_refok __ref
84-
85-
8680
#ifdef MODULE
8781
#define __exitused
8882
#else

include/net/net_namespace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ static inline struct net *read_pnet(const possible_net_t *pnet)
275275
#define __net_initconst
276276
#else
277277
#define __net_init __init
278-
#define __net_exit __exit_refok
278+
#define __net_exit __ref
279279
#define __net_initdata __initdata
280280
#define __net_initconst __initconst
281281
#endif

init/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ static void __init setup_command_line(char *command_line)
380380

381381
static __initdata DECLARE_COMPLETION(kthreadd_done);
382382

383-
static noinline void __init_refok rest_init(void)
383+
static noinline void __ref rest_init(void)
384384
{
385385
int pid;
386386

mm/page_alloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5276,7 +5276,7 @@ void __init setup_per_cpu_pageset(void)
52765276
setup_zone_pageset(zone);
52775277
}
52785278

5279-
static noinline __init_refok
5279+
static noinline __ref
52805280
int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages)
52815281
{
52825282
int i;
@@ -5903,7 +5903,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat)
59035903
}
59045904
}
59055905

5906-
static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat)
5906+
static void __ref alloc_node_mem_map(struct pglist_data *pgdat)
59075907
{
59085908
unsigned long __maybe_unused start = 0;
59095909
unsigned long __maybe_unused offset = 0;

mm/slab.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1877,7 +1877,7 @@ static struct array_cache __percpu *alloc_kmem_cache_cpus(
18771877
return cpu_cache;
18781878
}
18791879

1880-
static int __init_refok setup_cpu_cache(struct kmem_cache *cachep, gfp_t gfp)
1880+
static int __ref setup_cpu_cache(struct kmem_cache *cachep, gfp_t gfp)
18811881
{
18821882
if (slab_state >= FULL)
18831883
return enable_cpucache(cachep, gfp);

0 commit comments

Comments
 (0)