Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 312b1485fb50 ("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)

[akpm@linux-foundation.org: coding-style fixes]
Link: http://lkml.kernel.org/r/1466796271-3043-1-git-send-email-fabf@skynet.be
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Fabian Frederick and committed by
Linus Torvalds
bd721ea7 ca945e71

+46 -53
+1 -1
arch/alpha/kernel/machvec_impl.h
··· 137 137 #define __initmv __initdata 138 138 #define ALIAS_MV(x) 139 139 #else 140 - #define __initmv __initdata_refok 140 + #define __initmv __refdata 141 141 142 142 /* GCC actually has a syntax for defining aliases, but is under some 143 143 delusion that you shouldn't be able to declare it extern somewhere
+1 -1
arch/arc/mm/init.c
··· 220 220 /* 221 221 * free_initmem: Free all the __init memory. 222 222 */ 223 - void __init_refok free_initmem(void) 223 + void __ref free_initmem(void) 224 224 { 225 225 free_initmem_default(-1); 226 226 }
+2 -2
arch/arm/mach-integrator/impd1.c
··· 320 320 #define IMPD1_VALID_IRQS 0x00000bffU 321 321 322 322 /* 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 324 324 * probe calls will be done after the initial system bootup, as devices 325 325 * are discovered as part of the machine startup. 326 326 */ 327 - static int __init_refok impd1_probe(struct lm_device *dev) 327 + static int __ref impd1_probe(struct lm_device *dev) 328 328 { 329 329 struct impd1_module *impd1; 330 330 int irq_base;
+1 -1
arch/arm/mach-mv78xx0/common.c
··· 343 343 DDR_WINDOW_CPU1_BASE, DDR_WINDOW_CPU_SZ); 344 344 } 345 345 346 - void __init_refok mv78xx0_timer_init(void) 346 + void __ref mv78xx0_timer_init(void) 347 347 { 348 348 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR, 349 349 IRQ_MV78XX0_TIMER_1, get_tclk());
+1 -1
arch/blackfin/mm/init.c
··· 112 112 } 113 113 #endif 114 114 115 - void __init_refok free_initmem(void) 115 + void __ref free_initmem(void) 116 116 { 117 117 #if defined CONFIG_RAMKERNEL && !defined CONFIG_MPU 118 118 free_initmem_default(-1);
+1 -1
arch/hexagon/mm/init.c
··· 93 93 * Todo: free pages between __init_begin and __init_end; possibly 94 94 * some devtree related stuff as well. 95 95 */ 96 - void __init_refok free_initmem(void) 96 + void __ref free_initmem(void) 97 97 { 98 98 } 99 99
+1 -1
arch/ia64/kernel/mca.c
··· 1831 1831 } 1832 1832 1833 1833 /* Caller prevents this from being called after init */ 1834 - static void * __init_refok mca_bootmem(void) 1834 + static void * __ref mca_bootmem(void) 1835 1835 { 1836 1836 return __alloc_bootmem(sizeof(struct ia64_mca_cpu), 1837 1837 KERNEL_STACK_SIZE, 0);
+2 -2
arch/microblaze/mm/init.c
··· 414 414 415 415 #endif /* CONFIG_MMU */ 416 416 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) 418 418 { 419 419 if (mem_init_done) 420 420 return kmalloc(size, mask); ··· 422 422 return alloc_bootmem(size); 423 423 } 424 424 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) 426 426 { 427 427 void *p; 428 428
+1 -1
arch/microblaze/mm/pgtable.c
··· 234 234 return pa; 235 235 } 236 236 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, 238 238 unsigned long address) 239 239 { 240 240 pte_t *pte;
+1 -1
arch/mips/mm/init.c
··· 504 504 505 505 void (*free_init_pages_eva)(void *begin, void *end) = NULL; 506 506 507 - void __init_refok free_initmem(void) 507 + void __ref free_initmem(void) 508 508 { 509 509 prom_free_prom_memory(); 510 510 /*
+1 -1
arch/mips/txx9/generic/pci.c
··· 268 268 return err; 269 269 } 270 270 271 - static void __init_refok quirk_slc90e66_bridge(struct pci_dev *dev) 271 + static void __ref quirk_slc90e66_bridge(struct pci_dev *dev) 272 272 { 273 273 int irq; /* PCI/ISA Bridge interrupt */ 274 274 u8 reg_64;
+1 -1
arch/nios2/mm/init.c
··· 89 89 } 90 90 #endif 91 91 92 - void __init_refok free_initmem(void) 92 + void __ref free_initmem(void) 93 93 { 94 94 free_initmem_default(-1); 95 95 }
+2 -2
arch/openrisc/mm/ioremap.c
··· 38 38 * have to convert them into an offset in a page-aligned mapping, but the 39 39 * caller shouldn't need to know that small detail. 40 40 */ 41 - void __iomem *__init_refok 41 + void __iomem *__ref 42 42 __ioremap(phys_addr_t addr, unsigned long size, pgprot_t prot) 43 43 { 44 44 phys_addr_t p; ··· 116 116 * the memblock infrastructure. 117 117 */ 118 118 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, 120 120 unsigned long address) 121 121 { 122 122 pte_t *pte;
+1 -1
arch/powerpc/lib/alloc.c
··· 6 6 #include <asm/setup.h> 7 7 8 8 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) 10 10 { 11 11 void *p; 12 12
+1 -1
arch/powerpc/mm/pgtable_32.c
··· 79 79 #endif 80 80 } 81 81 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) 83 83 { 84 84 pte_t *pte; 85 85
+2 -2
arch/powerpc/platforms/powermac/setup.c
··· 353 353 machine_late_initcall(powermac, pmac_late_init); 354 354 355 355 /* 356 - * This is __init_refok because we check for "initializing" before 356 + * This is __ref because we check for "initializing" before 357 357 * touching any of the __init sensitive things and "initializing" 358 358 * will be false after __init time. This can't be __init because it 359 359 * can be called whenever a disk is first accessed. 360 360 */ 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) 362 362 { 363 363 char *p; 364 364
+1 -1
arch/powerpc/platforms/ps3/device-init.c
··· 189 189 return result; 190 190 } 191 191 192 - static int __init_refok ps3_setup_uhc_device( 192 + static int __ref ps3_setup_uhc_device( 193 193 const struct ps3_repository_device *repo, enum ps3_match_id match_id, 194 194 enum ps3_interrupt_type interrupt_type, enum ps3_reg_type reg_type) 195 195 {
+1 -1
arch/powerpc/sysdev/msi_bitmap.c
··· 112 112 return 0; 113 113 } 114 114 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, 116 116 struct device_node *of_node) 117 117 { 118 118 int size;
+1 -1
arch/score/mm/init.c
··· 91 91 } 92 92 #endif 93 93 94 - void __init_refok free_initmem(void) 94 + void __ref free_initmem(void) 95 95 { 96 96 free_initmem_default(POISON_FREE_INITMEM); 97 97 }
+2 -2
arch/sh/drivers/pci/pci.c
··· 221 221 * We can't use pci_find_device() here since we are 222 222 * called from interrupt context. 223 223 */ 224 - static void __init_refok 224 + static void __ref 225 225 pcibios_bus_report_status(struct pci_bus *bus, unsigned int status_mask, 226 226 int warn) 227 227 { ··· 256 256 pcibios_bus_report_status(dev->subordinate, status_mask, warn); 257 257 } 258 258 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) 260 260 { 261 261 struct pci_channel *hose; 262 262
+1 -1
arch/sh/mm/ioremap.c
··· 34 34 * have to convert them into an offset in a page-aligned mapping, but the 35 35 * caller shouldn't need to know that small detail. 36 36 */ 37 - void __iomem * __init_refok 37 + void __iomem * __ref 38 38 __ioremap_caller(phys_addr_t phys_addr, unsigned long size, 39 39 pgprot_t pgprot, void *caller) 40 40 {
+2 -2
arch/x86/mm/init.c
··· 208 208 * adjust the page_size_mask for small range to go with 209 209 * big page size instead small one if nearby are ram too. 210 210 */ 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, 212 212 int nr_range) 213 213 { 214 214 int i; ··· 396 396 * This runs before bootmem is initialized and gets pages directly from 397 397 * the physical memory. To access them they are temporarily mapped. 398 398 */ 399 - unsigned long __init_refok init_memory_mapping(unsigned long start, 399 + unsigned long __ref init_memory_mapping(unsigned long start, 400 400 unsigned long end) 401 401 { 402 402 struct map_range mr[NR_RANGE_MR];
+2 -2
arch/x86/platform/efi/early_printk.c
··· 44 44 * In case earlyprintk=efi,keep we have the whole framebuffer mapped already 45 45 * so just return the offset efi_fb + start. 46 46 */ 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) 48 48 { 49 49 unsigned long base; 50 50 ··· 56 56 return early_ioremap(base + start, len); 57 57 } 58 58 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) 60 60 { 61 61 if (!efi_fb) 62 62 early_iounmap(addr, len);
+2 -3
drivers/acpi/osl.c
··· 309 309 * During early init (when acpi_gbl_permanent_mmap has not been set yet) this 310 310 * routine simply calls __acpi_map_table() to get the job done. 311 311 */ 312 - void __iomem *__init_refok 312 + void __iomem *__ref 313 313 acpi_os_map_iomem(acpi_physical_address phys, acpi_size size) 314 314 { 315 315 struct acpi_ioremap *map; ··· 362 362 } 363 363 EXPORT_SYMBOL_GPL(acpi_os_map_iomem); 364 364 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) 367 366 { 368 367 return (void *)acpi_os_map_iomem(phys, size); 369 368 }
+1 -1
drivers/base/node.c
··· 370 370 #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE 371 371 #define page_initialized(page) (page->lru.next) 372 372 373 - static int __init_refok get_nid_for_pfn(unsigned long pfn) 373 + static int __ref get_nid_for_pfn(unsigned long pfn) 374 374 { 375 375 struct page *page; 376 376
+2 -2
drivers/clk/clkdev.c
··· 250 250 char con_id[MAX_CON_ID]; 251 251 }; 252 252 253 - static struct clk_lookup * __init_refok 253 + static struct clk_lookup * __ref 254 254 vclkdev_alloc(struct clk_hw *hw, const char *con_id, const char *dev_fmt, 255 255 va_list ap) 256 256 { ··· 287 287 return cl; 288 288 } 289 289 290 - struct clk_lookup * __init_refok 290 + struct clk_lookup * __ref 291 291 clkdev_alloc(struct clk *clk, const char *con_id, const char *dev_fmt, ...) 292 292 { 293 293 struct clk_lookup *cl;
+1 -1
drivers/pci/xen-pcifront.c
··· 1086 1086 return err; 1087 1087 } 1088 1088 1089 - static void __init_refok pcifront_backend_changed(struct xenbus_device *xdev, 1089 + static void __ref pcifront_backend_changed(struct xenbus_device *xdev, 1090 1090 enum xenbus_state be_state) 1091 1091 { 1092 1092 struct pcifront_device *pdev = dev_get_drvdata(&xdev->dev);
+2 -2
drivers/video/logo/logo.c
··· 36 36 37 37 late_initcall(fb_logo_late_init); 38 38 39 - /* logo's are marked __initdata. Use __init_refok to tell 39 + /* logo's are marked __initdata. Use __ref to tell 40 40 * modpost that it is intended that this function uses data 41 41 * marked __initdata. 42 42 */ 43 - const struct linux_logo * __init_refok fb_find_logo(int depth) 43 + const struct linux_logo * __ref fb_find_logo(int depth) 44 44 { 45 45 const struct linux_logo *logo = NULL; 46 46
+1 -1
include/acpi/acpi_io.h
··· 13 13 } 14 14 #endif 15 15 16 - void __iomem *__init_refok 16 + void __iomem *__ref 17 17 acpi_os_map_iomem(acpi_physical_address phys, acpi_size size); 18 18 void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size); 19 19 void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size);
-6
include/linux/init.h
··· 77 77 #define __refdata __section(.ref.data) 78 78 #define __refconst __constsection(.ref.rodata) 79 79 80 - /* compatibility defines */ 81 - #define __init_refok __ref 82 - #define __initdata_refok __refdata 83 - #define __exit_refok __ref 84 - 85 - 86 80 #ifdef MODULE 87 81 #define __exitused 88 82 #else
+1 -1
include/net/net_namespace.h
··· 275 275 #define __net_initconst 276 276 #else 277 277 #define __net_init __init 278 - #define __net_exit __exit_refok 278 + #define __net_exit __ref 279 279 #define __net_initdata __initdata 280 280 #define __net_initconst __initconst 281 281 #endif
+1 -1
init/main.c
··· 380 380 381 381 static __initdata DECLARE_COMPLETION(kthreadd_done); 382 382 383 - static noinline void __init_refok rest_init(void) 383 + static noinline void __ref rest_init(void) 384 384 { 385 385 int pid; 386 386
+2 -2
mm/page_alloc.c
··· 5276 5276 setup_zone_pageset(zone); 5277 5277 } 5278 5278 5279 - static noinline __init_refok 5279 + static noinline __ref 5280 5280 int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages) 5281 5281 { 5282 5282 int i; ··· 5903 5903 } 5904 5904 } 5905 5905 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) 5907 5907 { 5908 5908 unsigned long __maybe_unused start = 0; 5909 5909 unsigned long __maybe_unused offset = 0;
+1 -1
mm/slab.c
··· 1877 1877 return cpu_cache; 1878 1878 } 1879 1879 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) 1881 1881 { 1882 1882 if (slab_state >= FULL) 1883 1883 return enable_cpucache(cachep, gfp);
+1 -1
mm/sparse-vmemmap.c
··· 36 36 * Uses the main allocators if they are available, else bootmem. 37 37 */ 38 38 39 - static void * __init_refok __earlyonly_bootmem_alloc(int node, 39 + static void * __ref __earlyonly_bootmem_alloc(int node, 40 40 unsigned long size, 41 41 unsigned long align, 42 42 unsigned long goal)
+1 -1
mm/sparse.c
··· 59 59 #endif 60 60 61 61 #ifdef CONFIG_SPARSEMEM_EXTREME 62 - static struct mem_section noinline __init_refok *sparse_index_alloc(int nid) 62 + static noinline struct mem_section __ref *sparse_index_alloc(int nid) 63 63 { 64 64 struct mem_section *section = NULL; 65 65 unsigned long array_size = SECTIONS_PER_ROOT *