From 3cb1d95847db993911ba0bba65e05087c7586eed Mon Sep 17 00:00:00 2001 From: Milind Arun Choudhary Date: Tue, 6 Mar 2007 02:44:13 -0800 Subject: [PARISC] ROUNDUP macro cleanup in drivers/parisc Clean up ROUNDUP, Use ALIGN where ever appropriate. Signed-off-by: Milind Arun Choudhary Acked-by: Grant Grundler Signed-off-by: Andrew Morton Signed-off-by: Kyle McMartin --- drivers/parisc/ccio-dma.c | 8 ++++---- drivers/parisc/iommu-helpers.h | 4 ++-- drivers/parisc/sba_iommu.c | 6 ++---- 3 files changed, 8 insertions(+), 10 deletions(-) (limited to 'drivers') diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index 894fdb9d44c..1459ca8fffc 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c @@ -32,6 +32,7 @@ */ #include +#include #include #include #include @@ -292,7 +293,6 @@ static int ioc_count; #define PDIR_INDEX(iovp) ((iovp)>>IOVP_SHIFT) #define MKIOVP(pdir_idx) ((long)(pdir_idx) << IOVP_SHIFT) #define MKIOVA(iovp,offset) (dma_addr_t)((long)iovp | (long)offset) -#define ROUNDUP(x,y) ((x + ((y)-1)) & ~((y)-1)) /* ** Don't worry about the 150% average search length on a miss. @@ -668,7 +668,7 @@ ccio_mark_invalid(struct ioc *ioc, dma_addr_t iova, size_t byte_cnt) size_t saved_byte_cnt; /* round up to nearest page size */ - saved_byte_cnt = byte_cnt = ROUNDUP(byte_cnt, IOVP_SIZE); + saved_byte_cnt = byte_cnt = ALIGN(byte_cnt, IOVP_SIZE); while(byte_cnt > 0) { /* invalidate one page at a time */ @@ -751,7 +751,7 @@ ccio_map_single(struct device *dev, void *addr, size_t size, offset = ((unsigned long) addr) & ~IOVP_MASK; /* round up to nearest IOVP_SIZE */ - size = ROUNDUP(size + offset, IOVP_SIZE); + size = ALIGN(size + offset, IOVP_SIZE); spin_lock_irqsave(&ioc->res_lock, flags); #ifdef CCIO_MAP_STATS @@ -814,7 +814,7 @@ ccio_unmap_single(struct device *dev, dma_addr_t iova, size_t size, iova ^= offset; /* clear offset bits */ size += offset; - size = ROUNDUP(size, IOVP_SIZE); + size = ALIGN(size, IOVP_SIZE); spin_lock_irqsave(&ioc->res_lock, flags); diff --git a/drivers/parisc/iommu-helpers.h b/drivers/parisc/iommu-helpers.h index 38d9e1aba1d..0a1f99a2e93 100644 --- a/drivers/parisc/iommu-helpers.h +++ b/drivers/parisc/iommu-helpers.h @@ -138,7 +138,7 @@ iommu_coalesce_chunks(struct ioc *ioc, struct scatterlist *startsg, int nents, ** exceed DMA_CHUNK_SIZE if we coalesce the ** next entry. */ - if(unlikely(ROUNDUP(dma_len + dma_offset + startsg->length, + if(unlikely(ALIGN(dma_len + dma_offset + startsg->length, IOVP_SIZE) > DMA_CHUNK_SIZE)) break; @@ -158,7 +158,7 @@ iommu_coalesce_chunks(struct ioc *ioc, struct scatterlist *startsg, int nents, ** Allocate space for DMA stream. */ sg_dma_len(contig_sg) = dma_len; - dma_len = ROUNDUP(dma_len + dma_offset, IOVP_SIZE); + dma_len = ALIGN(dma_len + dma_offset, IOVP_SIZE); sg_dma_address(contig_sg) = PIDE_FLAG | (iommu_alloc_range(ioc, dma_len) << IOVP_SHIFT) diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index 322957ac2ad..d044c48323e 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c @@ -113,8 +113,6 @@ module_param(sba_reserve_agpgart, int, 0444); MODULE_PARM_DESC(sba_reserve_agpgart, "Reserve half of IO pdir as AGPGART"); #endif -#define ROUNDUP(x,y) ((x + ((y)-1)) & ~((y)-1)) - /************************************ ** SBA register read and write support @@ -352,7 +350,7 @@ sba_search_bitmap(struct ioc *ioc, unsigned long bits_wanted) ** SBA HW features in the unmap path. */ unsigned long o = 1 << get_order(bits_wanted << PAGE_SHIFT); - uint bitshiftcnt = ROUNDUP(ioc->res_bitshift, o); + uint bitshiftcnt = ALIGN(ioc->res_bitshift, o); unsigned long mask; if (bitshiftcnt >= BITS_PER_LONG) { @@ -779,7 +777,7 @@ sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size, offset = iova & ~IOVP_MASK; iova ^= offset; /* clear offset bits */ size += offset; - size = ROUNDUP(size, IOVP_SIZE); + size = ALIGN(size, IOVP_SIZE); spin_lock_irqsave(&ioc->res_lock, flags); -- cgit v1.2.3 From ad46c54868078440b4538fa263a5fd2f124b5a57 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Fri, 25 May 2007 19:18:01 -0400 Subject: [PARISC] kobject is embedded in subsys, not kset Signed-off-by: Kyle McMartin --- drivers/parisc/pdc_stable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c index 815e445c312..924ef060946 100644 --- a/drivers/parisc/pdc_stable.c +++ b/drivers/parisc/pdc_stable.c @@ -1067,7 +1067,7 @@ pdc_stable_init(void) error = subsys_create_file(&stable_subsys, attr); /* register the paths subsys as a subsystem of stable subsys */ - kset_set_kset_s(&paths_subsys, stable_subsys); + kobj_set_kset_s(&paths_subsys, stable_subsys); if ((rc = subsystem_register(&paths_subsys))) goto fail_subsysreg; -- cgit v1.2.3 From 5c04ec74da2f4d3ec0ca406c705313c9b3c7f9b5 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Fri, 25 May 2007 19:19:35 -0400 Subject: [PARISC] Build fixes for power.c is no longer implicitly included. Signed-off-by: Kyle McMartin --- drivers/parisc/power.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/parisc/power.c b/drivers/parisc/power.c index 6dedbdef710..90cca5e3805 100644 --- a/drivers/parisc/power.c +++ b/drivers/parisc/power.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From 76fb9278fd76e8662987ca83a106ac30c813bea5 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 27 May 2007 14:27:23 +0200 Subject: [PARISC] fix lasi_82596 build Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- drivers/net/lasi_82596.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/net/lasi_82596.c b/drivers/net/lasi_82596.c index 6b49fc4bd1a..741780e14b2 100644 --- a/drivers/net/lasi_82596.c +++ b/drivers/net/lasi_82596.c @@ -83,6 +83,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From 649f0edd8b8ec0c0344fc36dd3f1c0add4497dc8 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 27 May 2007 18:07:25 +0200 Subject: [PARISC] fix section mismatch in parport_gsc Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- drivers/parport/parport_gsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c index 17bf9937d27..43652ba523e 100644 --- a/drivers/parport/parport_gsc.c +++ b/drivers/parport/parport_gsc.c @@ -350,7 +350,7 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base, #define PARPORT_GSC_OFFSET 0x800 -static int __initdata parport_count; +static int __devinitdata parport_count; static int __devinit parport_init_chip(struct parisc_device *dev) { -- cgit v1.2.3 From 48a7d5c66b3cecc40364d62cfd54c502c0979561 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 27 May 2007 18:10:25 +0200 Subject: [PARISC] fix section mismatch in parisc STI video drivers Hi Kyle, this patch fixes various section mismatches in the sti graphics driver: WARNING: drivers/built-in.o(.text.sticore_pci_init+0xac): Section mismatch: reference to .init.text:sti_try_rom_generic (after 'sticore_pci_init') WARNING: drivers/built-in.o(.text.sticore_pci_init+0xe4): Section mismatch: reference to .init.text:sticore_check_for_default_sti (after 'sticore_pci_init') WARNING: drivers/built-in.o(.text.sti_get_rom+0x18): Section mismatch: reference to .init.text:sti_init_roms (after 'sti_get_rom') (and others). Basically it's a replacement of __init by __devinit. Please apply, Helge Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- drivers/video/console/sticore.c | 50 ++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'drivers') diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c index 717b360d041..870017d4497 100644 --- a/drivers/video/console/sticore.c +++ b/drivers/video/console/sticore.c @@ -240,7 +240,7 @@ static void sti_flush(unsigned long from, unsigned long len) flush_icache_range(from, from+len); } -void __init +void __devinit sti_rom_copy(unsigned long base, unsigned long count, void *dest) { unsigned long dest_len = count; @@ -269,7 +269,7 @@ sti_rom_copy(unsigned long base, unsigned long count, void *dest) static char default_sti_path[21] __read_mostly; #ifndef MODULE -static int __init sti_setup(char *str) +static int __devinit sti_setup(char *str) { if (str) strlcpy (default_sti_path, str, sizeof (default_sti_path)); @@ -288,12 +288,12 @@ __setup("sti=", sti_setup); -static char __initdata *font_name[MAX_STI_ROMS] = { "VGA8x16", }; -static int __initdata font_index[MAX_STI_ROMS], - font_height[MAX_STI_ROMS], - font_width[MAX_STI_ROMS]; +static char __devinitdata *font_name[MAX_STI_ROMS] = { "VGA8x16", }; +static int __devinitdata font_index[MAX_STI_ROMS], + font_height[MAX_STI_ROMS], + font_width[MAX_STI_ROMS]; #ifndef MODULE -static int __init sti_font_setup(char *str) +static int __devinit sti_font_setup(char *str) { char *x; int i = 0; @@ -346,7 +346,7 @@ __setup("sti_font=", sti_font_setup); -static void __init +static void __devinit sti_dump_globcfg(struct sti_glob_cfg *glob_cfg, unsigned int sti_mem_request) { struct sti_glob_cfg_ext *cfg; @@ -386,7 +386,7 @@ sti_dump_globcfg(struct sti_glob_cfg *glob_cfg, unsigned int sti_mem_request) cfg->sti_mem_addr, sti_mem_request)); } -static void __init +static void __devinit sti_dump_outptr(struct sti_struct *sti) { DPRINTK((KERN_INFO @@ -400,7 +400,7 @@ sti_dump_outptr(struct sti_struct *sti) sti->outptr.attributes)); } -static int __init +static int __devinit sti_init_glob_cfg(struct sti_struct *sti, unsigned long rom_address, unsigned long hpa) { @@ -482,7 +482,7 @@ sti_init_glob_cfg(struct sti_struct *sti, } #ifdef CONFIG_FB -struct sti_cooked_font * __init +struct sti_cooked_font * __devinit sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) { const struct font_desc *fbfont; @@ -538,14 +538,14 @@ sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) return cooked_font; } #else -struct sti_cooked_font * __init +struct sti_cooked_font * __devinit sti_select_fbfont(struct sti_cooked_rom *cooked_rom, const char *fbfont_name) { return NULL; } #endif -struct sti_cooked_font * __init +struct sti_cooked_font * __devinit sti_select_font(struct sti_cooked_rom *rom, int (*search_font_fnc) (struct sti_cooked_rom *,int,int) ) { @@ -572,7 +572,7 @@ sti_select_font(struct sti_cooked_rom *rom, } -static void __init +static void __devinit sti_dump_rom(struct sti_rom *rom) { printk(KERN_INFO " id %04x-%04x, conforms to spec rev. %d.%02x\n", @@ -590,7 +590,7 @@ sti_dump_rom(struct sti_rom *rom) } -static int __init +static int __devinit sti_cook_fonts(struct sti_cooked_rom *cooked_rom, struct sti_rom *raw_rom) { @@ -625,7 +625,7 @@ sti_cook_fonts(struct sti_cooked_rom *cooked_rom, } -static int __init +static int __devinit sti_search_font(struct sti_cooked_rom *rom, int height, int width) { struct sti_cooked_font *font; @@ -642,7 +642,7 @@ sti_search_font(struct sti_cooked_rom *rom, int height, int width) #define BMODE_RELOCATE(offset) offset = (offset) / 4; #define BMODE_LAST_ADDR_OFFS 0x50 -static void * __init +static void * __devinit sti_bmode_font_raw(struct sti_cooked_font *f) { unsigned char *n, *p, *q; @@ -660,7 +660,7 @@ sti_bmode_font_raw(struct sti_cooked_font *f) return n + 3; } -static void __init +static void __devinit sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest) { unsigned long dest_len = count; @@ -675,7 +675,7 @@ sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest) sti_flush(dest_start, dest_len); } -static struct sti_rom * __init +static struct sti_rom * __devinit sti_get_bmode_rom (unsigned long address) { struct sti_rom *raw; @@ -711,7 +711,7 @@ sti_get_bmode_rom (unsigned long address) return raw; } -struct sti_rom * __init +struct sti_rom * __devinit sti_get_wmode_rom (unsigned long address) { struct sti_rom *raw; @@ -727,7 +727,7 @@ sti_get_wmode_rom (unsigned long address) return raw; } -int __init +int __devinit sti_read_rom(int wordmode, struct sti_struct *sti, unsigned long address) { struct sti_cooked_rom *cooked; @@ -783,7 +783,7 @@ out_err: return 0; } -static struct sti_struct * __init +static struct sti_struct * __devinit sti_try_rom_generic(unsigned long address, unsigned long hpa, struct pci_dev *pd) { struct sti_struct *sti; @@ -898,7 +898,7 @@ out_err: return NULL; } -static void __init sticore_check_for_default_sti(struct sti_struct *sti, char *path) +static void __devinit sticore_check_for_default_sti(struct sti_struct *sti, char *path) { if (strcmp (path, default_sti_path) == 0) default_sti = sti; @@ -909,7 +909,7 @@ static void __init sticore_check_for_default_sti(struct sti_struct *sti, char *p * in the additional address field addr[1] while on * older Systems the PDC stores it in page0->proc_sti */ -static int __init sticore_pa_init(struct parisc_device *dev) +static int __devinit sticore_pa_init(struct parisc_device *dev) { char pa_path[21]; struct sti_struct *sti = NULL; @@ -1015,7 +1015,7 @@ static struct parisc_driver pa_sti_driver = { static int sticore_initialized __read_mostly; -static void __init sti_init_roms(void) +static void __devinit sti_init_roms(void) { if (sticore_initialized) return; -- cgit v1.2.3 From 25971f68d392f1816e21520e9e59648403b0bdad Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 27 May 2007 18:20:47 +0200 Subject: [PARISC] fix section mismatch in ccio-dma Hi Kyle, this fixes section mismatches in ccio-dma. Additionally, mark parisc_device_id table const. Please apply, Helge Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- drivers/parisc/ccio-dma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index 1459ca8fffc..b3c4dbff26b 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c @@ -1227,7 +1227,7 @@ ccio_get_iotlb_size(struct parisc_device *dev) #endif /* 0 */ /* We *can't* support JAVA (T600). Venture there at your own risk. */ -static struct parisc_device_id ccio_tbl[] = { +static const struct parisc_device_id ccio_tbl[] = { { HPHW_IOA, HVERSION_REV_ANY_ID, U2_IOA_RUNWAY, 0xb }, /* U2 */ { HPHW_IOA, HVERSION_REV_ANY_ID, UTURN_IOA_RUNWAY, 0xb }, /* UTurn */ { 0, } @@ -1370,7 +1370,7 @@ ccio_ioc_init(struct ioc *ioc) } } -static void +static void __init ccio_init_resource(struct resource *res, char *name, void __iomem *ioaddr) { int result; @@ -1537,7 +1537,7 @@ int ccio_request_resource(const struct parisc_device *dev, * If so, initialize the chip and tell other partners in crime they * have work to do. */ -static int ccio_probe(struct parisc_device *dev) +static int __init ccio_probe(struct parisc_device *dev) { int i; struct ioc *ioc, **ioc_p = &ioc_list; -- cgit v1.2.3 From 6fe077fd381048293134fbc6011d7e4633edc0c5 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 27 May 2007 19:57:11 +0200 Subject: [PARISC] fix section mismatch in parisc eisa driver Hi Kyle, this patch fixes the following section mismatch (EISA cards should be hotplug aware, but the EISA bus itself shouldn't): WARNING: drivers/built-in.o(.text.eisa_probe+0x220): Section mismatch: reference to .init.text:eisa_root_register (after 'eisa_probe') Please apply, Helge Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- drivers/parisc/eisa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c index 309076b3985..771cef59254 100644 --- a/drivers/parisc/eisa.c +++ b/drivers/parisc/eisa.c @@ -307,7 +307,7 @@ static void init_eisa_pic(void) #define is_mongoose(dev) (dev->id.sversion == 0x00076) -static int __devinit eisa_probe(struct parisc_device *dev) +static int __init eisa_probe(struct parisc_device *dev) { int i, result; @@ -387,7 +387,7 @@ static int __devinit eisa_probe(struct parisc_device *dev) return 0; } -static struct parisc_device_id eisa_tbl[] = { +static const struct parisc_device_id eisa_tbl[] = { { HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00076 }, /* Mongoose */ { HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00090 }, /* Wax EISA */ { 0, } -- cgit v1.2.3 From 8c678b101a08a6543e62ab60aace93042456aa9d Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 27 May 2007 20:38:47 +0200 Subject: [PARISC] fix section mismatch in superio serial drivers This patch fixes two section mismatches in superio serial setup: WARNING: drivers/built-in.o(.text.superio_serial_init+0x78): Section mismatch: reference to .init.text:early_serial_setup (after 'superio_serial_init') WARNING: drivers/built-in.o(.text.superio_serial_init+0xa4): Section mismatch: reference to .init.text:early_serial_setup (after 'superio_serial_init') Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- drivers/parisc/superio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c index 1fd97f7c8b9..a708c329675 100644 --- a/drivers/parisc/superio.c +++ b/drivers/parisc/superio.c @@ -389,7 +389,7 @@ int superio_fixup_irq(struct pci_dev *pcidev) return local_irq; } -static void __devinit superio_serial_init(void) +static void __init superio_serial_init(void) { #ifdef CONFIG_SERIAL_8250 int retval; @@ -423,7 +423,7 @@ static void __devinit superio_serial_init(void) } -static void __devinit superio_parport_init(void) +static void __init superio_parport_init(void) { #ifdef CONFIG_PARPORT_PC if (!parport_pc_probe_port(sio_dev.pp_base, @@ -450,7 +450,7 @@ static void superio_fixup_pci(struct pci_dev *pdev) DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415, superio_fixup_pci); -static int __devinit +static int __init superio_probe(struct pci_dev *dev, const struct pci_device_id *id) { struct superio_device *sio = &sio_dev; @@ -485,7 +485,7 @@ superio_probe(struct pci_dev *dev, const struct pci_device_id *id) return -ENODEV; } -static struct pci_device_id superio_tbl[] = { +static const struct pci_device_id superio_tbl[] = { { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87560_LIO) }, { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87560_USB) }, { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415) }, -- cgit v1.2.3