constify various _ops structures for 2.6.32 v1
Subsystems (85)
Re: [PATCH 05/31] Constify struct dma_map_ops for 2.6.32 v1
In reply to Stephen RothwellQuoted 16 lines · Stephen Rothwell
Hi Emese,
Quoted 13 lines · On Sat, 05 Dec 2009 03:25:23 +0100 Emese Revfy <[email protected]> wrote:
I already took care of these, look at these hunks:
(quoted diff) +0
-1@@ -1033,7 +1026,6 @@ int vio_cmo_entitlement_update(size_t new_entitlement) { return 0; } void vio_cmo_set_dev_desired(struct vio_dev *viodev, size_t desired) {} static int vio_cmo_bus_probe(struct vio_dev *viodev) { return 0; } static void vio_cmo_bus_remove(struct vio_dev *viodev) {} -static void vio_cmo_set_dma_ops(struct vio_dev *viodev) {} static void vio_cmo_bus_init(void) {} static void vio_cmo_sysfs_init(void) { } #endif /* CONFIG_PPC_SMLPAR */@@ -1233,7 +1225,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) viodev->dev.archdata.of_node = of_node_get(of_node);
Quoted 6 lines
Review struct vio_dev *vio_register_device_node(struct device_node *of_node) · line 1228
Quoted 3 lines
(quoted diff) +1
-1if (firmware_has_feature(FW_FEATURE_CMO)) - vio_cmo_set_dma_ops(viodev); + viodev->dev.archdata.dma_ops = &vio_dma_mapping_ops;This code is not inside a #ifdef
CONFIG_PPC_SMLPARsection, sovio_dma_mapping_opsmay not exist here.
Thanks, I see it now, here is the updated patch.
From: Emese Revfy <[email protected]>
Constify struct dma_map_ops.
--- arch/ia64/hp/common/hwsw_iommu.c | 4 +- arch/ia64/hp/common/sba_iommu.c | 4 +- arch/ia64/include/asm/dma-mapping.h | 10 ++++---- arch/ia64/include/asm/machvec.h | 4 +- arch/ia64/kernel/dma-mapping.c | 4 +- arch/ia64/kernel/pci-dma.c | 2 +- arch/ia64/kernel/pci-swiotlb.c | 2 +- arch/ia64/sn/pci/pci_dma.c | 2 +- arch/powerpc/include/asm/device.h | 2 +- arch/powerpc/include/asm/dma-mapping.h | 18 ++++++++-------- arch/powerpc/include/asm/iommu.h | 3 ++ arch/powerpc/include/asm/pci.h | 4 +- arch/powerpc/include/asm/swiotlb.h | 2 +- arch/powerpc/kernel/dma-iommu.c | 4 +- arch/powerpc/kernel/dma-swiotlb.c | 2 +- arch/powerpc/kernel/dma.c | 2 +- arch/powerpc/kernel/ibmebus.c | 2 +- arch/powerpc/kernel/pci-common.c | 6 ++-- arch/powerpc/kernel/vio.c | 7 ++--- arch/powerpc/platforms/cell/iommu.c | 2 +- arch/powerpc/platforms/ps3/system-bus.c | 4 +- arch/sparc/include/asm/dma-mapping.h | 8 +++--- arch/sparc/kernel/iommu.c | 4 +- arch/sparc/kernel/ioport.c | 6 ++-- arch/sparc/kernel/pci_sun4v.c | 2 +- arch/x86/include/asm/device.h | 2 +- arch/x86/include/asm/dma-mapping.h | 10 ++++---- arch/x86/include/asm/iommu.h | 2 +- arch/x86/kernel/amd_iommu.c | 2 +- arch/x86/kernel/pci-calgary_64.c | 2 +- arch/x86/kernel/pci-dma.c | 4 +- arch/x86/kernel/pci-gart_64.c | 2 +- arch/x86/kernel/pci-nommu.c | 2 +- arch/x86/kernel/pci-swiotlb.c | 2 +- drivers/pci/intel-iommu.c | 2 +- include/asm-generic/dma-mapping-common.h | 24 +++++++++++----------- include/linux/dma-mapping.h | 32 +++++++++++++++--------------- 37 files changed, 99 insertions(+), 97 deletions(-)
arch/ia64/hp/common/hwsw_iommu.c +2 -2
@@ -17,7 +17,7 @@#include <linux/swiotlb.h> #include <asm/machvec.h> -extern struct dma_map_ops sba_dma_ops, swiotlb_dma_ops; +extern const struct dma_map_ops sba_dma_ops, swiotlb_dma_ops;/* swiotlb declarations & definitions: */ extern int swiotlb_late_init_with_default_size (size_t size);
@@ -33,7 +33,7 @@ static inline int use_swiotlb(struct device *dev) !sba_dma_ops.dma_supported (dev, *dev->dma_mask); } -struct dma_map_ops *hwsw_dma_get_ops (struct device *dev) +const struct dma_map_ops *hwsw_dma_get_ops (struct device *dev) {if (use_swiotlb (dev))return &swiotlb_dma_ops;
arch/ia64/hp/common/sba_iommu.c +2 -2
@@ -2077,7 +2077,7 @@ static struct acpi_driver acpi_sba_ioc_driver = { }, }; -extern struct dma_map_ops swiotlb_dma_ops; +extern const struct dma_map_ops swiotlb_dma_ops;static int __init sba_init (void )
@@ -2191,7 +2191,7 @@ sba_page_override(char *str)__setup ("sbapagesize=" ,sba_page_override); -struct dma_map_ops sba_dma_ops = { +const struct dma_map_ops sba_dma_ops = { .alloc_coherent = sba_alloc_coherent, .free_coherent = sba_free_coherent, .map_page = sba_map_page,
arch/ia64/include/asm/dma-mapping.h +5 -5
@@ -12,7 +12,7 @@#define ARCH_HAS_DMA_GET_REQUIRED_MASK -extern struct dma_map_ops *dma_ops; +extern const struct dma_map_ops *dma_ops;extern struct ia64_machine_vector ia64_mv;extern void set_iommu_machvec (void );
@@ -24,7 +24,7 @@ extern void machvec_dma_sync_sg(struct device *, struct scatterlist *, int,static inline void *dma_alloc_coherent (struct device *dev,size_t size,dma_addr_t *daddr,gfp_t gfp) { -struct dma_map_ops *ops =platform_dma_get_ops (dev); +const struct dma_map_ops *ops =platform_dma_get_ops (dev);void *caddr; caddr = ops->alloc_coherent (dev, size, daddr, gfp);
@@ -35,7 +35,7 @@ static inline void *dma_alloc_coherent(struct device *dev, size_t size,static inline void dma_free_coherent (struct device *dev,size_t size,void *caddr,dma_addr_t daddr) { -struct dma_map_ops *ops =platform_dma_get_ops (dev); +const struct dma_map_ops *ops =platform_dma_get_ops (dev);debug_dma_free_coherent (dev, size, caddr, daddr); ops->free_coherent (dev, size, caddr, daddr); }
@@ -49,13 +49,13 @@ static inline void dma_free_coherent(struct device *dev, size_t size,static inline int dma_mapping_error (struct device *dev,dma_addr_t daddr) { -struct dma_map_ops *ops =platform_dma_get_ops (dev); +const struct dma_map_ops *ops =platform_dma_get_ops (dev);return ops->mapping_error (dev, daddr); }static inline int dma_supported (struct device *dev,u64 mask) { -struct dma_map_ops *ops =platform_dma_get_ops (dev); +const struct dma_map_ops *ops =platform_dma_get_ops (dev);return ops->dma_supported (dev, mask); }
arch/ia64/include/asm/machvec.h +2 -2
@@ -45,7 +45,7 @@ typedef void ia64_mv_kernel_launch_event_t(void);/* DMA-mapping interface: */ typedef void ia64_mv_dma_init (void );typedef u64 ia64_mv_dma_get_required_mask (struct device *); -typedef struct dma_map_ops *ia64_mv_dma_get_ops (struct device *); +typedef const struct dma_map_ops *ia64_mv_dma_get_ops (struct device *);/* * WARNING: The legacy I/O space is _architected_. Platforms are
@@ -251,7 +251,7 @@ extern void machvec_init_from_cmdline(const char *cmdline);# endif /* CONFIG_IA64_GENERIC */ extern void swiotlb_dma_init (void ); -extern struct dma_map_ops *dma_get_ops (struct device *); +extern const struct dma_map_ops *dma_get_ops (struct device *);/* * Define default versions so we can extend machvec for new platforms without having
arch/ia64/kernel/dma-mapping.c +2 -2
@@ -3,7 +3,7 @@/* Set this to 1 if there is a HW IOMMU in the system */ int iommu_detected__read_mostly ; -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;EXPORT_SYMBOL (dma_ops);#define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16)
@@ -16,7 +16,7 @@ static int __init dma_init(void) }fs_initcall (dma_init); -struct dma_map_ops *dma_get_ops (struct device *dev) +const struct dma_map_ops *dma_get_ops (struct device *dev) {return dma_ops; }
arch/ia64/kernel/pci-dma.c +1 -1
@@ -43,7 +43,7 @@ struct device fallback_dev = { .dma_mask = &fallback_dev.coherent_dma_mask, }; -extern struct dma_map_ops intel_dma_ops; +extern const struct dma_map_ops intel_dma_ops;static int __init pci_iommu_init (void ) {
arch/ia64/kernel/pci-swiotlb.c +1 -1
@@ -21,7 +21,7 @@ static void *ia64_swiotlb_alloc_coherent(struct device *dev, size_t size,return swiotlb_alloc_coherent (dev, size, dma_handle, gfp); } -struct dma_map_ops swiotlb_dma_ops = { +const struct dma_map_ops swiotlb_dma_ops = { .alloc_coherent = ia64_swiotlb_alloc_coherent, .free_coherent = swiotlb_free_coherent, .map_page = swiotlb_map_page,
arch/ia64/sn/pci/pci_dma.c +1 -1
@@ -464,7 +464,7 @@ int sn_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size)return ret; } -static struct dma_map_ops sn_dma_ops = { +static const struct dma_map_ops sn_dma_ops = { .alloc_coherent = sn_dma_alloc_coherent, .free_coherent = sn_dma_free_coherent, .map_page = sn_dma_map_page,
arch/powerpc/include/asm/device.h +1 -1
@@ -14,7 +14,7 @@ struct dev_archdata {struct device_node *of_node;/* DMA operations on that device */ -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;/* * When an iommu is in use, dma_data is used as a ptr to the base of the
arch/powerpc/include/asm/dma-mapping.h +9 -9
@@ -67,11 +67,11 @@ static inline unsigned long device_to_mask(struct device *dev)* Available generic sets of operations */ #ifdef CONFIG_PPC64 -extern struct dma_map_ops dma_iommu_ops; +extern const struct dma_map_ops dma_iommu_ops;#endif -extern struct dma_map_ops dma_direct_ops; +extern const struct dma_map_ops dma_direct_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {/* We don't handle the NULL dev case for ISA for now. We could * do it via an out of line call but it is not needed for now. The
@@ -84,7 +84,7 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)return dev->archdata.dma_ops; } -static inline void set_dma_ops (struct device *dev,struct dma_map_ops *ops) +static inline void set_dma_ops (struct device *dev,const struct dma_map_ops *ops) { dev->archdata.dma_ops = ops; }
@@ -118,7 +118,7 @@ static inline void set_dma_offset(struct device *dev, dma_addr_t off)static inline int dma_supported (struct device *dev,u64 mask) { -struct dma_map_ops *dma_ops =get_dma_ops (dev); +const struct dma_map_ops *dma_ops =get_dma_ops (dev);if (unlikely (dma_ops ==NULL ))return 0 ;
@@ -132,7 +132,7 @@ static inline int dma_supported(struct device *dev, u64 mask)static inline int dma_set_mask (struct device *dev,u64 dma_mask) { -struct dma_map_ops *dma_ops =get_dma_ops (dev); +const struct dma_map_ops *dma_ops =get_dma_ops (dev);if (unlikely (dma_ops ==NULL ))return -EIO ;
@@ -147,7 +147,7 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)static inline void *dma_alloc_coherent (struct device *dev,size_t size,dma_addr_t *dma_handle,gfp_t flag) { -struct dma_map_ops *dma_ops =get_dma_ops (dev); +const struct dma_map_ops *dma_ops =get_dma_ops (dev);void *cpu_addr;BUG_ON (!dma_ops);
@@ -162,7 +162,7 @@ static inline void *dma_alloc_coherent(struct device *dev, size_t size,static inline void dma_free_coherent (struct device *dev,size_t size,void *cpu_addr,dma_addr_t dma_handle) { -struct dma_map_ops *dma_ops =get_dma_ops (dev); +const struct dma_map_ops *dma_ops =get_dma_ops (dev);BUG_ON (!dma_ops);
@@ -173,7 +173,7 @@ static inline void dma_free_coherent(struct device *dev, size_t size,static inline int dma_mapping_error (struct device *dev,dma_addr_t dma_addr) { -struct dma_map_ops *dma_ops =get_dma_ops (dev); +const struct dma_map_ops *dma_ops =get_dma_ops (dev);if (dma_ops->mapping_error)return dma_ops->mapping_error (dev, dma_addr);
arch/powerpc/include/asm/iommu.h +3 -0
@@ -116,6 +116,9 @@ extern void iommu_init_early_iSeries(void);extern void iommu_init_early_dart (void );extern void iommu_init_early_pasemi (void ); +/* dma-iommu.c */ +extern int dma_iommu_dma_supported (struct device *dev,u64 mask); +#ifdef CONFIG_PCI extern void pci_iommu_init (void );extern void pci_direct_iommu_init (void );
arch/powerpc/include/asm/pci.h +2 -2
@@ -65,8 +65,8 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) }#ifdef CONFIG_PCI -extern void set_pci_dma_ops (struct dma_map_ops *dma_ops); -extern struct dma_map_ops *get_pci_dma_ops (void ); +extern void set_pci_dma_ops (const struct dma_map_ops *dma_ops); +extern const struct dma_map_ops *get_pci_dma_ops (void );#else /* CONFIG_PCI */ #define set_pci_dma_ops (d)#define get_pci_dma_ops () NULL
arch/powerpc/include/asm/swiotlb.h +1 -1
@@ -13,7 +13,7 @@#include <linux/swiotlb.h> -extern struct dma_map_ops swiotlb_dma_ops; +extern const struct dma_map_ops swiotlb_dma_ops;static inline void dma_mark_clean (void *addr,size_t size) {}
arch/powerpc/kernel/dma-iommu.c +2 -2
@@ -70,7 +70,7 @@ static void dma_iommu_unmap_sg(struct device *dev, struct scatterlist *sglist, }/* We support DMA to/from any memory page via the iommu */ -static int dma_iommu_dma_supported (struct device *dev,u64 mask) +int dma_iommu_dma_supported (struct device *dev,u64 mask) {struct iommu_table *tbl =get_iommu_table_base (dev);
@@ -89,7 +89,7 @@ static int dma_iommu_dma_supported(struct device *dev, u64 mask)return 1 ; } -struct dma_map_ops dma_iommu_ops = { +const struct dma_map_ops dma_iommu_ops = { .alloc_coherent = dma_iommu_alloc_coherent, .free_coherent = dma_iommu_free_coherent, .map_sg = dma_iommu_map_sg,
arch/powerpc/kernel/dma-swiotlb.c +1 -1
@@ -31,7 +31,7 @@ unsigned int ppc_swiotlb_enable;* map_page, and unmap_page on highmem, use normal dma_ops * for everything else. */ -struct dma_map_ops swiotlb_dma_ops = { +const struct dma_map_ops swiotlb_dma_ops = { .alloc_coherent = dma_direct_alloc_coherent, .free_coherent = dma_direct_free_coherent, .map_sg = swiotlb_map_sg_attrs,
arch/powerpc/kernel/dma.c +1 -1
@@ -134,7 +134,7 @@ static inline void dma_direct_sync_single_range(struct device *dev, }#endif -struct dma_map_ops dma_direct_ops = { +const struct dma_map_ops dma_direct_ops = { .alloc_coherent = dma_direct_alloc_coherent, .free_coherent = dma_direct_free_coherent, .map_sg = dma_direct_map_sg,
arch/powerpc/kernel/ibmebus.c +1 -1
@@ -127,7 +127,7 @@ static int ibmebus_dma_supported(struct device *dev, u64 mask)return 1 ; } -static struct dma_map_ops ibmebus_dma_ops = { +static const struct dma_map_ops ibmebus_dma_ops = { .alloc_coherent = ibmebus_alloc_coherent, .free_coherent = ibmebus_free_coherent, .map_sg = ibmebus_map_sg,
arch/powerpc/kernel/pci-common.c +3 -3
@@ -50,14 +50,14 @@ resource_size_t isa_mem_base;unsigned int ppc_pci_flags =0 ; -static struct dma_map_ops *pci_dma_ops = &dma_direct_ops; +static const struct dma_map_ops *pci_dma_ops = &dma_direct_ops; -void set_pci_dma_ops (struct dma_map_ops *dma_ops) +void set_pci_dma_ops (const struct dma_map_ops *dma_ops) { pci_dma_ops = dma_ops; } -struct dma_map_ops *get_pci_dma_ops (void ) +const struct dma_map_ops *get_pci_dma_ops (void ) {return pci_dma_ops; }
arch/powerpc/kernel/vio.c +3 -4
@@ -601,14 +601,14 @@ static void vio_dma_iommu_unmap_sg(struct device *dev,vio_cmo_dealloc (viodev, alloc_size); } -struct dma_map_ops vio_dma_mapping_ops = { +static const struct dma_map_ops vio_dma_mapping_ops = { .alloc_coherent = vio_dma_iommu_alloc_coherent, .free_coherent = vio_dma_iommu_free_coherent, .map_sg = vio_dma_iommu_map_sg, .unmap_sg = vio_dma_iommu_unmap_sg, + .dma_supported = dma_iommu_dma_supported, .map_page = vio_dma_iommu_map_page, .unmap_page = vio_dma_iommu_unmap_page, - };/**
@@ -857,7 +857,6 @@ static void vio_cmo_bus_remove(struct vio_dev *viodev)static void vio_cmo_set_dma_ops (struct vio_dev *viodev) { - vio_dma_mapping_ops.dma_supported = dma_iommu_ops.dma_supported; viodev->dev.archdata.dma_ops = &vio_dma_mapping_ops; }
@@ -1232,7 +1231,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) viodev->dev.archdata.of_node =of_node_get (of_node);if (firmware_has_feature (FW_FEATURE_CMO )) -vio_cmo_set_dma_ops (viodev); + viodev->dev.archdata.dma_ops = &vio_dma_mapping_ops;else viodev->dev.archdata.dma_ops = &dma_iommu_ops;set_iommu_table_base (&viodev->dev,vio_build_iommu_table (viodev));
arch/powerpc/platforms/cell/iommu.c +1 -1
@@ -642,7 +642,7 @@ static int dma_fixed_dma_supported(struct device *dev, u64 mask)static int dma_set_mask_and_switch (struct device *dev,u64 dma_mask); -struct dma_map_ops dma_iommu_fixed_ops = { +const struct dma_map_ops dma_iommu_fixed_ops = { .alloc_coherent = dma_fixed_alloc_coherent, .free_coherent = dma_fixed_free_coherent, .map_sg = dma_fixed_map_sg,
arch/powerpc/platforms/ps3/system-bus.c +2 -2
@@ -694,7 +694,7 @@ static int ps3_dma_supported(struct device *_dev, u64 mask)return mask >=DMA_BIT_MASK (32 ); } -static struct dma_map_ops ps3_sb_dma_ops = { +static const struct dma_map_ops ps3_sb_dma_ops = { .alloc_coherent = ps3_alloc_coherent, .free_coherent = ps3_free_coherent, .map_sg = ps3_sb_map_sg,
@@ -704,7 +704,7 @@ static struct dma_map_ops ps3_sb_dma_ops = { .unmap_page = ps3_unmap_page, }; -static struct dma_map_ops ps3_ioc0_dma_ops = { +static const struct dma_map_ops ps3_ioc0_dma_ops = { .alloc_coherent = ps3_alloc_coherent, .free_coherent = ps3_free_coherent, .map_sg = ps3_ioc0_map_sg,
arch/sparc/include/asm/dma-mapping.h +4 -4
@@ -14,10 +14,10 @@ extern int dma_set_mask(struct device *dev, u64 dma_mask);#define dma_free_noncoherent (d, s, v, h) dma_free_coherent(d, s, v, h)#define dma_is_consistent (d, h) (1) -extern struct dma_map_ops *dma_ops, pci32_dma_ops; +extern struct const dma_map_ops *dma_ops, pci32_dma_ops;extern struct bus_type pci_bus_type; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {#if defined(CONFIG_SPARC32 ) && defined(CONFIG_PCI )if (dev->bus == &pci_bus_type)
@@ -31,7 +31,7 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)static inline void *dma_alloc_coherent (struct device *dev,size_t size,dma_addr_t *dma_handle,gfp_t flag) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);void *cpu_addr; cpu_addr = ops->alloc_coherent (dev, size, dma_handle, flag);
@@ -42,7 +42,7 @@ static inline void *dma_alloc_coherent(struct device *dev, size_t size,static inline void dma_free_coherent (struct device *dev,size_t size,void *cpu_addr,dma_addr_t dma_handle) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);debug_dma_free_coherent (dev, size, cpu_addr, dma_handle); ops->free_coherent (dev, size, cpu_addr, dma_handle);
arch/sparc/kernel/iommu.c +2 -2
@@ -826,7 +826,7 @@ static void dma_4u_sync_sg_for_cpu(struct device *dev,spin_unlock_irqrestore (&iommu->lock, flags); } -static struct dma_map_ops sun4u_dma_ops = { +static const struct dma_map_ops sun4u_dma_ops = { .alloc_coherent = dma_4u_alloc_coherent, .free_coherent = dma_4u_free_coherent, .map_page = dma_4u_map_page,
@@ -837,7 +837,7 @@ static struct dma_map_ops sun4u_dma_ops = { .sync_sg_for_cpu = dma_4u_sync_sg_for_cpu, }; -struct dma_map_ops *dma_ops = &sun4u_dma_ops; +const struct dma_map_ops *dma_ops = &sun4u_dma_ops;EXPORT_SYMBOL (dma_ops);extern int pci64_dma_supported (struct pci_dev *pdev,u64 device_mask);
arch/sparc/kernel/ioport.c +3 -3
@@ -392,7 +392,7 @@ static void sbus_sync_sg_for_device(struct device *dev, struct scatterlist *sg,BUG (); } -struct dma_map_ops sbus_dma_ops = { +const struct dma_map_ops sbus_dma_ops = { .alloc_coherent = sbus_alloc_coherent, .free_coherent = sbus_free_coherent, .map_page = sbus_map_page,
@@ -403,7 +403,7 @@ struct dma_map_ops sbus_dma_ops = { .sync_sg_for_device = sbus_sync_sg_for_device, }; -struct dma_map_ops *dma_ops = &sbus_dma_ops; +const struct dma_map_ops *dma_ops = &sbus_dma_ops;EXPORT_SYMBOL (dma_ops);static int __init sparc_register_ioport (void )
@@ -640,7 +640,7 @@ static void pci32_sync_sg_for_device(struct device *device, struct scatterlist * } } -struct dma_map_ops pci32_dma_ops = { +const struct dma_map_ops pci32_dma_ops = { .alloc_coherent = pci32_alloc_coherent, .free_coherent = pci32_free_coherent, .map_page = pci32_map_page,
arch/sparc/kernel/pci_sun4v.c +1 -1
@@ -525,7 +525,7 @@ static void dma_4v_unmap_sg(struct device *dev, struct scatterlist *sglist,spin_unlock_irqrestore (&iommu->lock, flags); } -static struct dma_map_ops sun4v_dma_ops = { +static const struct dma_map_ops sun4v_dma_ops = { .alloc_coherent = dma_4v_alloc_coherent, .free_coherent = dma_4v_free_coherent, .map_page = dma_4v_map_page,
arch/x86/include/asm/device.h +1 -1
@@ -6,7 +6,7 @@ struct dev_archdata {void *acpi_handle;#endif #ifdef CONFIG_X86_64 -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;#endif #ifdef CONFIG_DMAR void *iommu;/* hook for IOMMU specific extension */
arch/x86/include/asm/dma-mapping.h +5 -5
@@ -25,9 +25,9 @@ extern int iommu_merge;extern struct device x86_dma_fallback_dev;extern int panic_on_overflow; -extern struct dma_map_ops *dma_ops; +extern const struct dma_map_ops *dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {#ifdef CONFIG_X86_32 return dma_ops;
@@ -44,7 +44,7 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)/* Make sure we keep the same behaviour */ static inline int dma_mapping_error (struct device *dev,dma_addr_t dma_addr) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);if (ops->mapping_error)return ops->mapping_error (dev, dma_addr);
@@ -122,7 +122,7 @@ static inline void * dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp) { - struct dma_map_ops *ops = get_dma_ops(dev); + const struct dma_map_ops *ops = get_dma_ops(dev);void *memory; gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
@@ -149,7 +149,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,static inline void dma_free_coherent (struct device *dev,size_t size,void *vaddr,dma_addr_t bus) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);WARN_ON (irqs_disabled ());/* for portability */
arch/x86/include/asm/iommu.h +1 -1
@@ -3,7 +3,7 @@extern void pci_iommu_shutdown (void );extern void no_iommu_init (void ); -extern struct dma_map_ops nommu_dma_ops; +extern const struct dma_map_ops nommu_dma_ops;extern int force_iommu, no_iommu;extern int iommu_detected;extern int iommu_pass_through;
arch/x86/kernel/amd_iommu.c +1 -1
@@ -2069,7 +2069,7 @@ static void prealloc_protection_domains(void) } } -static struct dma_map_ops amd_iommu_dma_ops = { +static const struct dma_map_ops amd_iommu_dma_ops = { .alloc_coherent = alloc_coherent, .free_coherent = free_coherent, .map_page = map_page,
arch/x86/kernel/pci-calgary_64.c +1 -1
@@ -470,7 +470,7 @@ static void calgary_free_coherent(struct device *dev, size_t size,free_pages ((unsigned long )vaddr,get_order (size)); } -static struct dma_map_ops calgary_dma_ops = { +static const struct dma_map_ops calgary_dma_ops = { .alloc_coherent = calgary_alloc_coherent, .free_coherent = calgary_free_coherent, .map_sg = calgary_map_sg,
arch/x86/kernel/pci-dma.c +2 -2
@@ -14,7 +14,7 @@static int forbid_dac__read_mostly ; -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;EXPORT_SYMBOL (dma_ops);static int iommu_sac_force__read_mostly ;
@@ -243,7 +243,7 @@ early_param("iommu", iommu_setup);int dma_supported (struct device *dev,u64 mask) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);#ifdef CONFIG_PCI if (mask >0xffffffff && forbid_dac >0 ) {
arch/x86/kernel/pci-gart_64.c +1 -1
@@ -679,7 +679,7 @@ static __init int init_k8_gatt(struct agp_kern_info *info)return -1 ; } -static struct dma_map_ops gart_dma_ops = { +static const struct dma_map_ops gart_dma_ops = { .map_sg = gart_map_sg, .unmap_sg = gart_unmap_sg, .map_page = gart_map_page,
arch/x86/kernel/pci-nommu.c +1 -1
@@ -94,7 +94,7 @@ static void nommu_sync_sg_for_device(struct device *dev,flush_write_buffers (); } -struct dma_map_ops nommu_dma_ops = { +const struct dma_map_ops nommu_dma_ops = { .alloc_coherent = dma_generic_alloc_coherent, .free_coherent = nommu_free_coherent, .map_sg = nommu_map_sg,
arch/x86/kernel/pci-swiotlb.c +1 -1
@@ -25,7 +25,7 @@ static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size,return swiotlb_alloc_coherent (hwdev, size, dma_handle, flags); } -static struct dma_map_ops swiotlb_dma_ops = { +static const struct dma_map_ops swiotlb_dma_ops = { .mapping_error = swiotlb_dma_mapping_error, .alloc_coherent = x86_swiotlb_alloc_coherent, .free_coherent = swiotlb_free_coherent,
drivers/pci/intel-iommu.c +1 -1
@@ -2937,7 +2937,7 @@ static int intel_mapping_error(struct device *dev, dma_addr_t dma_addr)return !dma_addr; } -struct dma_map_ops intel_dma_ops = { +const struct dma_map_ops intel_dma_ops = { .alloc_coherent = intel_alloc_coherent, .free_coherent = intel_free_coherent, .map_sg = intel_map_sg,
include/asm-generic/dma-mapping-common.h +12 -12
@@ -11,7 +11,7 @@ static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,enum dma_data_direction dir, struct dma_attrs *attrs) { - struct dma_map_ops *ops = get_dma_ops(dev); + const struct dma_map_ops *ops = get_dma_ops(dev);dma_addr_t addr;kmemcheck_mark_initialized (ptr, size);
@@ -30,7 +30,7 @@ static inline void dma_unmap_single_attrs(struct device *dev, dma_addr_t addr,enum dma_data_direction dir, struct dma_attrs *attrs) { - struct dma_map_ops *ops = get_dma_ops(dev); + const struct dma_map_ops *ops = get_dma_ops(dev);BUG_ON (!valid_dma_direction (dir));if (ops->unmap_page)
@@ -42,7 +42,7 @@ static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir, struct dma_attrs *attrs) { - struct dma_map_ops *ops = get_dma_ops(dev); + const struct dma_map_ops *ops = get_dma_ops(dev);int i, ents;struct scatterlist *s;
@@ -59,7 +59,7 @@ static inline void dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg int nents, enum dma_data_direction dir, struct dma_attrs *attrs) { - struct dma_map_ops *ops = get_dma_ops(dev); + const struct dma_map_ops *ops = get_dma_ops(dev);BUG_ON (!valid_dma_direction (dir));debug_dma_unmap_sg (dev, sg, nents, dir);
@@ -71,7 +71,7 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, size_t offset, size_t size, enum dma_data_direction dir) { - struct dma_map_ops *ops = get_dma_ops(dev); +const struct dma_map_ops *ops =get_dma_ops (dev);dma_addr_t addr;kmemcheck_mark_initialized (page_address (page) + offset, size);
@@ -85,7 +85,7 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,static inline void dma_unmap_page (struct device *dev,dma_addr_t addr,size_t size,enum dma_data_direction dir) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);BUG_ON (!valid_dma_direction (dir));if (ops->unmap_page)
@@ -97,7 +97,7 @@ static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);BUG_ON (!valid_dma_direction (dir));if (ops->sync_single_for_cpu)
@@ -109,7 +109,7 @@ static inline void dma_sync_single_for_device(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) { - struct dma_map_ops *ops = get_dma_ops(dev); +const struct dma_map_ops *ops =get_dma_ops (dev);BUG_ON (!valid_dma_direction (dir));if (ops->sync_single_for_device)
@@ -123,7 +123,7 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev, size_t size, enum dma_data_direction dir) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);BUG_ON (!valid_dma_direction (dir));if (ops->sync_single_range_for_cpu) {
@@ -140,7 +140,7 @@ static inline void dma_sync_single_range_for_device(struct device *dev, size_t size, enum dma_data_direction dir) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);BUG_ON (!valid_dma_direction (dir));if (ops->sync_single_range_for_device) {
@@ -155,7 +155,7 @@ static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction dir) { - struct dma_map_ops *ops = get_dma_ops(dev); + const struct dma_map_ops *ops = get_dma_ops(dev);BUG_ON (!valid_dma_direction (dir));if (ops->sync_sg_for_cpu)
@@ -167,7 +167,7 @@ static inline void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction dir) { - struct dma_map_ops *ops = get_dma_ops(dev); + const struct dma_map_ops *ops = get_dma_ops(dev);BUG_ON (!valid_dma_direction (dir));if (ops->sync_sg_for_device)
include/linux/dma-mapping.h +16 -16
@@ -16,50 +16,50 @@ enum dma_data_direction { };struct dma_map_ops { -void * (*alloc_coherent)(struct device *dev,size_t size, +void * (*const alloc_coherent)(struct device *dev,size_t size,dma_addr_t *dma_handle,gfp_t gfp); -void (*free_coherent)(struct device *dev,size_t size, +void (*const free_coherent)(struct device *dev,size_t size,void *vaddr,dma_addr_t dma_handle); -dma_addr_t (*map_page)(struct device *dev,struct page *page, +dma_addr_t (*const map_page)(struct device *dev,struct page *page,unsigned long offset,size_t size,enum dma_data_direction dir,struct dma_attrs *attrs); -void (*unmap_page)(struct device *dev,dma_addr_t dma_handle, +void (*const unmap_page)(struct device *dev,dma_addr_t dma_handle,size_t size,enum dma_data_direction dir,struct dma_attrs *attrs); -int (*map_sg)(struct device *dev,struct scatterlist *sg, +int (*const map_sg)(struct device *dev,struct scatterlist *sg,int nents,enum dma_data_direction dir,struct dma_attrs *attrs); -void (*unmap_sg)(struct device *dev, +void (*const unmap_sg)(struct device *dev,struct scatterlist *sg,int nents,enum dma_data_direction dir,struct dma_attrs *attrs); -void (*sync_single_for_cpu)(struct device *dev, +void (*const sync_single_for_cpu)(struct device *dev,dma_addr_t dma_handle,size_t size,enum dma_data_direction dir); -void (*sync_single_for_device)(struct device *dev, +void (*const sync_single_for_device)(struct device *dev,dma_addr_t dma_handle,size_t size,enum dma_data_direction dir); -void (*sync_single_range_for_cpu)(struct device *dev, +void (*const sync_single_range_for_cpu)(struct device *dev,dma_addr_t dma_handle,unsigned long offset,size_t size,enum dma_data_direction dir); -void (*sync_single_range_for_device)(struct device *dev, +void (*const sync_single_range_for_device)(struct device *dev,dma_addr_t dma_handle,unsigned long offset,size_t size,enum dma_data_direction dir); -void (*sync_sg_for_cpu)(struct device *dev, +void (*const sync_sg_for_cpu)(struct device *dev,struct scatterlist *sg,int nents,enum dma_data_direction dir); -void (*sync_sg_for_device)(struct device *dev, +void (*const sync_sg_for_device)(struct device *dev,struct scatterlist *sg,int nents,enum dma_data_direction dir); -int (*mapping_error)(struct device *dev,dma_addr_t dma_addr); -int (*dma_supported)(struct device *dev,u64 mask); -int (*set_dma_mask)(struct device *dev,u64 mask); -int is_phys; +int (*const mapping_error)(struct device *dev,dma_addr_t dma_addr); +int (*const dma_supported)(struct device *dev,u64 mask); +int (*const set_dma_mask)(struct device *dev,u64 mask); +const int is_phys; };#define DMA_BIT_MASK (n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
Re: [PATCH 05/31] Constify struct dma_map_ops for 2.6.32 v1
Hi Emese,
arch/powerpc/kernel/vio.c struct vio_dev *vio_register_device_node(struct device_node *of_node) · line 1237
Quoted 10 lines · On Sat, 05 Dec 2009 03:52:33 +0100 Emese Revfy <[email protected]> wrote:
arch/powerpc/kernel/vio.c +1
-1@@ -1232,7 +1231,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) viodev->dev.archdata.of_node =of_node_get (of_node);if (firmware_has_feature (FW_FEATURE_CMO )) -vio_cmo_set_dma_ops (viodev); + viodev->dev.archdata.dma_ops = &vio_dma_mapping_ops;else viodev->dev.archdata.dma_ops = &dma_iommu_ops;set_iommu_table_base (&viodev->dev,vio_build_iommu_table (viodev));
You forgot to remove this hunk.
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
In reply to Emese RevfyQuoted 18 lines · Emese Revfy
Quoted 16 lines · Greg KH
drivers/char/pty.c static int ptmx_open(struct inode *inode, struct file *filp) · line 695
Quoted 12 lines · Emese Revfy
drivers/char/pty.c +11
-1-static struct file_operations ptmx_fops; +static const struct file_operations ptmx_fops = { + .llseek = no_llseek, + .read = tty_read, + .write = tty_write, + .poll = tty_poll, + .unlocked_ioctl = tty_ioctl, + .compat_ioctl = tty_compat_ioctl, + .open = ptmx_open, + .release = tty_release, + .fasync = tty_fasync, +};You just made these functions all global, for no real good reason. Why did you do this?
Quoted 1 line
I think this is the only way to make
ptmx_fopsconst, provided we want to.
Why do we want to?
thanks,
greg k-h
Re: [PATCH 05/31] Constify struct dma_map_ops for 2.6.32 v1
In reply to Stephen RothwellQuoted 6 lines · Stephen Rothwell
Hi Emese,
Quoted 3 lines · On Sat, 05 Dec 2009 03:52:33 +0100 Emese Revfy <[email protected]> wrote:
(quoted diff) +0
-0@@ -1232,7 +1231,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) viodev->dev.archdata.of_node = of_node_get(of_node);
Quoted 8 lines
Review struct vio_dev *vio_register_device_node(struct device_node *of_node) · line 1237
Quoted 6 lines
(quoted diff) +1
-1if (firmware_has_feature(FW_FEATURE_CMO)) - vio_cmo_set_dma_ops(viodev); + viodev->dev.archdata.dma_ops = &vio_dma_mapping_ops; else viodev->dev.archdata.dma_ops = &dma_iommu_ops; set_iommu_table_base(&viodev->dev, vio_build_iommu_table(viodev));You forgot to remove this hunk.
Sorry, it's fixed now.
From: Emese Revfy <[email protected]>
Constify struct dma_map_ops.
--- arch/ia64/hp/common/hwsw_iommu.c | 4 +- arch/ia64/hp/common/sba_iommu.c | 4 +- arch/ia64/include/asm/dma-mapping.h | 10 ++++---- arch/ia64/include/asm/machvec.h | 4 +- arch/ia64/kernel/dma-mapping.c | 4 +- arch/ia64/kernel/pci-dma.c | 2 +- arch/ia64/kernel/pci-swiotlb.c | 2 +- arch/ia64/sn/pci/pci_dma.c | 2 +- arch/powerpc/include/asm/device.h | 2 +- arch/powerpc/include/asm/dma-mapping.h | 18 ++++++++-------- arch/powerpc/include/asm/iommu.h | 3 ++ arch/powerpc/include/asm/pci.h | 4 +- arch/powerpc/include/asm/swiotlb.h | 2 +- arch/powerpc/kernel/dma-iommu.c | 4 +- arch/powerpc/kernel/dma-swiotlb.c | 2 +- arch/powerpc/kernel/dma.c | 2 +- arch/powerpc/kernel/ibmebus.c | 2 +- arch/powerpc/kernel/pci-common.c | 6 ++-- arch/powerpc/kernel/vio.c | 5 +-- arch/powerpc/platforms/cell/iommu.c | 2 +- arch/powerpc/platforms/ps3/system-bus.c | 4 +- arch/sparc/include/asm/dma-mapping.h | 8 +++--- arch/sparc/kernel/iommu.c | 4 +- arch/sparc/kernel/ioport.c | 6 ++-- arch/sparc/kernel/pci_sun4v.c | 2 +- arch/x86/include/asm/device.h | 2 +- arch/x86/include/asm/dma-mapping.h | 10 ++++---- arch/x86/include/asm/iommu.h | 2 +- arch/x86/kernel/amd_iommu.c | 2 +- arch/x86/kernel/pci-calgary_64.c | 2 +- arch/x86/kernel/pci-dma.c | 4 +- arch/x86/kernel/pci-gart_64.c | 2 +- arch/x86/kernel/pci-nommu.c | 2 +- arch/x86/kernel/pci-swiotlb.c | 2 +- drivers/pci/intel-iommu.c | 2 +- include/asm-generic/dma-mapping-common.h | 24 +++++++++++----------- include/linux/dma-mapping.h | 32 +++++++++++++++--------------- 37 files changed, 98 insertions(+), 96 deletions(-)
arch/ia64/hp/common/hwsw_iommu.c +2 -2
@@ -17,7 +17,7 @@#include <linux/swiotlb.h> #include <asm/machvec.h> -extern struct dma_map_ops sba_dma_ops, swiotlb_dma_ops; +extern const struct dma_map_ops sba_dma_ops, swiotlb_dma_ops;/* swiotlb declarations & definitions: */ extern int swiotlb_late_init_with_default_size (size_t size);
@@ -33,7 +33,7 @@ static inline int use_swiotlb(struct device *dev) !sba_dma_ops.dma_supported (dev, *dev->dma_mask); } -struct dma_map_ops *hwsw_dma_get_ops (struct device *dev) +const struct dma_map_ops *hwsw_dma_get_ops (struct device *dev) {if (use_swiotlb (dev))return &swiotlb_dma_ops;
arch/ia64/hp/common/sba_iommu.c +2 -2
@@ -2077,7 +2077,7 @@ static struct acpi_driver acpi_sba_ioc_driver = { }, }; -extern struct dma_map_ops swiotlb_dma_ops; +extern const struct dma_map_ops swiotlb_dma_ops;static int __init sba_init (void )
@@ -2191,7 +2191,7 @@ sba_page_override(char *str)__setup ("sbapagesize=" ,sba_page_override); -struct dma_map_ops sba_dma_ops = { +const struct dma_map_ops sba_dma_ops = { .alloc_coherent = sba_alloc_coherent, .free_coherent = sba_free_coherent, .map_page = sba_map_page,
arch/ia64/include/asm/dma-mapping.h +5 -5
@@ -12,7 +12,7 @@#define ARCH_HAS_DMA_GET_REQUIRED_MASK -extern struct dma_map_ops *dma_ops; +extern const struct dma_map_ops *dma_ops;extern struct ia64_machine_vector ia64_mv;extern void set_iommu_machvec (void );
@@ -24,7 +24,7 @@ extern void machvec_dma_sync_sg(struct device *, struct scatterlist *, int,static inline void *dma_alloc_coherent (struct device *dev,size_t size,dma_addr_t *daddr,gfp_t gfp) { -struct dma_map_ops *ops =platform_dma_get_ops (dev); +const struct dma_map_ops *ops =platform_dma_get_ops (dev);void *caddr; caddr = ops->alloc_coherent (dev, size, daddr, gfp);
@@ -35,7 +35,7 @@ static inline void *dma_alloc_coherent(struct device *dev, size_t size,static inline void dma_free_coherent (struct device *dev,size_t size,void *caddr,dma_addr_t daddr) { -struct dma_map_ops *ops =platform_dma_get_ops (dev); +const struct dma_map_ops *ops =platform_dma_get_ops (dev);debug_dma_free_coherent (dev, size, caddr, daddr); ops->free_coherent (dev, size, caddr, daddr); }
@@ -49,13 +49,13 @@ static inline void dma_free_coherent(struct device *dev, size_t size,static inline int dma_mapping_error (struct device *dev,dma_addr_t daddr) { -struct dma_map_ops *ops =platform_dma_get_ops (dev); +const struct dma_map_ops *ops =platform_dma_get_ops (dev);return ops->mapping_error (dev, daddr); }static inline int dma_supported (struct device *dev,u64 mask) { -struct dma_map_ops *ops =platform_dma_get_ops (dev); +const struct dma_map_ops *ops =platform_dma_get_ops (dev);return ops->dma_supported (dev, mask); }
arch/ia64/include/asm/machvec.h +2 -2
@@ -45,7 +45,7 @@ typedef void ia64_mv_kernel_launch_event_t(void);/* DMA-mapping interface: */ typedef void ia64_mv_dma_init (void );typedef u64 ia64_mv_dma_get_required_mask (struct device *); -typedef struct dma_map_ops *ia64_mv_dma_get_ops (struct device *); +typedef const struct dma_map_ops *ia64_mv_dma_get_ops (struct device *);/* * WARNING: The legacy I/O space is _architected_. Platforms are
@@ -251,7 +251,7 @@ extern void machvec_init_from_cmdline(const char *cmdline);# endif /* CONFIG_IA64_GENERIC */ extern void swiotlb_dma_init (void ); -extern struct dma_map_ops *dma_get_ops (struct device *); +extern const struct dma_map_ops *dma_get_ops (struct device *);/* * Define default versions so we can extend machvec for new platforms without having
arch/ia64/kernel/dma-mapping.c +2 -2
@@ -3,7 +3,7 @@/* Set this to 1 if there is a HW IOMMU in the system */ int iommu_detected__read_mostly ; -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;EXPORT_SYMBOL (dma_ops);#define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16)
@@ -16,7 +16,7 @@ static int __init dma_init(void) }fs_initcall (dma_init); -struct dma_map_ops *dma_get_ops (struct device *dev) +const struct dma_map_ops *dma_get_ops (struct device *dev) {return dma_ops; }
arch/ia64/kernel/pci-dma.c +1 -1
@@ -43,7 +43,7 @@ struct device fallback_dev = { .dma_mask = &fallback_dev.coherent_dma_mask, }; -extern struct dma_map_ops intel_dma_ops; +extern const struct dma_map_ops intel_dma_ops;static int __init pci_iommu_init (void ) {
arch/ia64/kernel/pci-swiotlb.c +1 -1
@@ -21,7 +21,7 @@ static void *ia64_swiotlb_alloc_coherent(struct device *dev, size_t size,return swiotlb_alloc_coherent (dev, size, dma_handle, gfp); } -struct dma_map_ops swiotlb_dma_ops = { +const struct dma_map_ops swiotlb_dma_ops = { .alloc_coherent = ia64_swiotlb_alloc_coherent, .free_coherent = swiotlb_free_coherent, .map_page = swiotlb_map_page,
arch/ia64/sn/pci/pci_dma.c +1 -1
@@ -464,7 +464,7 @@ int sn_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size)return ret; } -static struct dma_map_ops sn_dma_ops = { +static const struct dma_map_ops sn_dma_ops = { .alloc_coherent = sn_dma_alloc_coherent, .free_coherent = sn_dma_free_coherent, .map_page = sn_dma_map_page,
arch/powerpc/include/asm/device.h +1 -1
@@ -14,7 +14,7 @@ struct dev_archdata {struct device_node *of_node;/* DMA operations on that device */ -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;/* * When an iommu is in use, dma_data is used as a ptr to the base of the
arch/powerpc/include/asm/dma-mapping.h +9 -9
@@ -67,11 +67,11 @@ static inline unsigned long device_to_mask(struct device *dev)* Available generic sets of operations */ #ifdef CONFIG_PPC64 -extern struct dma_map_ops dma_iommu_ops; +extern const struct dma_map_ops dma_iommu_ops;#endif -extern struct dma_map_ops dma_direct_ops; +extern const struct dma_map_ops dma_direct_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {/* We don't handle the NULL dev case for ISA for now. We could * do it via an out of line call but it is not needed for now. The
@@ -84,7 +84,7 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)return dev->archdata.dma_ops; } -static inline void set_dma_ops (struct device *dev,struct dma_map_ops *ops) +static inline void set_dma_ops (struct device *dev,const struct dma_map_ops *ops) { dev->archdata.dma_ops = ops; }
@@ -118,7 +118,7 @@ static inline void set_dma_offset(struct device *dev, dma_addr_t off)static inline int dma_supported (struct device *dev,u64 mask) { -struct dma_map_ops *dma_ops =get_dma_ops (dev); +const struct dma_map_ops *dma_ops =get_dma_ops (dev);if (unlikely (dma_ops ==NULL ))return 0 ;
@@ -132,7 +132,7 @@ static inline int dma_supported(struct device *dev, u64 mask)static inline int dma_set_mask (struct device *dev,u64 dma_mask) { -struct dma_map_ops *dma_ops =get_dma_ops (dev); +const struct dma_map_ops *dma_ops =get_dma_ops (dev);if (unlikely (dma_ops ==NULL ))return -EIO ;
@@ -147,7 +147,7 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)static inline void *dma_alloc_coherent (struct device *dev,size_t size,dma_addr_t *dma_handle,gfp_t flag) { -struct dma_map_ops *dma_ops =get_dma_ops (dev); +const struct dma_map_ops *dma_ops =get_dma_ops (dev);void *cpu_addr;BUG_ON (!dma_ops);
@@ -162,7 +162,7 @@ static inline void *dma_alloc_coherent(struct device *dev, size_t size,static inline void dma_free_coherent (struct device *dev,size_t size,void *cpu_addr,dma_addr_t dma_handle) { -struct dma_map_ops *dma_ops =get_dma_ops (dev); +const struct dma_map_ops *dma_ops =get_dma_ops (dev);BUG_ON (!dma_ops);
@@ -173,7 +173,7 @@ static inline void dma_free_coherent(struct device *dev, size_t size,static inline int dma_mapping_error (struct device *dev,dma_addr_t dma_addr) { -struct dma_map_ops *dma_ops =get_dma_ops (dev); +const struct dma_map_ops *dma_ops =get_dma_ops (dev);if (dma_ops->mapping_error)return dma_ops->mapping_error (dev, dma_addr);
arch/powerpc/include/asm/iommu.h +3 -0
@@ -116,6 +116,9 @@ extern void iommu_init_early_iSeries(void);extern void iommu_init_early_dart (void );extern void iommu_init_early_pasemi (void ); +/* dma-iommu.c */ +extern int dma_iommu_dma_supported (struct device *dev,u64 mask); +#ifdef CONFIG_PCI extern void pci_iommu_init (void );extern void pci_direct_iommu_init (void );
arch/powerpc/include/asm/pci.h +2 -2
@@ -65,8 +65,8 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) }#ifdef CONFIG_PCI -extern void set_pci_dma_ops (struct dma_map_ops *dma_ops); -extern struct dma_map_ops *get_pci_dma_ops (void ); +extern void set_pci_dma_ops (const struct dma_map_ops *dma_ops); +extern const struct dma_map_ops *get_pci_dma_ops (void );#else /* CONFIG_PCI */ #define set_pci_dma_ops (d)#define get_pci_dma_ops () NULL
arch/powerpc/include/asm/swiotlb.h +1 -1
@@ -13,7 +13,7 @@#include <linux/swiotlb.h> -extern struct dma_map_ops swiotlb_dma_ops; +extern const struct dma_map_ops swiotlb_dma_ops;static inline void dma_mark_clean (void *addr,size_t size) {}
arch/powerpc/kernel/dma-iommu.c +2 -2
@@ -70,7 +70,7 @@ static void dma_iommu_unmap_sg(struct device *dev, struct scatterlist *sglist, }/* We support DMA to/from any memory page via the iommu */ -static int dma_iommu_dma_supported (struct device *dev,u64 mask) +int dma_iommu_dma_supported (struct device *dev,u64 mask) {struct iommu_table *tbl =get_iommu_table_base (dev);
@@ -89,7 +89,7 @@ static int dma_iommu_dma_supported(struct device *dev, u64 mask)return 1 ; } -struct dma_map_ops dma_iommu_ops = { +const struct dma_map_ops dma_iommu_ops = { .alloc_coherent = dma_iommu_alloc_coherent, .free_coherent = dma_iommu_free_coherent, .map_sg = dma_iommu_map_sg,
arch/powerpc/kernel/dma-swiotlb.c +1 -1
@@ -31,7 +31,7 @@ unsigned int ppc_swiotlb_enable;* map_page, and unmap_page on highmem, use normal dma_ops * for everything else. */ -struct dma_map_ops swiotlb_dma_ops = { +const struct dma_map_ops swiotlb_dma_ops = { .alloc_coherent = dma_direct_alloc_coherent, .free_coherent = dma_direct_free_coherent, .map_sg = swiotlb_map_sg_attrs,
arch/powerpc/kernel/dma.c +1 -1
@@ -134,7 +134,7 @@ static inline void dma_direct_sync_single_range(struct device *dev, }#endif -struct dma_map_ops dma_direct_ops = { +const struct dma_map_ops dma_direct_ops = { .alloc_coherent = dma_direct_alloc_coherent, .free_coherent = dma_direct_free_coherent, .map_sg = dma_direct_map_sg,
arch/powerpc/kernel/ibmebus.c +1 -1
@@ -127,7 +127,7 @@ static int ibmebus_dma_supported(struct device *dev, u64 mask)return 1 ; } -static struct dma_map_ops ibmebus_dma_ops = { +static const struct dma_map_ops ibmebus_dma_ops = { .alloc_coherent = ibmebus_alloc_coherent, .free_coherent = ibmebus_free_coherent, .map_sg = ibmebus_map_sg,
arch/powerpc/kernel/pci-common.c +3 -3
@@ -50,14 +50,14 @@ resource_size_t isa_mem_base;unsigned int ppc_pci_flags =0 ; -static struct dma_map_ops *pci_dma_ops = &dma_direct_ops; +static const struct dma_map_ops *pci_dma_ops = &dma_direct_ops; -void set_pci_dma_ops (struct dma_map_ops *dma_ops) +void set_pci_dma_ops (const struct dma_map_ops *dma_ops) { pci_dma_ops = dma_ops; } -struct dma_map_ops *get_pci_dma_ops (void ) +const struct dma_map_ops *get_pci_dma_ops (void ) {return pci_dma_ops; }
arch/powerpc/kernel/vio.c +2 -3
@@ -601,14 +601,14 @@ static void vio_dma_iommu_unmap_sg(struct device *dev,vio_cmo_dealloc (viodev, alloc_size); } -struct dma_map_ops vio_dma_mapping_ops = { +static const struct dma_map_ops vio_dma_mapping_ops = { .alloc_coherent = vio_dma_iommu_alloc_coherent, .free_coherent = vio_dma_iommu_free_coherent, .map_sg = vio_dma_iommu_map_sg, .unmap_sg = vio_dma_iommu_unmap_sg, + .dma_supported = dma_iommu_dma_supported, .map_page = vio_dma_iommu_map_page, .unmap_page = vio_dma_iommu_unmap_page, - };/**
@@ -857,7 +857,6 @@ static void vio_cmo_bus_remove(struct vio_dev *viodev)static void vio_cmo_set_dma_ops (struct vio_dev *viodev) { - vio_dma_mapping_ops.dma_supported = dma_iommu_ops.dma_supported; viodev->dev.archdata.dma_ops = &vio_dma_mapping_ops; }
arch/powerpc/platforms/cell/iommu.c +1 -1
@@ -642,7 +642,7 @@ static int dma_fixed_dma_supported(struct device *dev, u64 mask)static int dma_set_mask_and_switch (struct device *dev,u64 dma_mask); -struct dma_map_ops dma_iommu_fixed_ops = { +const struct dma_map_ops dma_iommu_fixed_ops = { .alloc_coherent = dma_fixed_alloc_coherent, .free_coherent = dma_fixed_free_coherent, .map_sg = dma_fixed_map_sg,
arch/powerpc/platforms/ps3/system-bus.c +2 -2
@@ -694,7 +694,7 @@ static int ps3_dma_supported(struct device *_dev, u64 mask)return mask >=DMA_BIT_MASK (32 ); } -static struct dma_map_ops ps3_sb_dma_ops = { +static const struct dma_map_ops ps3_sb_dma_ops = { .alloc_coherent = ps3_alloc_coherent, .free_coherent = ps3_free_coherent, .map_sg = ps3_sb_map_sg,
@@ -704,7 +704,7 @@ static struct dma_map_ops ps3_sb_dma_ops = { .unmap_page = ps3_unmap_page, }; -static struct dma_map_ops ps3_ioc0_dma_ops = { +static const struct dma_map_ops ps3_ioc0_dma_ops = { .alloc_coherent = ps3_alloc_coherent, .free_coherent = ps3_free_coherent, .map_sg = ps3_ioc0_map_sg,
arch/sparc/include/asm/dma-mapping.h +4 -4
@@ -14,10 +14,10 @@ extern int dma_set_mask(struct device *dev, u64 dma_mask);#define dma_free_noncoherent (d, s, v, h) dma_free_coherent(d, s, v, h)#define dma_is_consistent (d, h) (1) -extern struct dma_map_ops *dma_ops, pci32_dma_ops; +extern struct const dma_map_ops *dma_ops, pci32_dma_ops;extern struct bus_type pci_bus_type; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {#if defined(CONFIG_SPARC32 ) && defined(CONFIG_PCI )if (dev->bus == &pci_bus_type)
@@ -31,7 +31,7 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)static inline void *dma_alloc_coherent (struct device *dev,size_t size,dma_addr_t *dma_handle,gfp_t flag) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);void *cpu_addr; cpu_addr = ops->alloc_coherent (dev, size, dma_handle, flag);
@@ -42,7 +42,7 @@ static inline void *dma_alloc_coherent(struct device *dev, size_t size,static inline void dma_free_coherent (struct device *dev,size_t size,void *cpu_addr,dma_addr_t dma_handle) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);debug_dma_free_coherent (dev, size, cpu_addr, dma_handle); ops->free_coherent (dev, size, cpu_addr, dma_handle);
arch/sparc/kernel/iommu.c +2 -2
@@ -826,7 +826,7 @@ static void dma_4u_sync_sg_for_cpu(struct device *dev,spin_unlock_irqrestore (&iommu->lock, flags); } -static struct dma_map_ops sun4u_dma_ops = { +static const struct dma_map_ops sun4u_dma_ops = { .alloc_coherent = dma_4u_alloc_coherent, .free_coherent = dma_4u_free_coherent, .map_page = dma_4u_map_page,
@@ -837,7 +837,7 @@ static struct dma_map_ops sun4u_dma_ops = { .sync_sg_for_cpu = dma_4u_sync_sg_for_cpu, }; -struct dma_map_ops *dma_ops = &sun4u_dma_ops; +const struct dma_map_ops *dma_ops = &sun4u_dma_ops;EXPORT_SYMBOL (dma_ops);extern int pci64_dma_supported (struct pci_dev *pdev,u64 device_mask);
arch/sparc/kernel/ioport.c +3 -3
@@ -392,7 +392,7 @@ static void sbus_sync_sg_for_device(struct device *dev, struct scatterlist *sg,BUG (); } -struct dma_map_ops sbus_dma_ops = { +const struct dma_map_ops sbus_dma_ops = { .alloc_coherent = sbus_alloc_coherent, .free_coherent = sbus_free_coherent, .map_page = sbus_map_page,
@@ -403,7 +403,7 @@ struct dma_map_ops sbus_dma_ops = { .sync_sg_for_device = sbus_sync_sg_for_device, }; -struct dma_map_ops *dma_ops = &sbus_dma_ops; +const struct dma_map_ops *dma_ops = &sbus_dma_ops;EXPORT_SYMBOL (dma_ops);static int __init sparc_register_ioport (void )
@@ -640,7 +640,7 @@ static void pci32_sync_sg_for_device(struct device *device, struct scatterlist * } } -struct dma_map_ops pci32_dma_ops = { +const struct dma_map_ops pci32_dma_ops = { .alloc_coherent = pci32_alloc_coherent, .free_coherent = pci32_free_coherent, .map_page = pci32_map_page,
arch/sparc/kernel/pci_sun4v.c +1 -1
@@ -525,7 +525,7 @@ static void dma_4v_unmap_sg(struct device *dev, struct scatterlist *sglist,spin_unlock_irqrestore (&iommu->lock, flags); } -static struct dma_map_ops sun4v_dma_ops = { +static const struct dma_map_ops sun4v_dma_ops = { .alloc_coherent = dma_4v_alloc_coherent, .free_coherent = dma_4v_free_coherent, .map_page = dma_4v_map_page,
arch/x86/include/asm/device.h +1 -1
@@ -6,7 +6,7 @@ struct dev_archdata {void *acpi_handle;#endif #ifdef CONFIG_X86_64 -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;#endif #ifdef CONFIG_DMAR void *iommu;/* hook for IOMMU specific extension */
arch/x86/include/asm/dma-mapping.h +5 -5
@@ -25,9 +25,9 @@ extern int iommu_merge;extern struct device x86_dma_fallback_dev;extern int panic_on_overflow; -extern struct dma_map_ops *dma_ops; +extern const struct dma_map_ops *dma_ops; -static inline struct dma_map_ops *get_dma_ops (struct device *dev) +static inline const struct dma_map_ops *get_dma_ops (struct device *dev) {#ifdef CONFIG_X86_32 return dma_ops;
@@ -44,7 +44,7 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)/* Make sure we keep the same behaviour */ static inline int dma_mapping_error (struct device *dev,dma_addr_t dma_addr) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);if (ops->mapping_error)return ops->mapping_error (dev, dma_addr);
@@ -122,7 +122,7 @@ static inline void * dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp) { - struct dma_map_ops *ops = get_dma_ops(dev); + const struct dma_map_ops *ops = get_dma_ops(dev);void *memory; gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
@@ -149,7 +149,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,static inline void dma_free_coherent (struct device *dev,size_t size,void *vaddr,dma_addr_t bus) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);WARN_ON (irqs_disabled ());/* for portability */
arch/x86/include/asm/iommu.h +1 -1
@@ -3,7 +3,7 @@extern void pci_iommu_shutdown (void );extern void no_iommu_init (void ); -extern struct dma_map_ops nommu_dma_ops; +extern const struct dma_map_ops nommu_dma_ops;extern int force_iommu, no_iommu;extern int iommu_detected;extern int iommu_pass_through;
arch/x86/kernel/amd_iommu.c +1 -1
@@ -2069,7 +2069,7 @@ static void prealloc_protection_domains(void) } } -static struct dma_map_ops amd_iommu_dma_ops = { +static const struct dma_map_ops amd_iommu_dma_ops = { .alloc_coherent = alloc_coherent, .free_coherent = free_coherent, .map_page = map_page,
arch/x86/kernel/pci-calgary_64.c +1 -1
@@ -470,7 +470,7 @@ static void calgary_free_coherent(struct device *dev, size_t size,free_pages ((unsigned long )vaddr,get_order (size)); } -static struct dma_map_ops calgary_dma_ops = { +static const struct dma_map_ops calgary_dma_ops = { .alloc_coherent = calgary_alloc_coherent, .free_coherent = calgary_free_coherent, .map_sg = calgary_map_sg,
arch/x86/kernel/pci-dma.c +2 -2
@@ -14,7 +14,7 @@static int forbid_dac__read_mostly ; -struct dma_map_ops *dma_ops; +const struct dma_map_ops *dma_ops;EXPORT_SYMBOL (dma_ops);static int iommu_sac_force__read_mostly ;
@@ -243,7 +243,7 @@ early_param("iommu", iommu_setup);int dma_supported (struct device *dev,u64 mask) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);#ifdef CONFIG_PCI if (mask >0xffffffff && forbid_dac >0 ) {
arch/x86/kernel/pci-gart_64.c +1 -1
@@ -679,7 +679,7 @@ static __init int init_k8_gatt(struct agp_kern_info *info)return -1 ; } -static struct dma_map_ops gart_dma_ops = { +static const struct dma_map_ops gart_dma_ops = { .map_sg = gart_map_sg, .unmap_sg = gart_unmap_sg, .map_page = gart_map_page,
arch/x86/kernel/pci-nommu.c +1 -1
@@ -94,7 +94,7 @@ static void nommu_sync_sg_for_device(struct device *dev,flush_write_buffers (); } -struct dma_map_ops nommu_dma_ops = { +const struct dma_map_ops nommu_dma_ops = { .alloc_coherent = dma_generic_alloc_coherent, .free_coherent = nommu_free_coherent, .map_sg = nommu_map_sg,
arch/x86/kernel/pci-swiotlb.c +1 -1
@@ -25,7 +25,7 @@ static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size,return swiotlb_alloc_coherent (hwdev, size, dma_handle, flags); } -static struct dma_map_ops swiotlb_dma_ops = { +static const struct dma_map_ops swiotlb_dma_ops = { .mapping_error = swiotlb_dma_mapping_error, .alloc_coherent = x86_swiotlb_alloc_coherent, .free_coherent = swiotlb_free_coherent,
drivers/pci/intel-iommu.c +1 -1
@@ -2937,7 +2937,7 @@ static int intel_mapping_error(struct device *dev, dma_addr_t dma_addr)return !dma_addr; } -struct dma_map_ops intel_dma_ops = { +const struct dma_map_ops intel_dma_ops = { .alloc_coherent = intel_alloc_coherent, .free_coherent = intel_free_coherent, .map_sg = intel_map_sg,
include/asm-generic/dma-mapping-common.h +12 -12
@@ -11,7 +11,7 @@ static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,enum dma_data_direction dir, struct dma_attrs *attrs) { - struct dma_map_ops *ops = get_dma_ops(dev); + const struct dma_map_ops *ops = get_dma_ops(dev);dma_addr_t addr;kmemcheck_mark_initialized (ptr, size);
@@ -30,7 +30,7 @@ static inline void dma_unmap_single_attrs(struct device *dev, dma_addr_t addr,enum dma_data_direction dir, struct dma_attrs *attrs) { - struct dma_map_ops *ops = get_dma_ops(dev); + const struct dma_map_ops *ops = get_dma_ops(dev);BUG_ON (!valid_dma_direction (dir));if (ops->unmap_page)
@@ -42,7 +42,7 @@ static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir, struct dma_attrs *attrs) { - struct dma_map_ops *ops = get_dma_ops(dev); + const struct dma_map_ops *ops = get_dma_ops(dev);int i, ents;struct scatterlist *s;
@@ -59,7 +59,7 @@ static inline void dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg int nents, enum dma_data_direction dir, struct dma_attrs *attrs) { - struct dma_map_ops *ops = get_dma_ops(dev); + const struct dma_map_ops *ops = get_dma_ops(dev);BUG_ON (!valid_dma_direction (dir));debug_dma_unmap_sg (dev, sg, nents, dir);
@@ -71,7 +71,7 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, size_t offset, size_t size, enum dma_data_direction dir) { - struct dma_map_ops *ops = get_dma_ops(dev); +const struct dma_map_ops *ops =get_dma_ops (dev);dma_addr_t addr;kmemcheck_mark_initialized (page_address (page) + offset, size);
@@ -85,7 +85,7 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,static inline void dma_unmap_page (struct device *dev,dma_addr_t addr,size_t size,enum dma_data_direction dir) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);BUG_ON (!valid_dma_direction (dir));if (ops->unmap_page)
@@ -97,7 +97,7 @@ static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);BUG_ON (!valid_dma_direction (dir));if (ops->sync_single_for_cpu)
@@ -109,7 +109,7 @@ static inline void dma_sync_single_for_device(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) { - struct dma_map_ops *ops = get_dma_ops(dev); +const struct dma_map_ops *ops =get_dma_ops (dev);BUG_ON (!valid_dma_direction (dir));if (ops->sync_single_for_device)
@@ -123,7 +123,7 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev, size_t size, enum dma_data_direction dir) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);BUG_ON (!valid_dma_direction (dir));if (ops->sync_single_range_for_cpu) {
@@ -140,7 +140,7 @@ static inline void dma_sync_single_range_for_device(struct device *dev, size_t size, enum dma_data_direction dir) { -struct dma_map_ops *ops =get_dma_ops (dev); +const struct dma_map_ops *ops =get_dma_ops (dev);BUG_ON (!valid_dma_direction (dir));if (ops->sync_single_range_for_device) {
@@ -155,7 +155,7 @@ static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction dir) { - struct dma_map_ops *ops = get_dma_ops(dev); + const struct dma_map_ops *ops = get_dma_ops(dev);BUG_ON (!valid_dma_direction (dir));if (ops->sync_sg_for_cpu)
@@ -167,7 +167,7 @@ static inline void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction dir) { - struct dma_map_ops *ops = get_dma_ops(dev); + const struct dma_map_ops *ops = get_dma_ops(dev);BUG_ON (!valid_dma_direction (dir));if (ops->sync_sg_for_device)
include/linux/dma-mapping.h +16 -16
@@ -16,50 +16,50 @@ enum dma_data_direction { };struct dma_map_ops { -void * (*alloc_coherent)(struct device *dev,size_t size, +void * (*const alloc_coherent)(struct device *dev,size_t size,dma_addr_t *dma_handle,gfp_t gfp); -void (*free_coherent)(struct device *dev,size_t size, +void (*const free_coherent)(struct device *dev,size_t size,void *vaddr,dma_addr_t dma_handle); -dma_addr_t (*map_page)(struct device *dev,struct page *page, +dma_addr_t (*const map_page)(struct device *dev,struct page *page,unsigned long offset,size_t size,enum dma_data_direction dir,struct dma_attrs *attrs); -void (*unmap_page)(struct device *dev,dma_addr_t dma_handle, +void (*const unmap_page)(struct device *dev,dma_addr_t dma_handle,size_t size,enum dma_data_direction dir,struct dma_attrs *attrs); -int (*map_sg)(struct device *dev,struct scatterlist *sg, +int (*const map_sg)(struct device *dev,struct scatterlist *sg,int nents,enum dma_data_direction dir,struct dma_attrs *attrs); -void (*unmap_sg)(struct device *dev, +void (*const unmap_sg)(struct device *dev,struct scatterlist *sg,int nents,enum dma_data_direction dir,struct dma_attrs *attrs); -void (*sync_single_for_cpu)(struct device *dev, +void (*const sync_single_for_cpu)(struct device *dev,dma_addr_t dma_handle,size_t size,enum dma_data_direction dir); -void (*sync_single_for_device)(struct device *dev, +void (*const sync_single_for_device)(struct device *dev,dma_addr_t dma_handle,size_t size,enum dma_data_direction dir); -void (*sync_single_range_for_cpu)(struct device *dev, +void (*const sync_single_range_for_cpu)(struct device *dev,dma_addr_t dma_handle,unsigned long offset,size_t size,enum dma_data_direction dir); -void (*sync_single_range_for_device)(struct device *dev, +void (*const sync_single_range_for_device)(struct device *dev,dma_addr_t dma_handle,unsigned long offset,size_t size,enum dma_data_direction dir); -void (*sync_sg_for_cpu)(struct device *dev, +void (*const sync_sg_for_cpu)(struct device *dev,struct scatterlist *sg,int nents,enum dma_data_direction dir); -void (*sync_sg_for_device)(struct device *dev, +void (*const sync_sg_for_device)(struct device *dev,struct scatterlist *sg,int nents,enum dma_data_direction dir); -int (*mapping_error)(struct device *dev,dma_addr_t dma_addr); -int (*dma_supported)(struct device *dev,u64 mask); -int (*set_dma_mask)(struct device *dev,u64 mask); -int is_phys; +int (*const mapping_error)(struct device *dev,dma_addr_t dma_addr); +int (*const dma_supported)(struct device *dev,u64 mask); +int (*const set_dma_mask)(struct device *dev,u64 mask); +const int is_phys; };#define DMA_BIT_MASK (n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
In reply to Emese RevfyQuoted 25 lines · Emese Revfy
drivers/char/pty.c +12
-1@@ -682,7 +682,18 @@ static int ptmx_open(struct inode *inode, struct file *filp)return ret; } -static struct file_operations ptmx_fops; +static const struct file_operations ptmx_fops = { + .llseek = no_llseek, + .read = tty_read, + .write = tty_write, + .poll = tty_poll, + .unlocked_ioctl = tty_ioctl, + .compat_ioctl = tty_compat_ioctl, + .open = ptmx_open, + .release = tty_release, + .fasync = tty_fasync, +}; +static void __init unix98_pty_init (void ) {
drivers/char/pty.c static void __init unix98_pty_init(void) · line 741
Quoted 6 lines
drivers/char/pty.c +0
-3@@ -736,9 +747,6 @@ static void __init unix98_pty_init(void)register_sysctl_table (pty_root_table);/* Now create the /dev/ptmx special device */ -tty_default_fops (&ptmx_fops); - ptmx_fops.open = ptmx_open; -
Apart you CCed hundreds of people and mixed thousand things together into one patch, this makes no sense.
I think the purpose was to not have the fops on multiple places. When one changes tty_fops, he has to change even ptmx_fops from now on. Not that I would say the current approach is clean, but this makes it worse IMO.
And as Greg pointed out, you made many functions global for no real income.
Re: [PATCH 02/31] Constify struct address_space_operations for 2.6.32 v1
In reply to Emese RevfyQuoted 11 lines · Emese Revfy
Quoted 6 lines · Matthew Wilcox
include/linux/fs.h typedef int (*read_actor_t)(read_descriptor_t *, struct page *, · line 568
Quoted 2 lines · Emese Revfy
include/linux/fs.h +1
-1-int (*writepage)(struct page *page,struct writeback_control *wbc); +int (*const writepage)(struct page *page,struct writeback_control *wbc);Umm. What effect does this have?
What changes as a result of this patch?My idea was that since all variables of this type are const, we might as well have the compiler enforce it for the future if you think that these fields should not be writable at all.
The compiler does already enforce it. We do it like this:
struct address_space {
const struct address_space_operations *a_ops; /* methods */
}
Signature · 4 lines
Matthew Wilcox Intel Open Source Technology Centre "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step."
Jens Axboe
Acked-byRe: [PATCH 29/31] Constify struct sysfs_ops for 2.6.32 v1
In reply to Emese RevfyQuoted 4 lines · Emese Revfy
From: Emese Revfy <[email protected]>
Constify struct
sysfs_ops.
Per Dave Miller's suggestion, resend with proper CC list and patch format.
For the block parts:
Signature · 1 line
Jens Axboe
Re: [PATCH 02/31] Constify struct address_space_operations for 2.6.32 v1
In reply to Matthew WilcoxQuoted 11 lines · Matthew Wilcox
Quoted 9 lines · Emese Revfy
Quoted 5 lines · Matthew Wilcox
include/linux/fs.h typedef int (*read_actor_t)(read_descriptor_t *, struct page *, · line 568
Quoted 2 lines · Emese Revfy
include/linux/fs.h +1
-1-int (*writepage)(struct page *page,struct writeback_control *wbc); +int (*const writepage)(struct page *page,struct writeback_control *wbc);Umm. What effect does this have?
What changes as a result of this patch?My idea was that since all variables of this type are const, we might as well have the compiler enforce it for the future if you think that these fields should not be writable at all.
Quoted 5 lines
The compiler does already enforce it. We do it like this:
struct
address_space{
const structaddress_space_operations*a_ops; /* methods */
}
This only ensures that the address_space_operations structure cannot be written through a_ops, but the address_space_operations structure itself can still be writable. My patch fixes the latter issue.
--
Emese
Re: [PATCH 06/31] Constify struct e1000_mac_operations for net-next-2.6 v1
In reply to Emese RevfyFrom: Emese Revfy <[email protected]>
Constify struct e1000_mac_operations with some exceptions.
--- drivers/net/e1000e/82571.c | 3 ++- drivers/net/e1000e/e1000.h | 2 +- drivers/net/e1000e/es2lan.c | 3 ++- drivers/net/e1000e/hw.h | 1 + drivers/net/e1000e/ich8lan.c | 2 +- drivers/net/igb/e1000_82575.c | 2 +- drivers/net/igb/e1000_hw.h | 3 ++- drivers/net/igbvf/vf.h | 1 + 8 files changed, 11 insertions(+), 6 deletions(-)
drivers/net/e1000e/82571.c +2 -1
@@ -207,6 +207,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter) {struct e1000_hw *hw = &adapter->hw;struct e1000_mac_info *mac = &hw->mac; +/* cannot be const, see this function */ struct e1000_mac_operations *func = &mac->ops;u32 swsm =0 ;u32 swsm2 =0 ;
@@ -1692,7 +1693,7 @@ static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw)er32 (ICRXDMTC ); } -static struct e1000_mac_operations e82571_mac_ops = { +static const struct e1000_mac_operations e82571_mac_ops = {/* .check_mng_mode: mac type dependent */ /* .check_for_link: media type dependent */ .id_led_init = e1000e_id_led_init,
drivers/net/e1000e/e1000.h +1 -1
@@ -379,7 +379,7 @@ struct e1000_info {u32 pba;u32 max_hw_frame_size;s32 (*get_variants)(struct e1000_adapter *); -struct e1000_mac_operations *mac_ops; +const struct e1000_mac_operations *mac_ops;struct e1000_phy_operations *phy_ops;struct e1000_nvm_operations *nvm_ops; };
drivers/net/e1000e/es2lan.c +2 -1
@@ -202,6 +202,7 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter) {struct e1000_hw *hw = &adapter->hw;struct e1000_mac_info *mac = &hw->mac; +/* cannot be const, see this function */ struct e1000_mac_operations *func = &mac->ops;/* Set media type */
@@ -1369,7 +1370,7 @@ static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw)er32 (ICRXDMTC ); } -static struct e1000_mac_operations es2_mac_ops = { +static const struct e1000_mac_operations es2_mac_ops = { .id_led_init = e1000e_id_led_init, .check_mng_mode = e1000e_check_mng_mode_generic,/* check_for_link dependent on media type */
drivers/net/e1000e/hw.h +1 -0
@@ -791,6 +791,7 @@ struct e1000_nvm_operations { };struct e1000_mac_info { +/* cannot be const, see drivers/net/e1000e/ich8lan.c:e1000_init_mac_params_ich8lan */ struct e1000_mac_operations ops;u8 addr[6 ];
drivers/net/e1000e/ich8lan.c +1 -1
@@ -3291,7 +3291,7 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw) } } -static struct e1000_mac_operations ich8_mac_ops = { +static const struct e1000_mac_operations ich8_mac_ops = { .id_led_init = e1000e_id_led_init, .check_mng_mode = e1000_check_mng_mode_ich8lan, .check_for_link = e1000_check_for_copper_link_ich8lan,
drivers/net/igb/e1000_82575.c +1 -1
@@ -1585,7 +1585,7 @@ u16 igb_rxpbs_adjust_82580(u32 data)return ret_val; } -static struct e1000_mac_operations e1000_mac_ops_82575 = { +static const struct e1000_mac_operations e1000_mac_ops_82575 = { .init_hw = igb_init_hw_82575, .check_for_link = igb_check_for_link_82575, .rar_set = igb_rar_set,
drivers/net/igb/e1000_hw.h +2 -1
@@ -324,7 +324,7 @@ struct e1000_nvm_operations {struct e1000_info {s32 (*get_invariants)(struct e1000_hw *); -struct e1000_mac_operations *mac_ops; +const struct e1000_mac_operations *mac_ops;struct e1000_phy_operations *phy_ops;struct e1000_nvm_operations *nvm_ops; };
@@ -332,6 +332,7 @@ struct e1000_info {extern const struct e1000_info e1000_82575_info;struct e1000_mac_info { +/* cannot be const, see drivers/net/igb/e1000_82575.c:igb_get_invariants_82575 */ struct e1000_mac_operations ops;u8 addr[6 ];
drivers/net/igbvf/vf.h +1 -0
@@ -189,6 +189,7 @@ struct e1000_mac_operations { };struct e1000_mac_info { +/* cannot be const, see drivers/net/igbvf/vf.c:e1000_init_mac_params_vf */ struct e1000_mac_operations ops;u8 addr[6 ];u8 perm_addr[6 ];
Re: [PATCH 08/31] Constify struct e1000_phy_operations for net-next-2.6 v1
In reply to Emese RevfyFrom: Emese Revfy <[email protected]>
Constify struct e1000_phy_operations with some exceptions.
--- drivers/net/e1000e/82571.c | 6 +++--- drivers/net/e1000e/e1000.h | 2 +- drivers/net/e1000e/es2lan.c | 2 +- drivers/net/e1000e/hw.h | 1 + drivers/net/e1000e/ich8lan.c | 2 +- drivers/net/igb/e1000_82575.c | 2 +- drivers/net/igb/e1000_hw.h | 3 ++- 7 files changed, 10 insertions(+), 8 deletions(-)
drivers/net/e1000e/82571.c +3 -3
@@ -1712,7 +1712,7 @@ static struct e1000_mac_operations e82571_mac_ops = { .setup_led = e1000e_setup_led_generic, }; -static struct e1000_phy_operations e82_phy_ops_igp = { +static const struct e1000_phy_operations e82_phy_ops_igp = { .acquire = e1000_get_hw_semaphore_82571, .check_polarity = e1000_check_polarity_igp, .check_reset_block = e1000e_check_reset_block_generic,
@@ -1730,7 +1730,7 @@ static struct e1000_phy_operations e82_phy_ops_igp = { .cfg_on_link_up = NULL, }; -static struct e1000_phy_operations e82_phy_ops_m88 = { +static const struct e1000_phy_operations e82_phy_ops_m88 = { .acquire = e1000_get_hw_semaphore_82571, .check_polarity = e1000_check_polarity_m88, .check_reset_block = e1000e_check_reset_block_generic,
@@ -1748,7 +1748,7 @@ static struct e1000_phy_operations e82_phy_ops_m88 = { .cfg_on_link_up = NULL, }; -static struct e1000_phy_operations e82_phy_ops_bm = { +static const struct e1000_phy_operations e82_phy_ops_bm = { .acquire = e1000_get_hw_semaphore_82571, .check_polarity = e1000_check_polarity_m88, .check_reset_block = e1000e_check_reset_block_generic,
drivers/net/e1000e/e1000.h +1 -1
@@ -380,7 +380,7 @@ struct e1000_info {u32 max_hw_frame_size;s32 (*get_variants)(struct e1000_adapter *);struct e1000_mac_operations *mac_ops; -struct e1000_phy_operations *phy_ops; +const struct e1000_phy_operations *phy_ops;struct e1000_nvm_operations *nvm_ops; };
drivers/net/e1000e/es2lan.c +1 -1
@@ -1389,7 +1389,7 @@ static struct e1000_mac_operations es2_mac_ops = { .setup_led = e1000e_setup_led_generic, }; -static struct e1000_phy_operations es2_phy_ops = { +static const struct e1000_phy_operations es2_phy_ops = { .acquire = e1000_acquire_phy_80003es2lan, .check_polarity = e1000_check_polarity_m88, .check_reset_block = e1000e_check_reset_block_generic,
drivers/net/e1000e/hw.h +1 -0
@@ -827,6 +827,7 @@ struct e1000_mac_info { };struct e1000_phy_info { +/* cannot be const, see drivers/net/e1000e/82571.c:e1000_init_phy_params_82571 */ struct e1000_phy_operations ops;enum e1000_phy_type type;
drivers/net/e1000e/ich8lan.c +1 -1
@@ -3309,7 +3309,7 @@ static struct e1000_mac_operations ich8_mac_ops = {/* id_led_init dependent on mac type */ }; -static struct e1000_phy_operations ich8_phy_ops = { +static const struct e1000_phy_operations ich8_phy_ops = { .acquire = e1000_acquire_swflag_ich8lan, .check_reset_block = e1000_check_reset_block_ich8lan, .commit =NULL ,
drivers/net/igb/e1000_82575.c +1 -1
@@ -1593,7 +1593,7 @@ static struct e1000_mac_operations e1000_mac_ops_82575 = { .get_speed_and_duplex = igb_get_speed_and_duplex_copper, }; -static struct e1000_phy_operations e1000_phy_ops_82575 = { +static const struct e1000_phy_operations e1000_phy_ops_82575 = { .acquire = igb_acquire_phy_82575, .get_cfg_done = igb_get_cfg_done_82575, .release = igb_release_phy_82575,
drivers/net/igb/e1000_hw.h +2 -1
@@ -325,7 +325,7 @@ struct e1000_nvm_operations {struct e1000_info {s32 (*get_invariants)(struct e1000_hw *);struct e1000_mac_operations *mac_ops; -struct e1000_phy_operations *phy_ops; +const struct e1000_phy_operations *phy_ops;struct e1000_nvm_operations *nvm_ops; };
@@ -377,6 +377,7 @@ struct e1000_mac_info { };struct e1000_phy_info { +/* cannot be const, see drivers/net/igb/e1000_82575.c:igb_get_invariants_82575 */ struct e1000_phy_operations ops;enum e1000_phy_type type;
Re: [PATCH 07/31] Constify struct e1000_nvm_operations for net-next-2.6 v1
In reply to Emese RevfyFrom: Emese Revfy <[email protected]>
Constify struct e1000_nvm_operations with some exceptions.
--- drivers/net/e1000e/82571.c | 2 +- drivers/net/e1000e/e1000.h | 2 +- drivers/net/e1000e/es2lan.c | 2 +- drivers/net/e1000e/hw.h | 16 ++++++++-------- drivers/net/e1000e/ich8lan.c | 2 +- drivers/net/igb/e1000_82575.c | 2 +- drivers/net/igb/e1000_hw.h | 3 ++- 7 files changed, 15 insertions(+), 14 deletions(-)
drivers/net/e1000e/82571.c +1 -1
@@ -1766,7 +1766,7 @@ static struct e1000_phy_operations e82_phy_ops_bm = { .cfg_on_link_up = NULL, }; -static struct e1000_nvm_operations e82571_nvm_ops = { +static const struct e1000_nvm_operations e82571_nvm_ops = { .acquire = e1000_acquire_nvm_82571, .read = e1000e_read_nvm_eerd, .release = e1000_release_nvm_82571,
drivers/net/e1000e/e1000.h +1 -1
@@ -381,7 +381,7 @@ struct e1000_info {s32 (*get_variants)(struct e1000_adapter *);struct e1000_mac_operations *mac_ops;struct e1000_phy_operations *phy_ops; -struct e1000_nvm_operations *nvm_ops; +const struct e1000_nvm_operations *nvm_ops; };/* hardware capability, feature, and workaround flags */
drivers/net/e1000e/es2lan.c +1 -1
@@ -1407,7 +1407,7 @@ static struct e1000_phy_operations es2_phy_ops = { .cfg_on_link_up = e1000_cfg_on_link_up_80003es2lan, }; -static struct e1000_nvm_operations es2_nvm_ops = { +static const struct e1000_nvm_operations es2_nvm_ops = { .acquire = e1000_acquire_nvm_80003es2lan, .read = e1000e_read_nvm_eerd, .release = e1000_release_nvm_80003es2lan,
drivers/net/e1000e/hw.h +8 -8
@@ -781,13 +781,13 @@ struct e1000_phy_operations {/* Function pointers for the NVM. */ struct e1000_nvm_operations { -s32 (*acquire)(struct e1000_hw *); -s32 (*read)(struct e1000_hw *,u16 ,u16 ,u16 *); -void (*release)(struct e1000_hw *); -s32 (*update)(struct e1000_hw *); -s32 (*valid_led_default)(struct e1000_hw *,u16 *); -s32 (*validate)(struct e1000_hw *); -s32 (*write)(struct e1000_hw *,u16 ,u16 ,u16 *); +s32 (*const acquire)(struct e1000_hw *); +s32 (*const read)(struct e1000_hw *,u16 ,u16 ,u16 *); +void (*const release)(struct e1000_hw *); +s32 (*const update)(struct e1000_hw *); +s32 (*const valid_led_default)(struct e1000_hw *,u16 *); +s32 (*const validate)(struct e1000_hw *); +s32 (*const write)(struct e1000_hw *,u16 ,u16 ,u16 *); };struct e1000_mac_info {
@@ -861,7 +861,7 @@ struct e1000_phy_info { };struct e1000_nvm_info { -struct e1000_nvm_operations ops; +const struct e1000_nvm_operations ops;enum e1000_nvm_type type;enum e1000_nvm_override override;
drivers/net/e1000e/ich8lan.c +1 -1
@@ -3323,7 +3323,7 @@ static struct e1000_phy_operations ich8_phy_ops = { .write_reg = e1000e_write_phy_reg_igp, }; -static struct e1000_nvm_operations ich8_nvm_ops = { +static const struct e1000_nvm_operations ich8_nvm_ops = { .acquire = e1000_acquire_nvm_ich8lan, .read = e1000_read_nvm_ich8lan, .release = e1000_release_nvm_ich8lan,
drivers/net/igb/e1000_82575.c +1 -1
@@ -1599,7 +1599,7 @@ static struct e1000_phy_operations e1000_phy_ops_82575 = { .release = igb_release_phy_82575, }; -static struct e1000_nvm_operations e1000_nvm_ops_82575 = { +static const struct e1000_nvm_operations e1000_nvm_ops_82575 = { .acquire = igb_acquire_nvm_82575, .read = igb_read_nvm_eerd, .release = igb_release_nvm_82575,
drivers/net/igb/e1000_hw.h +2 -1
@@ -326,7 +326,7 @@ struct e1000_info {s32 (*get_invariants)(struct e1000_hw *);struct e1000_mac_operations *mac_ops;struct e1000_phy_operations *phy_ops; -struct e1000_nvm_operations *nvm_ops; +const struct e1000_nvm_operations *nvm_ops; };extern const struct e1000_info e1000_82575_info;
@@ -412,6 +412,7 @@ struct e1000_phy_info { };struct e1000_nvm_info { +/* cannot be const, see drivers/net/igb/igb_main.c:igb_probe */ struct e1000_nvm_operations ops;enum e1000_nvm_type type;
Al Viro
maintainerRe: [PATCH 28/31] Constify struct super_operations for 2.6.32 v1
In reply to Emese RevfyQuoted 3 lines · Emese Revfy
From: Emese Revfy <[email protected]>
Constify struct
super_operations.
What the _hell_ is that?
Quoted 1 line
+ struct inode *(* const alloc_inode)(struct
super_block*sb);
This is ugly and has all marks of cargo-cult patches. NAKed at least until you give exceptionally good reasons for doing that.
Re: [PATCH 28/31] Constify struct super_operations for 2.6.32 v1
Quoted 11 lines · Al Viro
Quoted 3 lines · Emese Revfy
From: Emese Revfy <[email protected]>
Constify struct
super_operations.What the _hell_ is that?
Quoted 1 line
+ struct inode *(* const alloc_inode)(struct
super_block*sb);This is ugly and has all marks of cargo-cult patches. NAKed at least until you give exceptionally good reasons for doing that.
My idea was that since each instance of super_operations is const, I figured that there is an implicit policy of not wanting writable super_operations structures in the kernel. If this is actually the case then my patch makes the compiler enforce this policy, otherwise please ignore it.
--
Emese
Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
In reply to Greg KHQuoted 17 lines · Greg KH
Quoted 16 lines · Emese Revfy
Quoted 15 lines · Greg KH
drivers/char/pty.c static int ptmx_open(struct inode *inode, struct file *filp) · line 695
Quoted 12 lines · Emese Revfy
drivers/char/pty.c +11
-1-static struct file_operations ptmx_fops; +static const struct file_operations ptmx_fops = { + .llseek = no_llseek, + .read = tty_read, + .write = tty_write, + .poll = tty_poll, + .unlocked_ioctl = tty_ioctl, + .compat_ioctl = tty_compat_ioctl, + .open = ptmx_open, + .release = tty_release, + .fasync = tty_fasync, +};You just made these functions all global, for no real good reason. Why did you do this?
Quoted 3 lines
Quoted 1 line
I think this is the only way to make
ptmx_fopsconst, provided we want to.Why do we want to?
Because I saw that checkpatch.pl itself tries to ensure the same I went through the whole tree looking for non-const file_operations structures and tried to make them const as best as I could. If you think making ptmx_fops const is not worth the effort I will remove it from the patch. --
Emese
Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
In reply to Jiri SlabyQuoted 1 line · Jiri Slaby
Apart you CCed hundreds of people
I looked up the maintainers of the patched files from the kernel sources because I didn't know a better way to let everyone affected know.
Quoted 1 line
and mixed thousand things together into one patch,
I thought that the best way is to have one patch contain changes for a single structure type only.
--
Emese
Pekka Enberg
Acked-byRe: [PATCH 29/31] Constify struct sysfs_ops for 2.6.32 v1
In reply to Jens AxboeQuoted 9 lines · Jens Axboe
Quoted 4 lines · Emese Revfy
From: Emese Revfy <[email protected]>
Constify struct
sysfs_ops.
Per Dave Miller's suggestion, resend with proper CC list and patch format.For the block parts:
Acked-by Jens Axboe <[email protected]>
For the SLUB parts:
Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
In reply to Emese RevfyQuoted 5 lines · Emese Revfy
Quoted 1 line · Jiri Slaby
Apart you CCed hundreds of people
I looked up the maintainers of the patched files from the kernel sources because I didn't know a better way to let everyone affected know.
Well, if you had per subsystem patches, you would Cc only relevant people per patch.
Quoted 4 lines
Quoted 1 line
and mixed thousand things together into one patch,
I thought that the best way is to have one patch contain changes for a single structure type only.
The problem is that probably nobody will pick them up. Or you would need to collect Acks from all participants and run with these to Andrew Morton. Then it's up to him if he wants to merge them. If you split them, you can ask concrete maintainers for a merge.
Signature · 1 line
js
Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
In reply to Emese RevfyQuoted 18 lines · Emese Revfy
Quoted 17 lines · Greg KH
Quoted 16 lines · Emese Revfy
Quoted 15 lines · Greg KH
drivers/char/pty.c static int ptmx_open(struct inode *inode, struct file *filp) · line 695
Quoted 12 lines · Emese Revfy
drivers/char/pty.c +11
-1-static struct file_operations ptmx_fops; +static const struct file_operations ptmx_fops = { + .llseek = no_llseek, + .read = tty_read, + .write = tty_write, + .poll = tty_poll, + .unlocked_ioctl = tty_ioctl, + .compat_ioctl = tty_compat_ioctl, + .open = ptmx_open, + .release = tty_release, + .fasync = tty_fasync, +};You just made these functions all global, for no real good reason. Why did you do this?
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
I think this is the only way to make
ptmx_fopsconst, provided we want to.Why do we want to?
Because I saw that checkpatch.pl itself tries to ensure the same I went through the whole tree looking for non-const
file_operationsstructures and tried to make them const as best as I could. If you think makingptmx_fopsconst is not worth the effort I will remove it from the patch.
Based on the patch, I would think it is not worth it.
thanks,
greg k-h
Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
Quoted 26 lines · Greg KH
Quoted 18 lines · Emese Revfy
Quoted 17 lines · Greg KH
Quoted 16 lines · Emese Revfy
Quoted 15 lines · Greg KH
Review
Quoted 12 lines · Emese Revfy
(quoted diff) +11
-1-static struct file_operations ptmx_fops; +static const struct file_operations ptmx_fops = { + .llseek = no_llseek, + .read = tty_read, + .write = tty_write, + .poll = tty_poll, + .unlocked_ioctl = tty_ioctl, + .compat_ioctl = tty_compat_ioctl, + .open = ptmx_open, + .release = tty_release, + .fasync = tty_fasync, +};You just made these functions all global, for no real good reason. Why did you do this?
Quoted 6 lines
Quoted 2 lines
Quoted 1 line
I think this is the only way to make
ptmx_fopsconst, provided we want to.Why do we want to?
Because I saw that checkpatch.pl itself tries to ensure the same I went through the whole tree looking for non-const
file_operationsstructures and tried to make them const as best as I could. If you think makingptmx_fopsconst is not worth the effort I will remove it from the patch.
Quoted 6 lines
Based on the patch, I would think it is not worth it.
thanks,
greg k-h
Ok, I removed the affected hunks.
From: Emese Revfy <[email protected]>
Constify struct file_operations with some exceptions.
--- drivers/acpi/battery.c | 2 +- drivers/char/pty.c | 1 + drivers/char/tty_io.c | 1 + drivers/media/dvb/dvb-core/dvbdev.c | 1 + drivers/net/wireless/b43/debugfs.c | 2 +- drivers/net/wireless/b43legacy/debugfs.c | 2 +- drivers/net/wireless/libertas/debugfs.c | 2 +- drivers/staging/b3dfg/b3dfg.c | 2 +- drivers/staging/dream/qdsp5/adsp_driver.c | 2 +- drivers/staging/dream/qdsp5/audio_aac.c | 2 +- drivers/staging/dream/qdsp5/audio_amrnb.c | 2 +- drivers/staging/dream/qdsp5/audio_evrc.c | 2 +- drivers/staging/dream/qdsp5/audio_in.c | 4 ++-- drivers/staging/dream/qdsp5/audio_mp3.c | 2 +- drivers/staging/dream/qdsp5/audio_out.c | 4 ++-- drivers/staging/dream/qdsp5/audio_qcelp.c | 2 +- drivers/staging/dream/qdsp5/snd.c | 2 +- drivers/staging/dream/smd/smd_qmi.c | 2 +- drivers/staging/dream/smd/smd_rpcrouter_device.c | 4 ++-- drivers/staging/panel/panel.c | 4 ++-- drivers/staging/poch/poch.c | 2 +- drivers/staging/sep/sep_driver.c | 2 +- drivers/staging/vme/devices/vme_user.c | 2 +- fs/char_dev.c | 1 + fs/fuse/cuse.c | 19 ++++++++++++------- fs/fuse/dev.c | 8 ++++---- fs/fuse/fuse_i.h | 10 ++++++++++ virt/kvm/kvm_main.c | 3 +++ 28 files changed, 57 insertions(+), 35 deletions(-)
drivers/acpi/battery.c +1 -1
@@ -763,7 +763,7 @@ DECLARE_FILE_FUNCTIONS(alarm); }static struct battery_file { -struct file_operations ops; +const struct file_operations ops;mode_t mode;const char *name; } acpi_battery_file[] = {
drivers/char/pty.c +1 -0
@@ -682,6 +682,7 @@ static int ptmx_open(struct inode *inode, struct file *filp)return ret; } +/* cannot be const, see unix98_pty_init */ static struct file_operations ptmx_fops;static void __init unix98_pty_init (void )
drivers/char/tty_io.c +1 -0
@@ -3046,6 +3046,7 @@ struct tty_struct *get_current_tty(void) }EXPORT_SYMBOL_GPL (get_current_tty); +/* cannot be const, see this function */ void tty_default_fops (struct file_operations *fops) { *fops = tty_fops;
drivers/media/dvb/dvb-core/dvbdev.c +1 -0
@@ -191,6 +191,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, const struct dvb_device *template, void *priv, int type) { struct dvb_device *dvbdev; +/* cannot be const, see this function */ struct file_operations *dvbdevfops;struct device *clsdev;int minor;
drivers/net/wireless/b43/debugfs.c +1 -1
@@ -43,7 +43,7 @@ static struct dentry *rootdir;struct b43_debugfs_fops {ssize_t (*read)(struct b43_wldev *dev,char *buf,size_t bufsize);int (*write)(struct b43_wldev *dev,const char *buf,size_t count); -struct file_operations fops; +const struct file_operations fops;/* Offset of struct b43_dfs_file in struct b43_dfsentry */ size_t file_struct_offset; };
drivers/net/wireless/b43legacy/debugfs.c +1 -1
@@ -44,7 +44,7 @@ static struct dentry *rootdir;struct b43legacy_debugfs_fops {ssize_t (*read)(struct b43legacy_wldev *dev,char *buf,size_t bufsize);int (*write)(struct b43legacy_wldev *dev,const char *buf,size_t count); -struct file_operations fops; +const struct file_operations fops;/* Offset of struct b43legacy_dfs_file in struct b43legacy_dfsentry */ size_t file_struct_offset;/* Take wl->irq_lock before calling read/write? */
drivers/net/wireless/libertas/debugfs.c +1 -1
@@ -708,7 +708,7 @@ out_unlock:struct lbs_debugfs_files {const char *name;int perm; -struct file_operations fops; +const struct file_operations fops; };static const struct lbs_debugfs_files debugfs_files[] = {
drivers/staging/b3dfg/b3dfg.c +1 -1
@@ -848,7 +848,7 @@ static int b3dfg_mmap(struct file *filp, struct vm_area_struct *vma)return r; } -static struct file_operations b3dfg_fops = { +static const struct file_operations b3dfg_fops = { .owner =THIS_MODULE , .open = b3dfg_open, .release = b3dfg_release,
drivers/staging/dream/qdsp5/adsp_driver.c +1 -1
@@ -576,7 +576,7 @@ static struct adsp_device *inode_to_device(struct inode *inode)static dev_t adsp_devno;static struct class *adsp_class; -static struct file_operations adsp_fops = { +static const struct file_operations adsp_fops = { .owner =THIS_MODULE , .open = adsp_open, .unlocked_ioctl = adsp_ioctl,
drivers/staging/dream/qdsp5/audio_aac.c +1 -1
@@ -1022,7 +1022,7 @@ done:return rc; } -static struct file_operations audio_aac_fops = { +static const struct file_operations audio_aac_fops = { .owner =THIS_MODULE , .open = audio_open, .release = audio_release,
drivers/staging/dream/qdsp5/audio_amrnb.c +1 -1
@@ -833,7 +833,7 @@ done:return rc; } -static struct file_operations audio_amrnb_fops = { +static const struct file_operations audio_amrnb_fops = { .owner =THIS_MODULE , .open = audamrnb_open, .release = audamrnb_release,
drivers/staging/dream/qdsp5/audio_evrc.c +1 -1
@@ -805,7 +805,7 @@ dma_fail:return rc; } -static struct file_operations audio_evrc_fops = { +static const struct file_operations audio_evrc_fops = { .owner =THIS_MODULE , .open = audevrc_open, .release = audevrc_release,
drivers/staging/dream/qdsp5/audio_in.c +2 -2
@@ -913,7 +913,7 @@ static int audpre_open(struct inode *inode, struct file *file)return 0 ; } -static struct file_operations audio_fops = { +static const struct file_operations audio_fops = { .owner =THIS_MODULE , .open = audio_in_open, .release = audio_in_release,
@@ -922,7 +922,7 @@ static struct file_operations audio_fops = { .unlocked_ioctl = audio_in_ioctl, }; -static struct file_operations audpre_fops = { +static const struct file_operations audpre_fops = { .owner =THIS_MODULE , .open = audpre_open, .unlocked_ioctl = audpre_ioctl,
drivers/staging/dream/qdsp5/audio_mp3.c +1 -1
@@ -941,7 +941,7 @@ done:return rc; } -static struct file_operations audio_mp3_fops = { +static const struct file_operations audio_mp3_fops = { .owner =THIS_MODULE , .open = audio_open, .release = audio_release,
drivers/staging/dream/qdsp5/audio_out.c +2 -2
@@ -810,7 +810,7 @@ static int audpp_open(struct inode *inode, struct file *file)return 0 ; } -static struct file_operations audio_fops = { +static const struct file_operations audio_fops = { .owner =THIS_MODULE , .open = audio_open, .release = audio_release,
@@ -819,7 +819,7 @@ static struct file_operations audio_fops = { .unlocked_ioctl = audio_ioctl, }; -static struct file_operations audpp_fops = { +static const struct file_operations audpp_fops = { .owner =THIS_MODULE , .open = audpp_open, .unlocked_ioctl = audpp_ioctl,
drivers/staging/dream/qdsp5/audio_qcelp.c +1 -1
@@ -816,7 +816,7 @@ err:return rc; } -static struct file_operations audio_qcelp_fops = { +static const struct file_operations audio_qcelp_fops = { .owner =THIS_MODULE , .open = audqcelp_open, .release = audqcelp_release,
drivers/staging/dream/qdsp5/snd.c +1 -1
@@ -242,7 +242,7 @@ err:return rc; } -static struct file_operations snd_fops = { +static const struct file_operations snd_fops = { .owner =THIS_MODULE , .open = snd_open, .release = snd_release,
drivers/staging/dream/smd/smd_qmi.c +1 -1
@@ -793,7 +793,7 @@ static int qmi_release(struct inode *ip, struct file *fp)return 0 ; } -static struct file_operations qmi_fops = { +static const struct file_operations qmi_fops = { .owner =THIS_MODULE , .read = qmi_read, .write = qmi_write,
drivers/staging/dream/smd/smd_rpcrouter_device.c +2 -2
@@ -214,7 +214,7 @@ static long rpcrouter_ioctl(struct file *filp, unsigned int cmd,return rc; } -static struct file_operations rpcrouter_server_fops = { +static const struct file_operations rpcrouter_server_fops = { .owner =THIS_MODULE , .open = rpcrouter_open, .release = rpcrouter_release,
@@ -224,7 +224,7 @@ static struct file_operations rpcrouter_server_fops = { .unlocked_ioctl = rpcrouter_ioctl, }; -static struct file_operations rpcrouter_router_fops = { +static const struct file_operations rpcrouter_router_fops = { .owner =THIS_MODULE , .open = rpcrouter_open, .release = rpcrouter_release,
drivers/staging/panel/panel.c +2 -2
@@ -1305,7 +1305,7 @@ static int lcd_release(struct inode *inode, struct file *file)return 0 ; } -static struct file_operations lcd_fops = { +static const struct file_operations lcd_fops = { .write = lcd_write, .open = lcd_open, .release = lcd_release,
@@ -1565,7 +1565,7 @@ static int keypad_release(struct inode *inode, struct file *file)return 0 ; } -static struct file_operations keypad_fops = { +static const struct file_operations keypad_fops = { .read = keypad_read,/* read */ .open = keypad_open,/* open */ .release = keypad_release,/* close */
drivers/staging/poch/poch.c +1 -1
@@ -1057,7 +1057,7 @@ static int poch_ioctl(struct inode *inode, struct file *filp,return 0 ; } -static struct file_operations poch_fops = { +static const struct file_operations poch_fops = { .owner =THIS_MODULE , .open = poch_open, .release = poch_release,
drivers/staging/sep/sep_driver.c +1 -1
@@ -2603,7 +2603,7 @@ static struct pci_driver sep_pci_driver = {static dev_t sep_devno;/* the files operations structure of the driver */ -static struct file_operations sep_file_operations = { +static const struct file_operations sep_file_operations = { .owner =THIS_MODULE , .ioctl = sep_ioctl, .poll = sep_poll,
drivers/staging/vme/devices/vme_user.c +1 -1
@@ -136,7 +136,7 @@ static int vme_user_ioctl(struct inode *, struct file *, unsigned int,static int __init vme_user_probe (struct device *,int ,int ); static int __exit vme_user_remove(struct device *, int, int); -static struct file_operations vme_user_fops = { +static const struct file_operations vme_user_fops = { .open = vme_user_open, .release = vme_user_release, .read = vme_user_read,
fs/char_dev.c +1 -0
@@ -547,6 +547,7 @@ struct cdev *cdev_alloc(void)* Initializes @cdev, remembering @fops, making it ready to add to the * system with cdev_add(). */ +void cdev_init (struct cdev *cdev,const struct file_operations *fops) {memset (cdev,0 ,sizeof *cdev);
fs/fuse/cuse.c +12 -7
@@ -528,7 +528,18 @@ static int cuse_channel_release(struct inode *inode, struct file *file)return rc; } -static struct file_operations cuse_channel_fops;/* initialized during init */ +static const struct file_operations cuse_channel_fops = {/* initialized during init */ + .owner =THIS_MODULE , + .llseek = no_llseek, + .read = do_sync_read, + .aio_read = fuse_dev_read, + .write = do_sync_write, + .aio_write = fuse_dev_write, + .poll = fuse_dev_poll, + .open = cuse_channel_open, + .release = cuse_channel_release, + .fasync = fuse_dev_fasync, +};/**************************************************************************
@@ -575,12 +586,6 @@ static int __init cuse_init(void)for (i =0 ; i <CUSE_CONNTBL_LEN ; i++)INIT_LIST_HEAD (&cuse_conntbl[i]); -/* inherit and extend fuse_dev_operations */ - cuse_channel_fops = fuse_dev_operations; - cuse_channel_fops.owner =THIS_MODULE ; - cuse_channel_fops.open = cuse_channel_open; - cuse_channel_fops.release = cuse_channel_release; - cuse_class =class_create (THIS_MODULE ,"cuse" );if (IS_ERR (cuse_class))return PTR_ERR (cuse_class);
fs/fuse/dev.c +4 -4
@@ -745,7 +745,7 @@ __releases(&fc->lock)* request_end(). Otherwise add it to the processing list, and set * the 'sent' flag. */ -static ssize_t fuse_dev_read (struct kiocb *iocb,const struct iovec *iov, +ssize_t fuse_dev_read (struct kiocb *iocb,const struct iovec *iov,unsigned long nr_segs,loff_t pos) {int err;
@@ -987,7 +987,7 @@ static int copy_out_args(struct fuse_copy_state *cs, struct fuse_out *out,* it from the list and copy the rest of the buffer to the request. * The request is finished by calling request_end() */ -static ssize_t fuse_dev_write (struct kiocb *iocb,const struct iovec *iov, +ssize_t fuse_dev_write (struct kiocb *iocb,const struct iovec *iov,unsigned long nr_segs,loff_t pos) {int err;
@@ -1084,7 +1084,7 @@ static ssize_t fuse_dev_write(struct kiocb *iocb, const struct iovec *iov,return err; } -static unsigned fuse_dev_poll (struct file *file,poll_table *wait) +unsigned fuse_dev_poll (struct file *file,poll_table *wait) {unsigned mask =POLLOUT |POLLWRNORM ;struct fuse_conn *fc =fuse_get_conn (file);
@@ -1210,7 +1210,7 @@ int fuse_dev_release(struct inode *inode, struct file *file) }EXPORT_SYMBOL_GPL (fuse_dev_release); -static int fuse_dev_fasync (int fd,struct file *file,int on) +int fuse_dev_fasync (int fd,struct file *file,int on) {struct fuse_conn *fc =fuse_get_conn (file);if (!fc)
fs/fuse/fuse_i.h +10 -0
@@ -521,6 +521,16 @@ extern const struct file_operations fuse_dev_operations;extern const struct dentry_operations fuse_dentry_operations; +extern ssize_t fuse_dev_read (struct kiocb *iocb,const struct iovec *iov, +unsigned long nr_segs,loff_t pos); + +extern ssize_t fuse_dev_write (struct kiocb *iocb,const struct iovec *iov, +unsigned long nr_segs,loff_t pos); + +extern unsigned fuse_dev_poll (struct file *file,poll_table *wait); + +extern int fuse_dev_fasync (int fd,struct file *file,int on); +/** * Inode to nodeid comparison. */
virt/kvm/kvm_main.c +3 -0
@@ -1745,6 +1745,7 @@ static int kvm_vcpu_release(struct inode *inode, struct file *filp)return 0 ; } +/* cannot be const, see kvm_init */ static struct file_operations kvm_vcpu_fops = { .release = kvm_vcpu_release, .unlocked_ioctl = kvm_vcpu_ioctl,
@@ -2341,6 +2342,7 @@ static int kvm_vm_mmap(struct file *file, struct vm_area_struct *vma)return 0 ; } +/* cannot be const, see kvm_init */ static struct file_operations kvm_vm_fops = { .release = kvm_vm_release, .unlocked_ioctl = kvm_vm_ioctl,
@@ -2428,6 +2430,7 @@ out:return r; } +/* cannot be const, see kvm_init */ static struct file_operations kvm_chardev_ops = { .unlocked_ioctl = kvm_dev_ioctl, .compat_ioctl = kvm_dev_ioctl,
Hans J. Koch
Acked-byRe: [PATCH 29/31] Constify struct sysfs_ops for 2.6.32 v1
In reply to Emese RevfyQuoted 6 lines · Emese Revfy
From: Emese Revfy <[email protected]>
Constify struct
sysfs_ops.
Per Dave Miller's suggestion, resend with proper CC list and patch format.Signed-off-by Emese Revfy <[email protected]>
For the Userspace I/O part:
Quoted 1 line
---
[...]
Quoted 1 line
drivers/uio/uio.c | 4 ++--
[...]
Quoted 21 lines
drivers/uio/uio.c +2
-2@@ -129,7 +129,7 @@ static ssize_t map_type_show(struct kobject *kobj, struct attribute *attr,return entry->show (mem, buf); } -static struct sysfs_ops map_sysfs_ops = { +static const struct sysfs_ops map_sysfs_ops = { .show = map_type_show, };@@ -217,7 +217,7 @@ static ssize_t portio_type_show(struct kobject *kobj, struct attribute *attr,return entry->show (port, buf); } -static struct sysfs_ops portio_sysfs_ops = { +static const struct sysfs_ops portio_sysfs_ops = { .show = portio_type_show, };
Re: [PATCH 09/31] Constify struct extent_io_ops for 2.6.32 v1
In reply to Emese RevfyQuoted 11 lines · Emese Revfy
From: Emese Revfy <[email protected]>
Constify struct
extent_io_ops.Signed-off-by Emese Revfy <[email protected]>--- fs/btrfs/disk-io.c | 4 ++-- fs/btrfs/extent_io.h | 30 +++++++++++++++--------------- fs/btrfs/inode.c | 4 ++-- 3 files changed, 19 insertions(+), 19 deletions(-)
Thanks, I'll pick this up in the btrfs tree unless Linus has already grabbed it.
-chris
Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
In reply to Emese RevfyQuoted 31 lines · Emese Revfy
Quoted 30 lines · Greg KH
Quoted 18 lines · Emese Revfy
Quoted 17 lines · Greg KH
Quoted 16 lines · Emese Revfy
Quoted 15 lines · Greg KH
Review
Quoted 12 lines · Emese Revfy
(quoted diff) +11
-1-static struct file_operations ptmx_fops; +static const struct file_operations ptmx_fops = { + .llseek = no_llseek, + .read = tty_read, + .write = tty_write, + .poll = tty_poll, + .unlocked_ioctl = tty_ioctl, + .compat_ioctl = tty_compat_ioctl, + .open = ptmx_open, + .release = tty_release, + .fasync = tty_fasync, +};You just made these functions all global, for no real good reason. Why did you do this?
Quoted 6 lines
Quoted 2 lines
Quoted 1 line
I think this is the only way to make
ptmx_fopsconst, provided we want to.Why do we want to?
Because I saw that checkpatch.pl itself tries to ensure the same I went through the whole tree looking for non-const
file_operationsstructures and tried to make them const as best as I could. If you think makingptmx_fopsconst is not worth the effort I will remove it from the patch.Based on the patch, I would think it is not worth it.
thanks,
Quoted 7 lines
Quoted 2 lines
greg k-h
Ok, I removed the affected hunks.
From: Emese Revfy <[email protected]>
Constify struct
file_operationswith some exceptions.
Now please break this patch (and your others) out into "one subsystem at a time" type thing so it will have a chance at being applied.
thanks,
greg k-h
Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
Quoted 6 lines
Quoted 3 lines
From: Emese Revfy <[email protected]>
Constify struct
file_operationswith some exceptions.Now please break this patch (and your others) out into "one subsystem at a time" type thing so it will have a chance at being applied.
Shall i split them up per subsystem and structure type or only per subsystem (that is, include all affected structures in the given subsystem)?
--
Emese
Re: [PATCH 29/31] Constify struct sysfs_ops for 2.6.32 v1
In reply to Emese RevfyQuoted 8 lines · Emese Revfy
From: Emese Revfy <[email protected]>
Constify struct
sysfs_ops.Signed-off-by Emese Revfy <[email protected]>--- drivers/firmware/edd.c | 2 +- drivers/firmware/efivars.c | 2 +-
Signature · 3 lines
Matt Domsch Technology Strategist, Dell Office of the CTO linux.dell.com & www.dell.com/linux
Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
In reply to Emese RevfyQuoted 10 lines · Emese Revfy
Quoted 6 lines
Quoted 3 lines
From: Emese Revfy <[email protected]>
Constify struct
file_operationswith some exceptions.Now please break this patch (and your others) out into "one subsystem at a time" type thing so it will have a chance at being applied.
Shall i split them up per subsystem and structure type or only per subsystem (that is, include all affected structures in the given subsystem)?
Both.
thanks,
greg k-h
Re: [PATCH 21/31] Constify struct mtrr_ops for 2.6.32 v1
In reply to Emese RevfyQuoted 4 lines · Emese Revfy
From: Emese Revfy <[email protected]>
Constify struct
mtrr_ops.
Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.
Re: [PATCH 29/31] Constify struct sysfs_ops for 2.6.32 v1
In reply to Emese RevfyQuoted 7 lines · Emese Revfy
From: Emese Revfy <[email protected]>
Constify struct
sysfs_ops.Signed-off-by Emese Revfy <[email protected]>--- fs/dlm/lockspace.c | 2 +-
Re: [PATCH 09/31] Constify struct extent_io_ops for 2.6.32 v1
In reply to Chris MasonQuoted 13 lines · Chris Mason
Quoted 11 lines · Emese Revfy
From: Emese Revfy <[email protected]>
Constify struct
extent_io_ops.Signed-off-by Emese Revfy <[email protected]>--- fs/btrfs/disk-io.c | 4 ++-- fs/btrfs/extent_io.h | 30 +++++++++++++++--------------- fs/btrfs/inode.c | 4 ++-- 3 files changed, 19 insertions(+), 19 deletions(-)
Quoted 4 lines
Thanks, I'll pick this up in the btrfs tree unless Linus has already grabbed it.
-chris
He hasn't responded so far, so feel free to pick it up yourself. Thanks, Emese