Skip to content

Commit f0f37e2

Browse files
Alexey Dobriyantorvalds
authored andcommitted
const: mark struct vm_struct_operations
* mark struct vm_area_struct::vm_ops as const * mark vm_ops in AGP code But leave TTM code alone, something is fishy there with global vm_ops being used. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 6f50710 commit f0f37e2

64 files changed

Lines changed: 83 additions & 83 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/ia64/ia32/binfmt_elf32.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ ia32_install_gate_page (struct vm_area_struct *vma, struct vm_fault *vmf)
6969
}
7070

7171

72-
static struct vm_operations_struct ia32_shared_page_vm_ops = {
72+
static const struct vm_operations_struct ia32_shared_page_vm_ops = {
7373
.fault = ia32_install_shared_page
7474
};
7575

76-
static struct vm_operations_struct ia32_gate_page_vm_ops = {
76+
static const struct vm_operations_struct ia32_gate_page_vm_ops = {
7777
.fault = ia32_install_gate_page
7878
};
7979

‎arch/powerpc/platforms/cell/spufs/file.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ static int spufs_mem_mmap_access(struct vm_area_struct *vma,
309309
return len;
310310
}
311311

312-
static struct vm_operations_struct spufs_mem_mmap_vmops = {
312+
static const struct vm_operations_struct spufs_mem_mmap_vmops = {
313313
.fault = spufs_mem_mmap_fault,
314314
.access = spufs_mem_mmap_access,
315315
};
@@ -436,7 +436,7 @@ static int spufs_cntl_mmap_fault(struct vm_area_struct *vma,
436436
return spufs_ps_fault(vma, vmf, 0x4000, SPUFS_CNTL_MAP_SIZE);
437437
}
438438

439-
static struct vm_operations_struct spufs_cntl_mmap_vmops = {
439+
static const struct vm_operations_struct spufs_cntl_mmap_vmops = {
440440
.fault = spufs_cntl_mmap_fault,
441441
};
442442

@@ -1143,7 +1143,7 @@ spufs_signal1_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
11431143
#endif
11441144
}
11451145

1146-
static struct vm_operations_struct spufs_signal1_mmap_vmops = {
1146+
static const struct vm_operations_struct spufs_signal1_mmap_vmops = {
11471147
.fault = spufs_signal1_mmap_fault,
11481148
};
11491149

@@ -1279,7 +1279,7 @@ spufs_signal2_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
12791279
#endif
12801280
}
12811281

1282-
static struct vm_operations_struct spufs_signal2_mmap_vmops = {
1282+
static const struct vm_operations_struct spufs_signal2_mmap_vmops = {
12831283
.fault = spufs_signal2_mmap_fault,
12841284
};
12851285

@@ -1397,7 +1397,7 @@ spufs_mss_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
13971397
return spufs_ps_fault(vma, vmf, 0x0000, SPUFS_MSS_MAP_SIZE);
13981398
}
13991399

1400-
static struct vm_operations_struct spufs_mss_mmap_vmops = {
1400+
static const struct vm_operations_struct spufs_mss_mmap_vmops = {
14011401
.fault = spufs_mss_mmap_fault,
14021402
};
14031403

@@ -1458,7 +1458,7 @@ spufs_psmap_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
14581458
return spufs_ps_fault(vma, vmf, 0x0000, SPUFS_PS_MAP_SIZE);
14591459
}
14601460

1461-
static struct vm_operations_struct spufs_psmap_mmap_vmops = {
1461+
static const struct vm_operations_struct spufs_psmap_mmap_vmops = {
14621462
.fault = spufs_psmap_mmap_fault,
14631463
};
14641464

@@ -1517,7 +1517,7 @@ spufs_mfc_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
15171517
return spufs_ps_fault(vma, vmf, 0x3000, SPUFS_MFC_MAP_SIZE);
15181518
}
15191519

1520-
static struct vm_operations_struct spufs_mfc_mmap_vmops = {
1520+
static const struct vm_operations_struct spufs_mfc_mmap_vmops = {
15211521
.fault = spufs_mfc_mmap_fault,
15221522
};
15231523

‎arch/x86/pci/i386.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ void pcibios_set_master(struct pci_dev *dev)
266266
pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
267267
}
268268

269-
static struct vm_operations_struct pci_mmap_ops = {
269+
static const struct vm_operations_struct pci_mmap_ops = {
270270
.access = generic_access_phys,
271271
};
272272

‎drivers/char/agp/agp.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ struct agp_bridge_driver {
131131
struct agp_bridge_data {
132132
const struct agp_version *version;
133133
const struct agp_bridge_driver *driver;
134-
struct vm_operations_struct *vm_ops;
134+
const struct vm_operations_struct *vm_ops;
135135
void *previous_size;
136136
void *current_size;
137137
void *dev_private_data;

‎drivers/char/agp/alpha-agp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static struct aper_size_info_fixed alpha_core_agp_sizes[] =
4040
{ 0, 0, 0 }, /* filled in by alpha_core_agp_setup */
4141
};
4242

43-
struct vm_operations_struct alpha_core_agp_vm_ops = {
43+
static const struct vm_operations_struct alpha_core_agp_vm_ops = {
4444
.fault = alpha_core_agp_vm_fault,
4545
};
4646

‎drivers/char/mem.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ static inline int private_mapping_ok(struct vm_area_struct *vma)
301301
}
302302
#endif
303303

304-
static struct vm_operations_struct mmap_mem_ops = {
304+
static const struct vm_operations_struct mmap_mem_ops = {
305305
#ifdef CONFIG_HAVE_IOREMAP_PROT
306306
.access = generic_access_phys
307307
#endif

‎drivers/char/mspec.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ mspec_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
239239
return VM_FAULT_NOPAGE;
240240
}
241241

242-
static struct vm_operations_struct mspec_vm_ops = {
242+
static const struct vm_operations_struct mspec_vm_ops = {
243243
.open = mspec_open,
244244
.close = mspec_close,
245245
.fault = mspec_fault,

‎drivers/gpu/drm/drm_vm.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,28 +369,28 @@ static int drm_vm_sg_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
369369
}
370370

371371
/** AGP virtual memory operations */
372-
static struct vm_operations_struct drm_vm_ops = {
372+
static const struct vm_operations_struct drm_vm_ops = {
373373
.fault = drm_vm_fault,
374374
.open = drm_vm_open,
375375
.close = drm_vm_close,
376376
};
377377

378378
/** Shared virtual memory operations */
379-
static struct vm_operations_struct drm_vm_shm_ops = {
379+
static const struct vm_operations_struct drm_vm_shm_ops = {
380380
.fault = drm_vm_shm_fault,
381381
.open = drm_vm_open,
382382
.close = drm_vm_shm_close,
383383
};
384384

385385
/** DMA virtual memory operations */
386-
static struct vm_operations_struct drm_vm_dma_ops = {
386+
static const struct vm_operations_struct drm_vm_dma_ops = {
387387
.fault = drm_vm_dma_fault,
388388
.open = drm_vm_open,
389389
.close = drm_vm_close,
390390
};
391391

392392
/** Scatter-gather virtual memory operations */
393-
static struct vm_operations_struct drm_vm_sg_ops = {
393+
static const struct vm_operations_struct drm_vm_sg_ops = {
394394
.fault = drm_vm_sg_fault,
395395
.open = drm_vm_open,
396396
.close = drm_vm_close,

‎drivers/gpu/drm/radeon/radeon_ttm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ void radeon_ttm_fini(struct radeon_device *rdev)
530530
}
531531

532532
static struct vm_operations_struct radeon_ttm_vm_ops;
533-
static struct vm_operations_struct *ttm_vm_ops = NULL;
533+
static const struct vm_operations_struct *ttm_vm_ops = NULL;
534534

535535
static int radeon_ttm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
536536
{

‎drivers/gpu/drm/ttm/ttm_bo_vm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static void ttm_bo_vm_close(struct vm_area_struct *vma)
228228
vma->vm_private_data = NULL;
229229
}
230230

231-
static struct vm_operations_struct ttm_bo_vm_ops = {
231+
static const struct vm_operations_struct ttm_bo_vm_ops = {
232232
.fault = ttm_bo_vm_fault,
233233
.open = ttm_bo_vm_open,
234234
.close = ttm_bo_vm_close

0 commit comments

Comments
 (0)