From 48c7f1c089354a87f0f958a998cb07683d9b7f1f Mon Sep 17 00:00:00 2001 From: Owain Ainsworth Date: Fri, 3 Apr 2009 14:16:24 +0000 Subject: Sprinkle some const correctness for the pciid lists. From mickey ages ago. --- sys/dev/pci/drm/drmP.h | 5 +++-- sys/dev/pci/drm/drm_drv.c | 8 ++++---- sys/dev/pci/drm/i915_drv.c | 4 ++-- sys/dev/pci/drm/mach64_drv.c | 2 +- sys/dev/pci/drm/mga_drv.c | 4 ++-- sys/dev/pci/drm/r128_drv.c | 2 +- sys/dev/pci/drm/radeon_drv.c | 4 ++-- sys/dev/pci/drm/radeon_state.c | 2 +- sys/dev/pci/drm/savage_drv.c | 4 ++-- sys/dev/pci/drm/sis_drv.c | 2 +- sys/dev/pci/drm/tdfx_drv.c | 2 +- 11 files changed, 20 insertions(+), 19 deletions(-) (limited to 'sys/dev/pci/drm') diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h index 0b41514d33a..1e3c9cc8b01 100644 --- a/sys/dev/pci/drm/drmP.h +++ b/sys/dev/pci/drm/drmP.h @@ -473,7 +473,7 @@ struct drm_attach_args { extern int drm_debug_flag; /* Device setup support (drm_drv.c) */ -int drm_pciprobe(struct pci_attach_args *, drm_pci_id_list_t * ); +int drm_pciprobe(struct pci_attach_args *, const drm_pci_id_list_t * ); struct device *drm_attach_pci(const struct drm_driver_info *, struct pci_attach_args *, int, struct device *); dev_type_ioctl(drmioctl); @@ -485,7 +485,8 @@ struct drm_dmamem *drm_dmamem_alloc(bus_dma_tag_t, bus_size_t, bus_size_t, int, bus_size_t, int, int); void drm_dmamem_free(bus_dma_tag_t, struct drm_dmamem *); -drm_pci_id_list_t *drm_find_description(int , int , drm_pci_id_list_t *); +const drm_pci_id_list_t *drm_find_description(int , int , + const drm_pci_id_list_t *); /* File operations helpers (drm_fops.c) */ struct drm_file *drm_find_file_by_minor(struct drm_device *, int); diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c index 6405ad2b54f..28c97ae7aab 100644 --- a/sys/dev/pci/drm/drm_drv.c +++ b/sys/dev/pci/drm/drm_drv.c @@ -103,9 +103,9 @@ drmprint(void *aux, const char *pnp) } int -drm_pciprobe(struct pci_attach_args *pa, drm_pci_id_list_t *idlist) +drm_pciprobe(struct pci_attach_args *pa, const drm_pci_id_list_t *idlist) { - drm_pci_id_list_t *id_entry; + const drm_pci_id_list_t *id_entry; id_entry = drm_find_description(PCI_VENDOR(pa->pa_id), PCI_PRODUCT(pa->pa_id), idlist); @@ -241,8 +241,8 @@ struct cfdriver drm_cd = { 0, "drm", DV_DULL }; -drm_pci_id_list_t * -drm_find_description(int vendor, int device, drm_pci_id_list_t *idlist) +const drm_pci_id_list_t * +drm_find_description(int vendor, int device, const drm_pci_id_list_t *idlist) { int i = 0; diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c index 70ec61b25c0..918ee6f0244 100644 --- a/sys/dev/pci/drm/i915_drv.c +++ b/sys/dev/pci/drm/i915_drv.c @@ -40,7 +40,7 @@ void inteldrm_attach(struct device *, struct device *, void *); int inteldrm_detach(struct device *, int); int inteldrm_ioctl(struct drm_device *, u_long, caddr_t, struct drm_file *); -static drm_pci_id_list_t inteldrm_pciidlist[] = { +const static drm_pci_id_list_t inteldrm_pciidlist[] = { {PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82830M_IGD, CHIP_I830|CHIP_M}, {PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82845G_IGD, @@ -125,7 +125,7 @@ inteldrm_attach(struct device *parent, struct device *self, void *aux) struct drm_i915_private *dev_priv = (struct drm_i915_private *)self; struct pci_attach_args *pa = aux; struct vga_pci_bar *bar; - drm_pci_id_list_t *id_entry; + const drm_pci_id_list_t *id_entry; id_entry = drm_find_description(PCI_VENDOR(pa->pa_id), PCI_PRODUCT(pa->pa_id), inteldrm_pciidlist); diff --git a/sys/dev/pci/drm/mach64_drv.c b/sys/dev/pci/drm/mach64_drv.c index e60ffefa114..3f3b2c304a4 100644 --- a/sys/dev/pci/drm/mach64_drv.c +++ b/sys/dev/pci/drm/mach64_drv.c @@ -43,7 +43,7 @@ void machdrm_attach(struct device *, struct device *, void *); int machdrm_detach(struct device *, int); int machdrm_ioctl(struct drm_device *, u_long, caddr_t, struct drm_file *); -static drm_pci_id_list_t mach64_pciidlist[] = { +const static drm_pci_id_list_t mach64_pciidlist[] = { {PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_GI}, {PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_GP}, {PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MACH64_GQ}, diff --git a/sys/dev/pci/drm/mga_drv.c b/sys/dev/pci/drm/mga_drv.c index 9f110f1d50f..5c6ffba8533 100644 --- a/sys/dev/pci/drm/mga_drv.c +++ b/sys/dev/pci/drm/mga_drv.c @@ -44,7 +44,7 @@ int mgadrm_ioctl(struct drm_device *, u_long, caddr_t, struct drm_file *); #define MGA_DEFAULT_USEC_TIMEOUT 10000 -static drm_pci_id_list_t mgadrm_pciidlist[] = { +const static drm_pci_id_list_t mgadrm_pciidlist[] = { {PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_MILL_II_G200_PCI, MGA_CARD_TYPE_G200}, {PCI_VENDOR_MATROX, PCI_PRODUCT_MATROX_MILL_II_G200_AGP, @@ -138,7 +138,7 @@ mgadrm_attach(struct device *parent, struct device *self, void *aux) drm_mga_private_t *dev_priv = (drm_mga_private_t *)self; struct pci_attach_args *pa = aux; struct vga_pci_bar *bar; - drm_pci_id_list_t *id_entry; + const drm_pci_id_list_t *id_entry; int is_agp; dev_priv->usec_timeout = MGA_DEFAULT_USEC_TIMEOUT; diff --git a/sys/dev/pci/drm/r128_drv.c b/sys/dev/pci/drm/r128_drv.c index a2fd3c38c3e..653109085fb 100644 --- a/sys/dev/pci/drm/r128_drv.c +++ b/sys/dev/pci/drm/r128_drv.c @@ -41,7 +41,7 @@ void ragedrm_attach(struct device *, struct device *, void *); int ragedrm_detach(struct device *, int); int ragedrm_ioctl(struct drm_device *, u_long, caddr_t, struct drm_file *); -static drm_pci_id_list_t ragedrm_pciidlist[] = { +const static drm_pci_id_list_t ragedrm_pciidlist[] = { {PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RAGE128_LE}, {PCI_VENDOR_ATI, PCI_PRODUCT_ATI_MOBILITY_M3}, {PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RAGE128_MF}, diff --git a/sys/dev/pci/drm/radeon_drv.c b/sys/dev/pci/drm/radeon_drv.c index 1561962b452..1677669fca5 100644 --- a/sys/dev/pci/drm/radeon_drv.c +++ b/sys/dev/pci/drm/radeon_drv.c @@ -41,7 +41,7 @@ int radeondrm_ioctl(struct drm_device *, u_long, caddr_t, struct drm_file *); int radeon_no_wb; -static drm_pci_id_list_t radeondrm_pciidlist[] = { +const static drm_pci_id_list_t radeondrm_pciidlist[] = { {PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RADEON_M241P, CHIP_RV380|RADEON_IS_MOBILITY}, {PCI_VENDOR_ATI, PCI_PRODUCT_ATI_RADEON_X300M24, @@ -521,7 +521,7 @@ radeondrm_attach(struct device *parent, struct device *self, void *aux) drm_radeon_private_t *dev_priv = (drm_radeon_private_t *)self; struct pci_attach_args *pa = aux; struct vga_pci_bar *bar; - drm_pci_id_list_t *id_entry; + const drm_pci_id_list_t *id_entry; int is_agp; id_entry = drm_find_description(PCI_VENDOR(pa->pa_id), diff --git a/sys/dev/pci/drm/radeon_state.c b/sys/dev/pci/drm/radeon_state.c index dd9c78c05b7..1a70c8b7f51 100644 --- a/sys/dev/pci/drm/radeon_state.c +++ b/sys/dev/pci/drm/radeon_state.c @@ -477,7 +477,7 @@ radeon_emit_clip_rect(drm_radeon_private_t *dev_priv, struct drm_clip_rect *box) * 1.3 cmdbuffers allow all previous state to be updated as well as * the tcl scalar and vector areas. */ -static struct { +const static struct { int start; int len; const char *name; diff --git a/sys/dev/pci/drm/savage_drv.c b/sys/dev/pci/drm/savage_drv.c index 68f17119ffe..33d1b9710fc 100644 --- a/sys/dev/pci/drm/savage_drv.c +++ b/sys/dev/pci/drm/savage_drv.c @@ -36,7 +36,7 @@ void savagedrm_attach(struct device *, struct device *, void *); int savagedrm_detach(struct device *, int); int savagedrm_ioctl(struct drm_device *, u_long, caddr_t, struct drm_file *); -static drm_pci_id_list_t savagedrm_pciidlist[] = { +const static drm_pci_id_list_t savagedrm_pciidlist[] = { {PCI_VENDOR_S3, PCI_PRODUCT_S3_SAVAGE3D, S3_SAVAGE3D}, {PCI_VENDOR_S3, PCI_PRODUCT_S3_SAVAGE3D_M, S3_SAVAGE3D}, {PCI_VENDOR_S3, PCI_PRODUCT_S3_SAVAGE4, S3_SAVAGE4}, @@ -93,7 +93,7 @@ savagedrm_attach(struct device *parent, struct device *self, void *aux) drm_savage_private_t *dev_priv = (drm_savage_private_t *)self; struct pci_attach_args *pa = aux; struct vga_pci_bar *bar; - drm_pci_id_list_t *id_entry; + const drm_pci_id_list_t *id_entry; unsigned long mmio_base; int is_agp; diff --git a/sys/dev/pci/drm/sis_drv.c b/sys/dev/pci/drm/sis_drv.c index 257a2a83ee2..18cfef26b68 100644 --- a/sys/dev/pci/drm/sis_drv.c +++ b/sys/dev/pci/drm/sis_drv.c @@ -35,7 +35,7 @@ void sisdrm_attach(struct device *, struct device *, void *); int sisdrm_detach(struct device *, int); int sisdrm_ioctl(struct drm_device *, u_long, caddr_t, struct drm_file *); -static drm_pci_id_list_t sis_pciidlist[] = { +const static drm_pci_id_list_t sis_pciidlist[] = { {PCI_VENDOR_SIS, PCI_PRODUCT_SIS_300}, {PCI_VENDOR_SIS, PCI_PRODUCT_SIS_5300}, {PCI_VENDOR_SIS, PCI_PRODUCT_SIS_6300}, diff --git a/sys/dev/pci/drm/tdfx_drv.c b/sys/dev/pci/drm/tdfx_drv.c index 8277cc3d450..6a2c4340838 100644 --- a/sys/dev/pci/drm/tdfx_drv.c +++ b/sys/dev/pci/drm/tdfx_drv.c @@ -43,7 +43,7 @@ struct tdfxdrm_softc { int tdfxdrm_probe(struct device *, void *, void *); void tdfxdrm_attach(struct device *, struct device *, void *); -static drm_pci_id_list_t tdfxdrm_pciidlist[] = { +const static drm_pci_id_list_t tdfxdrm_pciidlist[] = { {PCI_VENDOR_3DFX, PCI_PRODUCT_3DFX_BANSHEE}, {PCI_VENDOR_3DFX, PCI_PRODUCT_3DFX_VOODOO32000}, {PCI_VENDOR_3DFX, PCI_PRODUCT_3DFX_VOODOO3}, -- cgit v1.2.3