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

sh: Various cosmetic cleanups.

We had quite a bit of whitespace damage, clean most of it up..

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Arthur Othieno <a.othieno@bluewin.ch>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+60 -106
+4 -4
arch/sh/boards/dreamcast/irq.c
··· 26 26 event. 27 27 28 28 There are three 32-bit ESRs located at 0xa05f8900 - 0xa05f6908. Event 29 - types can be found in include/asm-sh/dc_sysasic.h. There are three groups 30 - of EMRs that parallel the ESRs. Each EMR group corresponds to an IRQ, so 31 - 0xa05f6910 - 0xa05f6918 triggers IRQ 13, 0xa05f6920 - 0xa05f6928 triggers 32 - IRQ 11, and 0xa05f6930 - 0xa05f6938 triggers IRQ 9. 29 + types can be found in include/asm-sh/dreamcast/sysasic.h. There are three 30 + groups of EMRs that parallel the ESRs. Each EMR group corresponds to an 31 + IRQ, so 0xa05f6910 - 0xa05f6918 triggers IRQ 13, 0xa05f6920 - 0xa05f6928 32 + triggers IRQ 11, and 0xa05f6930 - 0xa05f6938 triggers IRQ 9. 33 33 34 34 In the kernel, these events are mapped to virtual IRQs so that drivers can 35 35 respond to them as they would a normal interrupt. In order to keep this
+9 -9
arch/sh/boards/dreamcast/rtc.c
··· 1 - /* arch/sh/kernel/rtc-aica.c 1 + /* 2 + * arch/sh/boards/dreamcast/rtc.c 2 3 * 3 4 * Dreamcast AICA RTC routines. 4 5 * ··· 11 10 */ 12 11 13 12 #include <linux/time.h> 14 - 13 + #include <asm/rtc.h> 15 14 #include <asm/io.h> 16 15 17 - extern void (*rtc_get_time)(struct timespec *); 18 - extern int (*rtc_set_time)(const time_t); 19 - 20 16 /* The AICA RTC has an Epoch of 1/1/1950, so we must subtract 20 years (in 21 - seconds to get the standard Unix Epoch when getting the time, and add 20 22 - years when setting the time. */ 17 + seconds) to get the standard Unix Epoch when getting the time, and add 18 + 20 years when setting the time. */ 23 19 #define TWENTY_YEARS ((20 * 365LU + 5) * 86400) 24 20 25 21 /* The AICA RTC is represented by a 32-bit seconds counter stored in 2 16-bit ··· 30 32 * 31 33 * Grabs the current RTC seconds counter and adjusts it to the Unix Epoch. 32 34 */ 33 - void aica_rtc_gettimeofday(struct timespec *ts) { 35 + void aica_rtc_gettimeofday(struct timespec *ts) 36 + { 34 37 unsigned long val1, val2; 35 38 36 39 do { ··· 54 55 * 55 56 * Adjusts the given @tv to the AICA Epoch and sets the RTC seconds counter. 56 57 */ 57 - int aica_rtc_settimeofday(const time_t secs) { 58 + int aica_rtc_settimeofday(const time_t secs) 59 + { 58 60 unsigned long val1, val2; 59 61 unsigned long adj = secs + TWENTY_YEARS; 60 62
+2 -4
arch/sh/boards/dreamcast/setup.c
··· 25 25 26 26 #include <asm/io.h> 27 27 #include <asm/irq.h> 28 + #include <asm/rtc.h> 28 29 #include <asm/machvec.h> 29 - #include <asm/machvec_init.h> 30 30 #include <asm/mach/sysasic.h> 31 31 32 32 extern struct hw_interrupt_type systemasic_int; 33 - /* XXX: Move this into it's proper header. */ 34 - extern void (*board_time_init)(void); 35 33 extern void aica_time_init(void); 36 34 extern int gapspci_init(void); 37 35 extern int systemasic_irq_demux(int); 38 36 39 - void *dreamcast_consistent_alloc(struct device *, size_t, dma_addr_t *, int); 37 + void *dreamcast_consistent_alloc(struct device *, size_t, dma_addr_t *, gfp_t); 40 38 int dreamcast_consistent_free(struct device *, size_t, void *, dma_addr_t); 41 39 42 40 const char *get_system_type(void)
-4
arch/sh/boards/renesas/edosk7705/Makefile
··· 1 1 # 2 2 # Makefile for the EDOSK7705 specific parts of the kernel 3 3 # 4 - # Note! Dependencies are done automagically by 'make dep', which also 5 - # removes any old dependencies. DON'T put your own dependencies here 6 - # unless it's something special (ie not a .c file). 7 - # 8 4 9 5 obj-y := setup.o io.o 10 6
-4
arch/sh/boards/renesas/hs7751rvoip/Makefile
··· 1 1 # 2 2 # Makefile for the HS7751RVoIP specific parts of the kernel 3 3 # 4 - # Note! Dependencies are done automagically by 'make dep', which also 5 - # removes any old dependencies. DON'T put your own dependencies here 6 - # unless it's something special (ie not a .c file). 7 - # 8 4 9 5 obj-y := mach.o setup.o io.o irq.o led.o 10 6
+2 -2
arch/sh/boards/renesas/hs7751rvoip/io.c
··· 167 167 *(volatile unsigned char *)port = value; 168 168 #if defined(CONFIG_HS7751RVOIP_CODEC) 169 169 else if (codec_port(port)) 170 - *(volatile unsigned cjar *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE)) = value; 170 + *(volatile unsigned char *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE)) = value; 171 171 #endif 172 172 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 173 173 *(unsigned char *)PCI_IOMAP(port) = value; ··· 181 181 *(volatile unsigned char *)port = value; 182 182 #if defined(CONFIG_HS7751RVOIP_CODEC) 183 183 else if (codec_port(port)) 184 - *(volatile unsigned cjar *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE)) = value; 184 + *(volatile unsigned char *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE)) = value; 185 185 #endif 186 186 else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) 187 187 *(unsigned char *)PCI_IOMAP(port) = value;
-4
arch/sh/boards/renesas/rts7751r2d/Makefile
··· 1 1 # 2 2 # Makefile for the RTS7751R2D specific parts of the kernel 3 3 # 4 - # Note! Dependencies are done automagically by 'make dep', which also 5 - # removes any old dependencies. DON'T put your own dependencies here 6 - # unless it's something special (ie not a .c file). 7 - # 8 4 9 5 obj-y := mach.o setup.o io.o irq.o led.o 10 6
-2
arch/sh/boards/renesas/rts7751r2d/led.c
··· 12 12 #include <asm/io.h> 13 13 #include <asm/rts7751r2d/rts7751r2d.h> 14 14 15 - extern unsigned int debug_counter; 16 - 17 15 #ifdef CONFIG_HEARTBEAT 18 16 19 17 #include <linux/sched.h>
-3
arch/sh/boards/renesas/rts7751r2d/setup.c
··· 14 14 #include <asm/io.h> 15 15 #include <asm/rts7751r2d/rts7751r2d.h> 16 16 17 - unsigned int debug_counter; 18 - 19 17 const char *get_system_type(void) 20 18 { 21 19 return "RTS7751R2D"; ··· 32 34 printk(KERN_INFO "Renesas Technology Sales RTS7751R2D support.\n"); 33 35 ctrl_outw(0x0000, PA_OUTPORT); 34 36 pm_power_off = rts7751r2d_power_off; 35 - debug_counter = 0; 36 37 }
+2 -3
arch/sh/drivers/dma/dma-pvr2.c
··· 18 18 #include <asm/dma.h> 19 19 #include <asm/io.h> 20 20 21 - static unsigned int xfer_complete = 0; 22 - static int count = 0; 21 + static unsigned int xfer_complete; 22 + static int count; 23 23 24 24 static irqreturn_t pvr2_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs) 25 25 { ··· 107 107 MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>"); 108 108 MODULE_DESCRIPTION("NEC PowerVR 2 DMA driver"); 109 109 MODULE_LICENSE("GPL"); 110 -
+1 -1
arch/sh/kernel/cpu/clock.c
··· 225 225 { 226 226 int i, ret = 0; 227 227 228 - BUG_ON(unlikely(!master_clk.rate)); 228 + BUG_ON(!master_clk.rate); 229 229 230 230 for (i = 0; i < ARRAY_SIZE(onchip_clocks); i++) { 231 231 struct clk *clk = onchip_clocks[i];
+2 -1
arch/sh/kernel/cpu/sh4/sq.c
··· 24 24 #include <linux/proc_fs.h> 25 25 #include <linux/miscdevice.h> 26 26 #include <linux/vmalloc.h> 27 - 27 + #include <linux/mm.h> 28 28 #include <asm/io.h> 29 29 #include <asm/page.h> 30 + #include <asm/cacheflush.h> 30 31 #include <asm/mmu_context.h> 31 32 #include <asm/cpu/sq.h> 32 33
-18
arch/sh/kernel/entry.S
··· 18 18 #include <asm/cpu/mmu_context.h> 19 19 #include <asm/unistd.h> 20 20 21 - #if !defined(CONFIG_NFSD) && !defined(CONFIG_NFSD_MODULE) 22 - #define sys_nfsservctl sys_ni_syscall 23 - #endif 24 - 25 - #if !defined(CONFIG_MMU) 26 - #define sys_madvise sys_ni_syscall 27 - #define sys_readahead sys_ni_syscall 28 - #define sys_mprotect sys_ni_syscall 29 - #define sys_msync sys_ni_syscall 30 - #define sys_mlock sys_ni_syscall 31 - #define sys_munlock sys_ni_syscall 32 - #define sys_mlockall sys_ni_syscall 33 - #define sys_munlockall sys_ni_syscall 34 - #define sys_mremap sys_ni_syscall 35 - #define sys_mincore sys_ni_syscall 36 - #define sys_remap_file_pages sys_ni_syscall 37 - #endif 38 - 39 21 ! NOTE: 40 22 ! GNU as (as of 2.9.1) changes bf/s into bt/s and bra, when the address 41 23 ! to be jumped is too far, but it causes illegal slot exception.
-1
arch/sh/kernel/ptrace.c
··· 224 224 225 225 case PTRACE_SETDSPREGS: { 226 226 unsigned long dp; 227 - int i; 228 227 229 228 ret = -EIO; 230 229 dp = ((unsigned long) child) + THREAD_SIZE -
+2
arch/sh/kernel/sh_ksyms.c
··· 117 117 #endif 118 118 119 119 EXPORT_SYMBOL(csum_partial); 120 + #ifdef CONFIG_IPV6 120 121 EXPORT_SYMBOL(csum_ipv6_magic); 122 + #endif 121 123 EXPORT_SYMBOL(consistent_sync); 122 124 EXPORT_SYMBOL(clear_page);
+24 -34
drivers/char/watchdog/shwdt.c
··· 125 125 126 126 /** 127 127 * sh_wdt_stop - Stop the Watchdog 128 - * 129 128 * Stops the watchdog. 130 129 */ 131 130 static void sh_wdt_stop(void) ··· 140 141 141 142 /** 142 143 * sh_wdt_keepalive - Keep the Userspace Watchdog Alive 143 - * 144 144 * The Userspace watchdog got a KeepAlive: schedule the next heartbeat. 145 145 */ 146 - static void sh_wdt_keepalive(void) 146 + static inline void sh_wdt_keepalive(void) 147 147 { 148 148 next_heartbeat = jiffies + (heartbeat * HZ); 149 149 } 150 150 151 151 /** 152 152 * sh_wdt_set_heartbeat - Set the Userspace Watchdog heartbeat 153 - * 154 153 * Set the Userspace Watchdog heartbeat 155 154 */ 156 155 static int sh_wdt_set_heartbeat(int t) 157 156 { 158 - if ((t < 1) || (t > 3600)) /* arbitrary upper limit */ 157 + if (unlikely((t < 1) || (t > 3600))) /* arbitrary upper limit */ 159 158 return -EINVAL; 160 159 161 160 heartbeat = t; ··· 162 165 163 166 /** 164 167 * sh_wdt_ping - Ping the Watchdog 165 - * 166 168 * @data: Unused 167 169 * 168 170 * Clears overflow bit, resets timer counter. ··· 178 182 sh_wdt_write_cnt(0); 179 183 180 184 mod_timer(&timer, next_ping_period(clock_division_ratio)); 181 - } else { 182 - printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n"); 183 - } 185 + } else 186 + printk(KERN_WARNING PFX "Heartbeat lost! Will not ping " 187 + "the watchdog\n"); 184 188 } 185 189 186 190 /** 187 191 * sh_wdt_open - Open the Device 188 - * 189 192 * @inode: inode of device 190 193 * @file: file handle of device 191 194 * ··· 204 209 205 210 /** 206 211 * sh_wdt_close - Close the Device 207 - * 208 212 * @inode: inode of device 209 213 * @file: file handle of device 210 214 * ··· 214 220 if (shwdt_expect_close == 42) { 215 221 sh_wdt_stop(); 216 222 } else { 217 - printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n"); 223 + printk(KERN_CRIT PFX "Unexpected close, not " 224 + "stopping watchdog!\n"); 218 225 sh_wdt_keepalive(); 219 226 } 220 227 ··· 227 232 228 233 /** 229 234 * sh_wdt_write - Write to Device 230 - * 231 235 * @file: file handle of device 232 236 * @buf: buffer to write 233 237 * @count: length of buffer ··· 259 265 260 266 /** 261 267 * sh_wdt_ioctl - Query Device 262 - * 263 268 * @inode: inode of device 264 269 * @file: file handle of device 265 270 * @cmd: watchdog command ··· 319 326 320 327 /** 321 328 * sh_wdt_notify_sys - Notifier Handler 322 - * 323 329 * @this: notifier block 324 330 * @code: notifier event 325 331 * @unused: unused ··· 329 337 static int sh_wdt_notify_sys(struct notifier_block *this, 330 338 unsigned long code, void *unused) 331 339 { 332 - if (code == SYS_DOWN || code == SYS_HALT) { 340 + if (code == SYS_DOWN || code == SYS_HALT) 333 341 sh_wdt_stop(); 334 - } 335 342 336 343 return NOTIFY_DONE; 337 344 } ··· 345 354 }; 346 355 347 356 static struct watchdog_info sh_wdt_info = { 348 - .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, 357 + .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | 358 + WDIOF_MAGICCLOSE, 349 359 .firmware_version = 1, 350 360 .identity = "SH WDT", 351 361 }; ··· 363 371 364 372 /** 365 373 * sh_wdt_init - Initialize module 366 - * 367 374 * Registers the device and notifier handler. Actual device 368 375 * initialization is handled by sh_wdt_open(). 369 376 */ ··· 372 381 373 382 if ((clock_division_ratio < 0x5) || (clock_division_ratio > 0x7)) { 374 383 clock_division_ratio = WTCSR_CKS_4096; 375 - printk(KERN_INFO PFX "clock_division_ratio value must be 0x5<=x<=0x7, using %d\n", 376 - clock_division_ratio); 384 + printk(KERN_INFO PFX "clock_division_ratio value must " 385 + "be 0x5<=x<=0x7, using %d\n", clock_division_ratio); 377 386 } 378 387 379 - if (sh_wdt_set_heartbeat(heartbeat)) 380 - { 388 + rc = sh_wdt_set_heartbeat(heartbeat); 389 + if (unlikely(rc)) { 381 390 heartbeat = WATCHDOG_HEARTBEAT; 382 - printk(KERN_INFO PFX "heartbeat value must be 1<=x<=3600, using %d\n", 383 - heartbeat); 391 + printk(KERN_INFO PFX "heartbeat value must " 392 + "be 1<=x<=3600, using %d\n", heartbeat); 384 393 } 385 394 386 395 init_timer(&timer); ··· 388 397 timer.data = 0; 389 398 390 399 rc = register_reboot_notifier(&sh_wdt_notifier); 391 - if (rc) { 392 - printk(KERN_ERR PFX "Can't register reboot notifier (err=%d)\n", rc); 400 + if (unlikely(rc)) { 401 + printk(KERN_ERR PFX "Can't register reboot notifier (err=%d)\n", 402 + rc); 393 403 return rc; 394 404 } 395 405 396 406 rc = misc_register(&sh_wdt_miscdev); 397 - if (rc) { 398 - printk(KERN_ERR PFX "Can't register miscdev on minor=%d (err=%d)\n", 399 - sh_wdt_miscdev.minor, rc); 407 + if (unlikely(rc)) { 408 + printk(KERN_ERR PFX "Can't register miscdev on " 409 + "minor=%d (err=%d)\n", sh_wdt_miscdev.minor, rc); 400 410 unregister_reboot_notifier(&sh_wdt_notifier); 401 411 return rc; 402 412 } ··· 410 418 411 419 /** 412 420 * sh_wdt_exit - Deinitialize module 413 - * 414 421 * Unregisters the device and notifier handler. Actual device 415 422 * deinitialization is handled by sh_wdt_close(). 416 423 */ ··· 425 434 MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 426 435 427 436 module_param(clock_division_ratio, int, 0); 428 - MODULE_PARM_DESC(clock_division_ratio, "Clock division ratio. Valid ranges are from 0x5 (1.31ms) to 0x7 (5.25ms). Defaults to 0x7."); 437 + MODULE_PARM_DESC(clock_division_ratio, "Clock division ratio. Valid ranges are from 0x5 (1.31ms) to 0x7 (5.25ms). (default=" __MODULE_STRING(clock_division_ratio) ")"); 429 438 430 439 module_param(heartbeat, int, 0); 431 440 MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (1<=heartbeat<=3600, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); 432 441 433 442 module_param(nowayout, int, 0); 434 - MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); 443 + MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 435 444 436 445 module_init(sh_wdt_init); 437 446 module_exit(sh_wdt_exit); 438 -
+1
include/asm-sh/atomic.h
··· 14 14 #define atomic_read(v) ((v)->counter) 15 15 #define atomic_set(v,i) ((v)->counter = (i)) 16 16 17 + #include <linux/compiler.h> 17 18 #include <asm/system.h> 18 19 19 20 /*
+8 -8
include/asm-sh/bitops.h
··· 6 6 /* For __swab32 */ 7 7 #include <asm/byteorder.h> 8 8 9 - static __inline__ void set_bit(int nr, volatile void * addr) 9 + static inline void set_bit(int nr, volatile void * addr) 10 10 { 11 11 int mask; 12 12 volatile unsigned int *a = addr; ··· 24 24 */ 25 25 #define smp_mb__before_clear_bit() barrier() 26 26 #define smp_mb__after_clear_bit() barrier() 27 - static __inline__ void clear_bit(int nr, volatile void * addr) 27 + static inline void clear_bit(int nr, volatile void * addr) 28 28 { 29 29 int mask; 30 30 volatile unsigned int *a = addr; ··· 37 37 local_irq_restore(flags); 38 38 } 39 39 40 - static __inline__ void change_bit(int nr, volatile void * addr) 40 + static inline void change_bit(int nr, volatile void * addr) 41 41 { 42 42 int mask; 43 43 volatile unsigned int *a = addr; ··· 50 50 local_irq_restore(flags); 51 51 } 52 52 53 - static __inline__ int test_and_set_bit(int nr, volatile void * addr) 53 + static inline int test_and_set_bit(int nr, volatile void * addr) 54 54 { 55 55 int mask, retval; 56 56 volatile unsigned int *a = addr; ··· 66 66 return retval; 67 67 } 68 68 69 - static __inline__ int test_and_clear_bit(int nr, volatile void * addr) 69 + static inline int test_and_clear_bit(int nr, volatile void * addr) 70 70 { 71 71 int mask, retval; 72 72 volatile unsigned int *a = addr; ··· 82 82 return retval; 83 83 } 84 84 85 - static __inline__ int test_and_change_bit(int nr, volatile void * addr) 85 + static inline int test_and_change_bit(int nr, volatile void * addr) 86 86 { 87 87 int mask, retval; 88 88 volatile unsigned int *a = addr; ··· 100 100 101 101 #include <asm-generic/bitops/non-atomic.h> 102 102 103 - static __inline__ unsigned long ffz(unsigned long word) 103 + static inline unsigned long ffz(unsigned long word) 104 104 { 105 105 unsigned long result; 106 106 ··· 120 120 * 121 121 * Undefined if no bit exists, so code should check against 0 first. 122 122 */ 123 - static __inline__ unsigned long __ffs(unsigned long word) 123 + static inline unsigned long __ffs(unsigned long word) 124 124 { 125 125 unsigned long result; 126 126
+2
include/asm-sh/checksum.h
··· 159 159 } 160 160 161 161 #define _HAVE_ARCH_IPV6_CSUM 162 + #ifdef CONFIG_IPV6 162 163 static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, 163 164 struct in6_addr *daddr, 164 165 __u32 len, ··· 195 194 196 195 return csum_fold(sum); 197 196 } 197 + #endif 198 198 199 199 /* 200 200 * Copy and checksum to user
+1 -1
include/asm-sh/fixmap.h
··· 25 25 * addresses. The point is to have a constant address at 26 26 * compile time, but to set the physical address only 27 27 * in the boot process. We allocate these special addresses 28 - * from the end of virtual memory (0xfffff000) backwards. 28 + * from the end of P3 backwards. 29 29 * Also this lets us do fail-safe vmalloc(), we 30 30 * can guarantee that these special addresses and 31 31 * vmalloc()-ed addresses never overlap.
-3
include/asm-sh/watchdog.h
··· 62 62 63 63 /** 64 64 * sh_wdt_read_cnt - Read from Counter 65 - * 66 65 * Reads back the WTCNT value. 67 66 */ 68 67 static inline __u8 sh_wdt_read_cnt(void) ··· 71 72 72 73 /** 73 74 * sh_wdt_write_cnt - Write to Counter 74 - * 75 75 * @val: Value to write 76 76 * 77 77 * Writes the given value @val to the lower byte of the timer counter. ··· 93 95 94 96 /** 95 97 * sh_wdt_write_csr - Write to Control/Status Register 96 - * 97 98 * @val: Value to write 98 99 * 99 100 * Writes the given value @val to the lower byte of the control/status