diff options
93 files changed, 1251 insertions, 343 deletions
diff --git a/Documentation/BUG-HUNTING b/Documentation/BUG-HUNTING index 65b97e1dbf70..35f5bd243336 100644 --- a/Documentation/BUG-HUNTING +++ b/Documentation/BUG-HUNTING | |||
@@ -191,6 +191,30 @@ e.g. crash dump output as shown by Dave Miller. | |||
191 | > mov 0x8(%ebp), %ebx ! %ebx = skb->sk | 191 | > mov 0x8(%ebp), %ebx ! %ebx = skb->sk |
192 | > mov 0x13c(%ebx), %eax ! %eax = inet_sk(sk)->opt | 192 | > mov 0x13c(%ebx), %eax ! %eax = inet_sk(sk)->opt |
193 | 193 | ||
194 | In addition, you can use GDB to figure out the exact file and line | ||
195 | number of the OOPS from the vmlinux file. If you have | ||
196 | CONFIG_DEBUG_INFO enabled, you can simply copy the EIP value from the | ||
197 | OOPS: | ||
198 | |||
199 | EIP: 0060:[<c021e50e>] Not tainted VLI | ||
200 | |||
201 | And use GDB to translate that to human-readable form: | ||
202 | |||
203 | gdb vmlinux | ||
204 | (gdb) l *0xc021e50e | ||
205 | |||
206 | If you don't have CONFIG_DEBUG_INFO enabled, you use the function | ||
207 | offset from the OOPS: | ||
208 | |||
209 | EIP is at vt_ioctl+0xda8/0x1482 | ||
210 | |||
211 | And recompile the kernel with CONFIG_DEBUG_INFO enabled: | ||
212 | |||
213 | make vmlinux | ||
214 | gdb vmlinux | ||
215 | (gdb) p vt_ioctl | ||
216 | (gdb) l *(0x<address of vt_ioctl> + 0xda8) | ||
217 | |||
194 | Another very useful option of the Kernel Hacking section in menuconfig is | 218 | Another very useful option of the Kernel Hacking section in menuconfig is |
195 | Debug memory allocations. This will help you see whether data has been | 219 | Debug memory allocations. This will help you see whether data has been |
196 | initialised and not set before use etc. To see the values that get assigned | 220 | initialised and not set before use etc. To see the values that get assigned |
diff --git a/Documentation/SubmitChecklist b/Documentation/SubmitChecklist index 3af3e65cf43b..6ebffb57e3db 100644 --- a/Documentation/SubmitChecklist +++ b/Documentation/SubmitChecklist | |||
@@ -84,3 +84,9 @@ kernel patches. | |||
84 | 24: Avoid whitespace damage such as indenting with spaces or whitespace | 84 | 24: Avoid whitespace damage such as indenting with spaces or whitespace |
85 | at the end of lines. You can test this by feeding the patch to | 85 | at the end of lines. You can test this by feeding the patch to |
86 | "git apply --check --whitespace=error-all" | 86 | "git apply --check --whitespace=error-all" |
87 | |||
88 | 25: Check your patch for general style as detailed in | ||
89 | Documentation/CodingStyle. Check for trivial violations with the | ||
90 | patch style checker prior to submission (scripts/checkpatch.pl). | ||
91 | You should be able to justify all violations that remain in | ||
92 | your patch. | ||
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index a417b25fb1aa..d91125ab6f49 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches | |||
@@ -118,7 +118,20 @@ then only post say 15 or so at a time and wait for review and integration. | |||
118 | 118 | ||
119 | 119 | ||
120 | 120 | ||
121 | 4) Select e-mail destination. | 121 | 4) Style check your changes. |
122 | |||
123 | Check your patch for basic style violations, details of which can be | ||
124 | found in Documentation/CodingStyle. Failure to do so simply wastes | ||
125 | the reviewers time and will get your patch rejected, probabally | ||
126 | without even being read. | ||
127 | |||
128 | At a minimum you should check your patches with the patch style | ||
129 | checker prior to submission (scripts/patchcheck.pl). You should | ||
130 | be able to justify all violations that remain in your patch. | ||
131 | |||
132 | |||
133 | |||
134 | 5) Select e-mail destination. | ||
122 | 135 | ||
123 | Look through the MAINTAINERS file and the source code, and determine | 136 | Look through the MAINTAINERS file and the source code, and determine |
124 | if your change applies to a specific subsystem of the kernel, with | 137 | if your change applies to a specific subsystem of the kernel, with |
@@ -146,7 +159,7 @@ discussed should the patch then be submitted to Linus. | |||
146 | 159 | ||
147 | 160 | ||
148 | 161 | ||
149 | 5) Select your CC (e-mail carbon copy) list. | 162 | 6) Select your CC (e-mail carbon copy) list. |
150 | 163 | ||
151 | Unless you have a reason NOT to do so, CC linux-kernel@vger.kernel.org. | 164 | Unless you have a reason NOT to do so, CC linux-kernel@vger.kernel.org. |
152 | 165 | ||
@@ -187,8 +200,7 @@ URL: <http://www.kernel.org/pub/linux/kernel/people/bunk/trivial/> | |||
187 | 200 | ||
188 | 201 | ||
189 | 202 | ||
190 | 203 | 7) No MIME, no links, no compression, no attachments. Just plain text. | |
191 | 6) No MIME, no links, no compression, no attachments. Just plain text. | ||
192 | 204 | ||
193 | Linus and other kernel developers need to be able to read and comment | 205 | Linus and other kernel developers need to be able to read and comment |
194 | on the changes you are submitting. It is important for a kernel | 206 | on the changes you are submitting. It is important for a kernel |
@@ -223,9 +235,9 @@ pref("mailnews.display.disable_format_flowed_support", true); | |||
223 | 235 | ||
224 | 236 | ||
225 | 237 | ||
226 | 7) E-mail size. | 238 | 8) E-mail size. |
227 | 239 | ||
228 | When sending patches to Linus, always follow step #6. | 240 | When sending patches to Linus, always follow step #7. |
229 | 241 | ||
230 | Large changes are not appropriate for mailing lists, and some | 242 | Large changes are not appropriate for mailing lists, and some |
231 | maintainers. If your patch, uncompressed, exceeds 40 kB in size, | 243 | maintainers. If your patch, uncompressed, exceeds 40 kB in size, |
@@ -234,7 +246,7 @@ server, and provide instead a URL (link) pointing to your patch. | |||
234 | 246 | ||
235 | 247 | ||
236 | 248 | ||
237 | 8) Name your kernel version. | 249 | 9) Name your kernel version. |
238 | 250 | ||
239 | It is important to note, either in the subject line or in the patch | 251 | It is important to note, either in the subject line or in the patch |
240 | description, the kernel version to which this patch applies. | 252 | description, the kernel version to which this patch applies. |
@@ -244,7 +256,7 @@ Linus will not apply it. | |||
244 | 256 | ||
245 | 257 | ||
246 | 258 | ||
247 | 9) Don't get discouraged. Re-submit. | 259 | 10) Don't get discouraged. Re-submit. |
248 | 260 | ||
249 | After you have submitted your change, be patient and wait. If Linus | 261 | After you have submitted your change, be patient and wait. If Linus |
250 | likes your change and applies it, it will appear in the next version | 262 | likes your change and applies it, it will appear in the next version |
@@ -270,7 +282,7 @@ When in doubt, solicit comments on linux-kernel mailing list. | |||
270 | 282 | ||
271 | 283 | ||
272 | 284 | ||
273 | 10) Include PATCH in the subject | 285 | 11) Include PATCH in the subject |
274 | 286 | ||
275 | Due to high e-mail traffic to Linus, and to linux-kernel, it is common | 287 | Due to high e-mail traffic to Linus, and to linux-kernel, it is common |
276 | convention to prefix your subject line with [PATCH]. This lets Linus | 288 | convention to prefix your subject line with [PATCH]. This lets Linus |
@@ -279,7 +291,7 @@ e-mail discussions. | |||
279 | 291 | ||
280 | 292 | ||
281 | 293 | ||
282 | 11) Sign your work | 294 | 12) Sign your work |
283 | 295 | ||
284 | To improve tracking of who did what, especially with patches that can | 296 | To improve tracking of who did what, especially with patches that can |
285 | percolate to their final resting place in the kernel through several | 297 | percolate to their final resting place in the kernel through several |
@@ -328,7 +340,8 @@ now, but you can do this to mark internal company procedures or just | |||
328 | point out some special detail about the sign-off. | 340 | point out some special detail about the sign-off. |
329 | 341 | ||
330 | 342 | ||
331 | 12) The canonical patch format | 343 | |
344 | 13) The canonical patch format | ||
332 | 345 | ||
333 | The canonical patch subject line is: | 346 | The canonical patch subject line is: |
334 | 347 | ||
@@ -427,6 +440,10 @@ section Linus Computer Science 101. | |||
427 | Nuff said. If your code deviates too much from this, it is likely | 440 | Nuff said. If your code deviates too much from this, it is likely |
428 | to be rejected without further review, and without comment. | 441 | to be rejected without further review, and without comment. |
429 | 442 | ||
443 | Check your patches with the patch style checker prior to submission | ||
444 | (scripts/checkpatch.pl). You should be able to justify all | ||
445 | violations that remain in your patch. | ||
446 | |||
430 | 447 | ||
431 | 448 | ||
432 | 2) #ifdefs are ugly | 449 | 2) #ifdefs are ugly |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 2d7ea85075ba..49ae1ea9e868 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -70,6 +70,7 @@ Who: David Miller <davem@davemloft.net> | |||
70 | 70 | ||
71 | What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. | 71 | What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. |
72 | When: December 2006 | 72 | When: December 2006 |
73 | Files: include/linux/video_decoder.h | ||
73 | Why: V4L1 AP1 was replaced by V4L2 API. during migration from 2.4 to 2.6 | 74 | Why: V4L1 AP1 was replaced by V4L2 API. during migration from 2.4 to 2.6 |
74 | series. The old API have lots of drawbacks and don't provide enough | 75 | series. The old API have lots of drawbacks and don't provide enough |
75 | means to work with all video and audio standards. The newer API is | 76 | means to work with all video and audio standards. The newer API is |
diff --git a/Documentation/hrtimer/timer_stats.txt b/Documentation/hrtimer/timer_stats.txt index 27f782e3593f..22b0814d0ad0 100644 --- a/Documentation/hrtimer/timer_stats.txt +++ b/Documentation/hrtimer/timer_stats.txt | |||
@@ -2,9 +2,10 @@ timer_stats - timer usage statistics | |||
2 | ------------------------------------ | 2 | ------------------------------------ |
3 | 3 | ||
4 | timer_stats is a debugging facility to make the timer (ab)usage in a Linux | 4 | timer_stats is a debugging facility to make the timer (ab)usage in a Linux |
5 | system visible to kernel and userspace developers. It is not intended for | 5 | system visible to kernel and userspace developers. If enabled in the config |
6 | production usage as it adds significant overhead to the (hr)timer code and the | 6 | but not used it has almost zero runtime overhead, and a relatively small |
7 | (hr)timer data structures. | 7 | data structure overhead. Even if collection is enabled runtime all the |
8 | locking is per-CPU and lookup is hashed. | ||
8 | 9 | ||
9 | timer_stats should be used by kernel and userspace developers to verify that | 10 | timer_stats should be used by kernel and userspace developers to verify that |
10 | their code does not make unduly use of timers. This helps to avoid unnecessary | 11 | their code does not make unduly use of timers. This helps to avoid unnecessary |
diff --git a/Documentation/ia64/aliasing-test.c b/Documentation/ia64/aliasing-test.c index 3153167b41c3..d485256ee1ce 100644 --- a/Documentation/ia64/aliasing-test.c +++ b/Documentation/ia64/aliasing-test.c | |||
@@ -197,7 +197,7 @@ skip: | |||
197 | return rc; | 197 | return rc; |
198 | } | 198 | } |
199 | 199 | ||
200 | main() | 200 | int main() |
201 | { | 201 | { |
202 | int rc; | 202 | int rc; |
203 | 203 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index f63d03a6c865..124b9508ae2e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -30,8 +30,11 @@ trivial patch so apply some common sense. | |||
30 | job the maintainers (and especially Linus) do is to keep things | 30 | job the maintainers (and especially Linus) do is to keep things |
31 | looking the same. Sometimes this means that the clever hack in | 31 | looking the same. Sometimes this means that the clever hack in |
32 | your driver to get around a problem actually needs to become a | 32 | your driver to get around a problem actually needs to become a |
33 | generalized kernel feature ready for next time. See | 33 | generalized kernel feature ready for next time. |
34 | Documentation/CodingStyle for guidance here. | 34 | |
35 | PLEASE check your patch with the automated style checker | ||
36 | (scripts/checkpatch.pl) to catch trival style violations. | ||
37 | See Documentation/CodingStyle for guidance here. | ||
35 | 38 | ||
36 | PLEASE try to include any credit lines you want added with the | 39 | PLEASE try to include any credit lines you want added with the |
37 | patch. It avoids people being missed off by mistake and makes | 40 | patch. It avoids people being missed off by mistake and makes |
@@ -972,6 +975,15 @@ M: johannes@sipsolutions.net | |||
972 | L: linux-wireless@vger.kernel.org | 975 | L: linux-wireless@vger.kernel.org |
973 | S: Maintained | 976 | S: Maintained |
974 | 977 | ||
978 | CHECKPATCH | ||
979 | P: Andy Whitcroft | ||
980 | M: apw@shadowen.org | ||
981 | P: Randy Dunlap | ||
982 | M: rdunlap@xenotime.net | ||
983 | P: Joel Schopp | ||
984 | M: jschopp@austin.ibm.com | ||
985 | S: Supported | ||
986 | |||
975 | COMMON INTERNET FILE SYSTEM (CIFS) | 987 | COMMON INTERNET FILE SYSTEM (CIFS) |
976 | P: Steve French | 988 | P: Steve French |
977 | M: sfrench@samba.org | 989 | M: sfrench@samba.org |
@@ -2888,8 +2900,8 @@ W: ftp://ftp.kernel.org/pub/linux/kernel/people/rml/preempt-kernel | |||
2888 | S: Supported | 2900 | S: Supported |
2889 | 2901 | ||
2890 | PRISM54 WIRELESS DRIVER | 2902 | PRISM54 WIRELESS DRIVER |
2891 | P: Prism54 Development Team | 2903 | P: Luis R. Rodriguez |
2892 | M: developers@islsm.org | 2904 | M: mcgrof@gmail.com |
2893 | L: linux-wireless@vger.kernel.org | 2905 | L: linux-wireless@vger.kernel.org |
2894 | W: http://prism54.org | 2906 | W: http://prism54.org |
2895 | S: Maintained | 2907 | S: Maintained |
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 770f717bd250..79c6e5a24456 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig | |||
@@ -83,22 +83,20 @@ choice | |||
83 | check out the Linux/Alpha FAQ, accessible on the WWW from | 83 | check out the Linux/Alpha FAQ, accessible on the WWW from |
84 | <http://www.alphalinux.org/>. In summary: | 84 | <http://www.alphalinux.org/>. In summary: |
85 | 85 | ||
86 | Alcor/Alpha-XLT AS 600 | 86 | Alcor/Alpha-XLT AS 600, AS 500, XL-300, XL-366 |
87 | Alpha-XL XL-233, XL-266 | 87 | Alpha-XL XL-233, XL-266 |
88 | AlphaBook1 Alpha laptop | 88 | AlphaBook1 Alpha laptop |
89 | Avanti AS 200, AS 205, AS 250, AS 255, AS 300, AS 400 | 89 | Avanti AS 200, AS 205, AS 250, AS 255, AS 300, AS 400 |
90 | Cabriolet AlphaPC64, AlphaPCI64 | 90 | Cabriolet AlphaPC64, AlphaPCI64 |
91 | DP264 DP264 | 91 | DP264 DP264 / DS20 / ES40 / DS10 / DS10L |
92 | EB164 EB164 21164 evaluation board | 92 | EB164 EB164 21164 evaluation board |
93 | EB64+ EB64+ 21064 evaluation board | 93 | EB64+ EB64+ 21064 evaluation board |
94 | EB66 EB66 21066 evaluation board | 94 | EB66 EB66 21066 evaluation board |
95 | EB66+ EB66+ 21066 evaluation board | 95 | EB66+ EB66+ 21066 evaluation board |
96 | Jensen DECpc 150, DEC 2000 model 300, | 96 | Jensen DECpc 150, DEC 2000 models 300, 500 |
97 | DEC 2000 model 500 | ||
98 | LX164 AlphaPC164-LX | 97 | LX164 AlphaPC164-LX |
99 | Lynx AS 2100A | 98 | Lynx AS 2100A |
100 | Miata Personal Workstation 433a, 433au, 500a, | 99 | Miata Personal Workstation 433/500/600 a/au |
101 | 500au, 600a, or 600au | ||
102 | Marvel AlphaServer ES47 / ES80 / GS1280 | 100 | Marvel AlphaServer ES47 / ES80 / GS1280 |
103 | Mikasa AS 1000 | 101 | Mikasa AS 1000 |
104 | Noname AXPpci33, UDB (Multia) | 102 | Noname AXPpci33, UDB (Multia) |
@@ -108,9 +106,9 @@ choice | |||
108 | Ruffian RPX164-2, AlphaPC164-UX, AlphaPC164-BX | 106 | Ruffian RPX164-2, AlphaPC164-UX, AlphaPC164-BX |
109 | SX164 AlphaPC164-SX | 107 | SX164 AlphaPC164-SX |
110 | Sable AS 2000, AS 2100 | 108 | Sable AS 2000, AS 2100 |
111 | Shark DS 20L | 109 | Shark DS 20L |
112 | Takara Takara | 110 | Takara Takara (OEM) |
113 | Titan AlphaServer ES45 / DS25 | 111 | Titan AlphaServer ES45 / DS25 / DS15 |
114 | Wildfire AlphaServer GS 40/80/160/320 | 112 | Wildfire AlphaServer GS 40/80/160/320 |
115 | 113 | ||
116 | If you don't know what to do, choose "generic". | 114 | If you don't know what to do, choose "generic". |
@@ -481,6 +479,15 @@ config ALPHA_BROKEN_IRQ_MASK | |||
481 | depends on ALPHA_GENERIC || ALPHA_PC164 | 479 | depends on ALPHA_GENERIC || ALPHA_PC164 |
482 | default y | 480 | default y |
483 | 481 | ||
482 | config VGA_HOSE | ||
483 | bool | ||
484 | depends on ALPHA_GENERIC || ALPHA_TITAN || ALPHA_MARVEL || ALPHA_TSUNAMI | ||
485 | default y | ||
486 | help | ||
487 | Support VGA on an arbitrary hose; needed for several platforms | ||
488 | which always have multiple hoses, and whose consoles support it. | ||
489 | |||
490 | |||
484 | config ALPHA_SRM | 491 | config ALPHA_SRM |
485 | bool "Use SRM as bootloader" if ALPHA_CABRIOLET || ALPHA_AVANTI_CH || ALPHA_EB64P || ALPHA_PC164 || ALPHA_TAKARA || ALPHA_EB164 || ALPHA_ALCOR || ALPHA_MIATA || ALPHA_LX164 || ALPHA_SX164 || ALPHA_NAUTILUS || ALPHA_NONAME | 492 | bool "Use SRM as bootloader" if ALPHA_CABRIOLET || ALPHA_AVANTI_CH || ALPHA_EB64P || ALPHA_PC164 || ALPHA_TAKARA || ALPHA_EB164 || ALPHA_ALCOR || ALPHA_MIATA || ALPHA_LX164 || ALPHA_SX164 || ALPHA_NAUTILUS || ALPHA_NONAME |
486 | default y if ALPHA_JENSEN || ALPHA_MIKASA || ALPHA_SABLE || ALPHA_LYNX || ALPHA_NORITAKE || ALPHA_DP264 || ALPHA_RAWHIDE || ALPHA_EIGER || ALPHA_WILDFIRE || ALPHA_TITAN || ALPHA_SHARK || ALPHA_MARVEL | 493 | default y if ALPHA_JENSEN || ALPHA_MIKASA || ALPHA_SABLE || ALPHA_LYNX || ALPHA_NORITAKE || ALPHA_DP264 || ALPHA_RAWHIDE || ALPHA_EIGER || ALPHA_WILDFIRE || ALPHA_TITAN || ALPHA_SHARK || ALPHA_MARVEL |
@@ -537,10 +544,14 @@ config HAVE_DEC_LOCK | |||
537 | default y | 544 | default y |
538 | 545 | ||
539 | config NR_CPUS | 546 | config NR_CPUS |
540 | int "Maximum number of CPUs (2-64)" | 547 | int "Maximum number of CPUs (2-32)" |
541 | range 2 64 | 548 | range 2 32 |
542 | depends on SMP | 549 | depends on SMP |
543 | default "64" | 550 | default "32" if ALPHA_GENERIC || ALPHA_MARVEL |
551 | default "4" if !ALPHA_GENERIC && !ALPHA_MARVEL | ||
552 | help | ||
553 | MARVEL support can handle a maximum of 32 CPUs, all the others | ||
554 | with working support have a maximum of 4 CPUs. | ||
544 | 555 | ||
545 | config ARCH_DISCONTIGMEM_ENABLE | 556 | config ARCH_DISCONTIGMEM_ENABLE |
546 | bool "Discontiguous Memory Support (EXPERIMENTAL)" | 557 | bool "Discontiguous Memory Support (EXPERIMENTAL)" |
@@ -644,6 +655,13 @@ source "arch/alpha/oprofile/Kconfig" | |||
644 | 655 | ||
645 | source "arch/alpha/Kconfig.debug" | 656 | source "arch/alpha/Kconfig.debug" |
646 | 657 | ||
658 | # DUMMY_CONSOLE may be defined in drivers/video/console/Kconfig | ||
659 | # but we also need it if VGA_HOSE is set | ||
660 | config DUMMY_CONSOLE | ||
661 | bool | ||
662 | depends on VGA_HOSE | ||
663 | default y | ||
664 | |||
647 | source "security/Kconfig" | 665 | source "security/Kconfig" |
648 | 666 | ||
649 | source "crypto/Kconfig" | 667 | source "crypto/Kconfig" |
diff --git a/arch/alpha/boot/tools/mkbb.c b/arch/alpha/boot/tools/mkbb.c index 23c7190b047c..632a7fd6d7dc 100644 --- a/arch/alpha/boot/tools/mkbb.c +++ b/arch/alpha/boot/tools/mkbb.c | |||
@@ -81,7 +81,7 @@ typedef union __bootblock { | |||
81 | #define bootblock_label __u1.__label | 81 | #define bootblock_label __u1.__label |
82 | #define bootblock_checksum __u2.__checksum | 82 | #define bootblock_checksum __u2.__checksum |
83 | 83 | ||
84 | main(int argc, char ** argv) | 84 | int main(int argc, char ** argv) |
85 | { | 85 | { |
86 | bootblock bootblock_from_disk; | 86 | bootblock bootblock_from_disk; |
87 | bootblock bootloader_image; | 87 | bootblock bootloader_image; |
diff --git a/arch/alpha/kernel/console.c b/arch/alpha/kernel/console.c index f313b34939bb..da711e37fc97 100644 --- a/arch/alpha/kernel/console.c +++ b/arch/alpha/kernel/console.c | |||
@@ -9,16 +9,20 @@ | |||
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/tty.h> | 10 | #include <linux/tty.h> |
11 | #include <linux/console.h> | 11 | #include <linux/console.h> |
12 | #include <linux/vt.h> | ||
12 | #include <asm/vga.h> | 13 | #include <asm/vga.h> |
13 | #include <asm/machvec.h> | 14 | #include <asm/machvec.h> |
14 | 15 | ||
16 | #include "pci_impl.h" | ||
17 | |||
15 | #ifdef CONFIG_VGA_HOSE | 18 | #ifdef CONFIG_VGA_HOSE |
16 | 19 | ||
17 | /* | 20 | struct pci_controller *pci_vga_hose; |
18 | * Externally-visible vga hose bases | 21 | static struct resource alpha_vga = { |
19 | */ | 22 | .name = "alpha-vga+", |
20 | unsigned long __vga_hose_io_base = 0; /* base for default hose */ | 23 | .start = 0x3C0, |
21 | unsigned long __vga_hose_mem_base = 0; /* base for default hose */ | 24 | .end = 0x3DF |
25 | }; | ||
22 | 26 | ||
23 | static struct pci_controller * __init | 27 | static struct pci_controller * __init |
24 | default_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2) | 28 | default_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2) |
@@ -30,36 +34,58 @@ default_vga_hose_select(struct pci_controller *h1, struct pci_controller *h2) | |||
30 | } | 34 | } |
31 | 35 | ||
32 | void __init | 36 | void __init |
33 | set_vga_hose(struct pci_controller *hose) | ||
34 | { | ||
35 | if (hose) { | ||
36 | __vga_hose_io_base = hose->io_space->start; | ||
37 | __vga_hose_mem_base = hose->mem_space->start; | ||
38 | } | ||
39 | } | ||
40 | |||
41 | void __init | ||
42 | locate_and_init_vga(void *(*sel_func)(void *, void *)) | 37 | locate_and_init_vga(void *(*sel_func)(void *, void *)) |
43 | { | 38 | { |
44 | struct pci_controller *hose = NULL; | 39 | struct pci_controller *hose = NULL; |
45 | struct pci_dev *dev = NULL; | 40 | struct pci_dev *dev = NULL; |
46 | 41 | ||
42 | /* Default the select function */ | ||
47 | if (!sel_func) sel_func = (void *)default_vga_hose_select; | 43 | if (!sel_func) sel_func = (void *)default_vga_hose_select; |
48 | 44 | ||
45 | /* Find the console VGA device */ | ||
49 | for(dev=NULL; (dev=pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev));) { | 46 | for(dev=NULL; (dev=pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, dev));) { |
50 | if (!hose) hose = dev->sysdata; | 47 | if (!hose) |
51 | else hose = sel_func(hose, dev->sysdata); | 48 | hose = dev->sysdata; |
49 | else | ||
50 | hose = sel_func(hose, dev->sysdata); | ||
52 | } | 51 | } |
53 | 52 | ||
54 | /* Did we already inititialize the correct one? */ | 53 | /* Did we already initialize the correct one? Is there one? */ |
55 | if (conswitchp == &vga_con && | 54 | if (!hose || (conswitchp == &vga_con && pci_vga_hose == hose)) |
56 | __vga_hose_io_base == hose->io_space->start && | ||
57 | __vga_hose_mem_base == hose->mem_space->start) | ||
58 | return; | 55 | return; |
59 | 56 | ||
60 | /* Set the VGA hose and init the new console */ | 57 | /* Create a new VGA ioport resource WRT the hose it is on. */ |
61 | set_vga_hose(hose); | 58 | alpha_vga.start += hose->io_space->start; |
59 | alpha_vga.end += hose->io_space->start; | ||
60 | request_resource(hose->io_space, &alpha_vga); | ||
61 | |||
62 | /* Set the VGA hose and init the new console. */ | ||
63 | pci_vga_hose = hose; | ||
62 | take_over_console(&vga_con, 0, MAX_NR_CONSOLES-1, 1); | 64 | take_over_console(&vga_con, 0, MAX_NR_CONSOLES-1, 1); |
63 | } | 65 | } |
64 | 66 | ||
67 | void __init | ||
68 | find_console_vga_hose(void) | ||
69 | { | ||
70 | u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset); | ||
71 | |||
72 | if (pu64[7] == 3) { /* TERM_TYPE == graphics */ | ||
73 | struct pci_controller *hose; | ||
74 | int h = (pu64[30] >> 24) & 0xff; /* console hose # */ | ||
75 | |||
76 | /* | ||
77 | * Our hose numbering DOES match the console's, so find | ||
78 | * the right one... | ||
79 | */ | ||
80 | for (hose = hose_head; hose; hose = hose->next) { | ||
81 | if (hose->index == h) break; | ||
82 | } | ||
83 | |||
84 | if (hose) { | ||
85 | printk("Console graphics on hose %d\n", h); | ||
86 | pci_vga_hose = hose; | ||
87 | } | ||
88 | } | ||
89 | } | ||
90 | |||
65 | #endif | 91 | #endif |
diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c index 7f6a98455e74..f10d2eddd2c3 100644 --- a/arch/alpha/kernel/core_marvel.c +++ b/arch/alpha/kernel/core_marvel.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <asm/pgalloc.h> | 25 | #include <asm/pgalloc.h> |
26 | #include <asm/tlbflush.h> | 26 | #include <asm/tlbflush.h> |
27 | #include <asm/rtc.h> | 27 | #include <asm/rtc.h> |
28 | #include <asm/vga.h> | ||
28 | 29 | ||
29 | #include "proto.h" | 30 | #include "proto.h" |
30 | #include "pci_impl.h" | 31 | #include "pci_impl.h" |
@@ -367,9 +368,8 @@ marvel_io7_present(gct6_node *node) | |||
367 | } | 368 | } |
368 | 369 | ||
369 | static void __init | 370 | static void __init |
370 | marvel_init_vga_hose(void) | 371 | marvel_find_console_vga_hose(void) |
371 | { | 372 | { |
372 | #ifdef CONFIG_VGA_HOSE | ||
373 | u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset); | 373 | u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset); |
374 | 374 | ||
375 | if (pu64[7] == 3) { /* TERM_TYPE == graphics */ | 375 | if (pu64[7] == 3) { /* TERM_TYPE == graphics */ |
@@ -403,7 +403,6 @@ marvel_init_vga_hose(void) | |||
403 | pci_vga_hose = hose; | 403 | pci_vga_hose = hose; |
404 | } | 404 | } |
405 | } | 405 | } |
406 | #endif /* CONFIG_VGA_HOSE */ | ||
407 | } | 406 | } |
408 | 407 | ||
409 | gct6_search_struct gct_wanted_node_list[] = { | 408 | gct6_search_struct gct_wanted_node_list[] = { |
@@ -459,7 +458,7 @@ marvel_init_arch(void) | |||
459 | marvel_init_io7(io7); | 458 | marvel_init_io7(io7); |
460 | 459 | ||
461 | /* Check for graphic console location (if any). */ | 460 | /* Check for graphic console location (if any). */ |
462 | marvel_init_vga_hose(); | 461 | marvel_find_console_vga_hose(); |
463 | } | 462 | } |
464 | 463 | ||
465 | void | 464 | void |
@@ -684,9 +683,6 @@ __marvel_rtc_io(u8 b, unsigned long addr, int write) | |||
684 | /* | 683 | /* |
685 | * IO map support. | 684 | * IO map support. |
686 | */ | 685 | */ |
687 | |||
688 | #define __marvel_is_mem_vga(a) (((a) >= 0xa0000) && ((a) <= 0xc0000)) | ||
689 | |||
690 | void __iomem * | 686 | void __iomem * |
691 | marvel_ioremap(unsigned long addr, unsigned long size) | 687 | marvel_ioremap(unsigned long addr, unsigned long size) |
692 | { | 688 | { |
@@ -698,13 +694,9 @@ marvel_ioremap(unsigned long addr, unsigned long size) | |||
698 | unsigned long pfn; | 694 | unsigned long pfn; |
699 | 695 | ||
700 | /* | 696 | /* |
701 | * Adjust the addr. | 697 | * Adjust the address. |
702 | */ | 698 | */ |
703 | #ifdef CONFIG_VGA_HOSE | 699 | FIXUP_MEMADDR_VGA(addr); |
704 | if (pci_vga_hose && __marvel_is_mem_vga(addr)) { | ||
705 | addr += pci_vga_hose->mem_space->start; | ||
706 | } | ||
707 | #endif | ||
708 | 700 | ||
709 | /* | 701 | /* |
710 | * Find the hose. | 702 | * Find the hose. |
@@ -781,7 +773,9 @@ marvel_ioremap(unsigned long addr, unsigned long size) | |||
781 | return (void __iomem *) vaddr; | 773 | return (void __iomem *) vaddr; |
782 | } | 774 | } |
783 | 775 | ||
784 | return NULL; | 776 | /* Assume it was already a reasonable address */ |
777 | vaddr = baddr + hose->mem_space->start; | ||
778 | return (void __iomem *) vaddr; | ||
785 | } | 779 | } |
786 | 780 | ||
787 | void | 781 | void |
@@ -803,21 +797,12 @@ marvel_is_mmio(const volatile void __iomem *xaddr) | |||
803 | return (addr & 0xFF000000UL) == 0; | 797 | return (addr & 0xFF000000UL) == 0; |
804 | } | 798 | } |
805 | 799 | ||
806 | #define __marvel_is_port_vga(a) \ | ||
807 | (((a) >= 0x3b0) && ((a) < 0x3e0) && ((a) != 0x3b3) && ((a) != 0x3d3)) | ||
808 | #define __marvel_is_port_kbd(a) (((a) == 0x60) || ((a) == 0x64)) | 800 | #define __marvel_is_port_kbd(a) (((a) == 0x60) || ((a) == 0x64)) |
809 | #define __marvel_is_port_rtc(a) (((a) == 0x70) || ((a) == 0x71)) | 801 | #define __marvel_is_port_rtc(a) (((a) == 0x70) || ((a) == 0x71)) |
810 | 802 | ||
811 | void __iomem *marvel_ioportmap (unsigned long addr) | 803 | void __iomem *marvel_ioportmap (unsigned long addr) |
812 | { | 804 | { |
813 | if (__marvel_is_port_rtc (addr) || __marvel_is_port_kbd(addr)) | 805 | FIXUP_IOADDR_VGA(addr); |
814 | ; | ||
815 | #ifdef CONFIG_VGA_HOSE | ||
816 | else if (__marvel_is_port_vga (addr) && pci_vga_hose) | ||
817 | addr += pci_vga_hose->io_space->start; | ||
818 | #endif | ||
819 | else | ||
820 | return NULL; | ||
821 | return (void __iomem *)addr; | 806 | return (void __iomem *)addr; |
822 | } | 807 | } |
823 | 808 | ||
@@ -829,8 +814,14 @@ marvel_ioread8(void __iomem *xaddr) | |||
829 | return 0; | 814 | return 0; |
830 | else if (__marvel_is_port_rtc(addr)) | 815 | else if (__marvel_is_port_rtc(addr)) |
831 | return __marvel_rtc_io(0, addr, 0); | 816 | return __marvel_rtc_io(0, addr, 0); |
832 | else | 817 | else if (marvel_is_ioaddr(addr)) |
833 | return __kernel_ldbu(*(vucp)addr); | 818 | return __kernel_ldbu(*(vucp)addr); |
819 | else | ||
820 | /* this should catch other legacy addresses | ||
821 | that would normally fail on MARVEL, | ||
822 | because there really is nothing there... | ||
823 | */ | ||
824 | return ~0; | ||
834 | } | 825 | } |
835 | 826 | ||
836 | void | 827 | void |
@@ -841,7 +832,7 @@ marvel_iowrite8(u8 b, void __iomem *xaddr) | |||
841 | return; | 832 | return; |
842 | else if (__marvel_is_port_rtc(addr)) | 833 | else if (__marvel_is_port_rtc(addr)) |
843 | __marvel_rtc_io(b, addr, 1); | 834 | __marvel_rtc_io(b, addr, 1); |
844 | else | 835 | else if (marvel_is_ioaddr(addr)) |
845 | __kernel_stb(b, *(vucp)addr); | 836 | __kernel_stb(b, *(vucp)addr); |
846 | } | 837 | } |
847 | 838 | ||
diff --git a/arch/alpha/kernel/core_titan.c b/arch/alpha/kernel/core_titan.c index 3662fef7db9a..819326627b96 100644 --- a/arch/alpha/kernel/core_titan.c +++ b/arch/alpha/kernel/core_titan.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/smp.h> | 21 | #include <asm/smp.h> |
22 | #include <asm/pgalloc.h> | 22 | #include <asm/pgalloc.h> |
23 | #include <asm/tlbflush.h> | 23 | #include <asm/tlbflush.h> |
24 | #include <asm/vga.h> | ||
24 | 25 | ||
25 | #include "proto.h" | 26 | #include "proto.h" |
26 | #include "pci_impl.h" | 27 | #include "pci_impl.h" |
@@ -35,6 +36,11 @@ struct | |||
35 | } saved_config[4] __attribute__((common)); | 36 | } saved_config[4] __attribute__((common)); |
36 | 37 | ||
37 | /* | 38 | /* |
39 | * Is PChip 1 present? No need to query it more than once. | ||
40 | */ | ||
41 | static int titan_pchip1_present; | ||
42 | |||
43 | /* | ||
38 | * BIOS32-style PCI interface: | 44 | * BIOS32-style PCI interface: |
39 | */ | 45 | */ |
40 | 46 | ||
@@ -344,43 +350,17 @@ titan_init_one_pachip_port(titan_pachip_port *port, int index) | |||
344 | static void __init | 350 | static void __init |
345 | titan_init_pachips(titan_pachip *pachip0, titan_pachip *pachip1) | 351 | titan_init_pachips(titan_pachip *pachip0, titan_pachip *pachip1) |
346 | { | 352 | { |
347 | int pchip1_present = TITAN_cchip->csc.csr & 1L<<14; | 353 | titan_pchip1_present = TITAN_cchip->csc.csr & 1L<<14; |
348 | 354 | ||
349 | /* Init the ports in hose order... */ | 355 | /* Init the ports in hose order... */ |
350 | titan_init_one_pachip_port(&pachip0->g_port, 0); /* hose 0 */ | 356 | titan_init_one_pachip_port(&pachip0->g_port, 0); /* hose 0 */ |
351 | if (pchip1_present) | 357 | if (titan_pchip1_present) |
352 | titan_init_one_pachip_port(&pachip1->g_port, 1);/* hose 1 */ | 358 | titan_init_one_pachip_port(&pachip1->g_port, 1);/* hose 1 */ |
353 | titan_init_one_pachip_port(&pachip0->a_port, 2); /* hose 2 */ | 359 | titan_init_one_pachip_port(&pachip0->a_port, 2); /* hose 2 */ |
354 | if (pchip1_present) | 360 | if (titan_pchip1_present) |
355 | titan_init_one_pachip_port(&pachip1->a_port, 3);/* hose 3 */ | 361 | titan_init_one_pachip_port(&pachip1->a_port, 3);/* hose 3 */ |
356 | } | 362 | } |
357 | 363 | ||
358 | static void __init | ||
359 | titan_init_vga_hose(void) | ||
360 | { | ||
361 | #ifdef CONFIG_VGA_HOSE | ||
362 | u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset); | ||
363 | |||
364 | if (pu64[7] == 3) { /* TERM_TYPE == graphics */ | ||
365 | struct pci_controller *hose; | ||
366 | int h = (pu64[30] >> 24) & 0xff; /* console hose # */ | ||
367 | |||
368 | /* | ||
369 | * Our hose numbering matches the console's, so just find | ||
370 | * the right one... | ||
371 | */ | ||
372 | for (hose = hose_head; hose; hose = hose->next) { | ||
373 | if (hose->index == h) break; | ||
374 | } | ||
375 | |||
376 | if (hose) { | ||
377 | printk("Console graphics on hose %d\n", hose->index); | ||
378 | pci_vga_hose = hose; | ||
379 | } | ||
380 | } | ||
381 | #endif /* CONFIG_VGA_HOSE */ | ||
382 | } | ||
383 | |||
384 | void __init | 364 | void __init |
385 | titan_init_arch(void) | 365 | titan_init_arch(void) |
386 | { | 366 | { |
@@ -406,6 +386,7 @@ titan_init_arch(void) | |||
406 | 386 | ||
407 | /* With multiple PCI busses, we play with I/O as physical addrs. */ | 387 | /* With multiple PCI busses, we play with I/O as physical addrs. */ |
408 | ioport_resource.end = ~0UL; | 388 | ioport_resource.end = ~0UL; |
389 | iomem_resource.end = ~0UL; | ||
409 | 390 | ||
410 | /* PCI DMA Direct Mapping is 1GB at 2GB. */ | 391 | /* PCI DMA Direct Mapping is 1GB at 2GB. */ |
411 | __direct_map_base = 0x80000000; | 392 | __direct_map_base = 0x80000000; |
@@ -415,7 +396,7 @@ titan_init_arch(void) | |||
415 | titan_init_pachips(TITAN_pachip0, TITAN_pachip1); | 396 | titan_init_pachips(TITAN_pachip0, TITAN_pachip1); |
416 | 397 | ||
417 | /* Check for graphic console location (if any). */ | 398 | /* Check for graphic console location (if any). */ |
418 | titan_init_vga_hose(); | 399 | find_console_vga_hose(); |
419 | } | 400 | } |
420 | 401 | ||
421 | static void | 402 | static void |
@@ -441,9 +422,7 @@ titan_kill_one_pachip_port(titan_pachip_port *port, int index) | |||
441 | static void | 422 | static void |
442 | titan_kill_pachips(titan_pachip *pachip0, titan_pachip *pachip1) | 423 | titan_kill_pachips(titan_pachip *pachip0, titan_pachip *pachip1) |
443 | { | 424 | { |
444 | int pchip1_present = TITAN_cchip->csc.csr & 1L<<14; | 425 | if (titan_pchip1_present) { |
445 | |||
446 | if (pchip1_present) { | ||
447 | titan_kill_one_pachip_port(&pachip1->g_port, 1); | 426 | titan_kill_one_pachip_port(&pachip1->g_port, 1); |
448 | titan_kill_one_pachip_port(&pachip1->a_port, 3); | 427 | titan_kill_one_pachip_port(&pachip1->a_port, 3); |
449 | } | 428 | } |
@@ -463,6 +442,14 @@ titan_kill_arch(int mode) | |||
463 | */ | 442 | */ |
464 | 443 | ||
465 | void __iomem * | 444 | void __iomem * |
445 | titan_ioportmap(unsigned long addr) | ||
446 | { | ||
447 | FIXUP_IOADDR_VGA(addr); | ||
448 | return (void __iomem *)(addr + TITAN_IO_BIAS); | ||
449 | } | ||
450 | |||
451 | |||
452 | void __iomem * | ||
466 | titan_ioremap(unsigned long addr, unsigned long size) | 453 | titan_ioremap(unsigned long addr, unsigned long size) |
467 | { | 454 | { |
468 | int h = (addr & TITAN_HOSE_MASK) >> TITAN_HOSE_SHIFT; | 455 | int h = (addr & TITAN_HOSE_MASK) >> TITAN_HOSE_SHIFT; |
@@ -475,14 +462,12 @@ titan_ioremap(unsigned long addr, unsigned long size) | |||
475 | unsigned long pfn; | 462 | unsigned long pfn; |
476 | 463 | ||
477 | /* | 464 | /* |
478 | * Adjust the addr. | 465 | * Adjust the address and hose, if necessary. |
479 | */ | 466 | */ |
480 | #ifdef CONFIG_VGA_HOSE | 467 | if (pci_vga_hose && __is_mem_vga(addr)) { |
481 | if (pci_vga_hose && __titan_is_mem_vga(addr)) { | ||
482 | h = pci_vga_hose->index; | 468 | h = pci_vga_hose->index; |
483 | addr += pci_vga_hose->mem_space->start; | 469 | addr += pci_vga_hose->mem_space->start; |
484 | } | 470 | } |
485 | #endif | ||
486 | 471 | ||
487 | /* | 472 | /* |
488 | * Find the hose. | 473 | * Find the hose. |
@@ -521,8 +506,10 @@ titan_ioremap(unsigned long addr, unsigned long size) | |||
521 | * Map it | 506 | * Map it |
522 | */ | 507 | */ |
523 | area = get_vm_area(size, VM_IOREMAP); | 508 | area = get_vm_area(size, VM_IOREMAP); |
524 | if (!area) | 509 | if (!area) { |
510 | printk("ioremap failed... no vm_area...\n"); | ||
525 | return NULL; | 511 | return NULL; |
512 | } | ||
526 | 513 | ||
527 | ptes = hose->sg_pci->ptes; | 514 | ptes = hose->sg_pci->ptes; |
528 | for (vaddr = (unsigned long)area->addr; | 515 | for (vaddr = (unsigned long)area->addr; |
@@ -539,7 +526,7 @@ titan_ioremap(unsigned long addr, unsigned long size) | |||
539 | if (__alpha_remap_area_pages(vaddr, | 526 | if (__alpha_remap_area_pages(vaddr, |
540 | pfn << PAGE_SHIFT, | 527 | pfn << PAGE_SHIFT, |
541 | PAGE_SIZE, 0)) { | 528 | PAGE_SIZE, 0)) { |
542 | printk("FAILED to map...\n"); | 529 | printk("FAILED to remap_area_pages...\n"); |
543 | vfree(area->addr); | 530 | vfree(area->addr); |
544 | return NULL; | 531 | return NULL; |
545 | } | 532 | } |
@@ -551,7 +538,8 @@ titan_ioremap(unsigned long addr, unsigned long size) | |||
551 | return (void __iomem *) vaddr; | 538 | return (void __iomem *) vaddr; |
552 | } | 539 | } |
553 | 540 | ||
554 | return NULL; | 541 | /* Assume a legacy (read: VGA) address, and return appropriately. */ |
542 | return (void __iomem *)(addr + TITAN_MEM_BIAS); | ||
555 | } | 543 | } |
556 | 544 | ||
557 | void | 545 | void |
@@ -574,6 +562,7 @@ titan_is_mmio(const volatile void __iomem *xaddr) | |||
574 | } | 562 | } |
575 | 563 | ||
576 | #ifndef CONFIG_ALPHA_GENERIC | 564 | #ifndef CONFIG_ALPHA_GENERIC |
565 | EXPORT_SYMBOL(titan_ioportmap); | ||
577 | EXPORT_SYMBOL(titan_ioremap); | 566 | EXPORT_SYMBOL(titan_ioremap); |
578 | EXPORT_SYMBOL(titan_iounmap); | 567 | EXPORT_SYMBOL(titan_iounmap); |
579 | EXPORT_SYMBOL(titan_is_mmio); | 568 | EXPORT_SYMBOL(titan_is_mmio); |
@@ -750,6 +739,7 @@ titan_agp_info(void) | |||
750 | if (titan_query_agp(port)) | 739 | if (titan_query_agp(port)) |
751 | hosenum = 2; | 740 | hosenum = 2; |
752 | if (hosenum < 0 && | 741 | if (hosenum < 0 && |
742 | titan_pchip1_present && | ||
753 | titan_query_agp(port = &TITAN_pachip1->a_port)) | 743 | titan_query_agp(port = &TITAN_pachip1->a_port)) |
754 | hosenum = 3; | 744 | hosenum = 3; |
755 | 745 | ||
diff --git a/arch/alpha/kernel/core_tsunami.c b/arch/alpha/kernel/core_tsunami.c index ce623c6e55e1..ef91e09590d4 100644 --- a/arch/alpha/kernel/core_tsunami.c +++ b/arch/alpha/kernel/core_tsunami.c | |||
@@ -19,6 +19,7 @@ | |||
19 | 19 | ||
20 | #include <asm/ptrace.h> | 20 | #include <asm/ptrace.h> |
21 | #include <asm/smp.h> | 21 | #include <asm/smp.h> |
22 | #include <asm/vga.h> | ||
22 | 23 | ||
23 | #include "proto.h" | 24 | #include "proto.h" |
24 | #include "pci_impl.h" | 25 | #include "pci_impl.h" |
@@ -349,6 +350,26 @@ tsunami_init_one_pchip(tsunami_pchip *pchip, int index) | |||
349 | tsunami_pci_tbi(hose, 0, -1); | 350 | tsunami_pci_tbi(hose, 0, -1); |
350 | } | 351 | } |
351 | 352 | ||
353 | |||
354 | void __iomem * | ||
355 | tsunami_ioportmap(unsigned long addr) | ||
356 | { | ||
357 | FIXUP_IOADDR_VGA(addr); | ||
358 | return (void __iomem *)(addr + TSUNAMI_IO_BIAS); | ||
359 | } | ||
360 | |||
361 | void __iomem * | ||
362 | tsunami_ioremap(unsigned long addr, unsigned long size) | ||
363 | { | ||
364 | FIXUP_MEMADDR_VGA(addr); | ||
365 | return (void __iomem *)(addr + TSUNAMI_MEM_BIAS); | ||
366 | } | ||
367 | |||
368 | #ifndef CONFIG_ALPHA_GENERIC | ||
369 | EXPORT_SYMBOL(tsunami_ioportmap); | ||
370 | EXPORT_SYMBOL(tsunami_ioremap); | ||
371 | #endif | ||
372 | |||
352 | void __init | 373 | void __init |
353 | tsunami_init_arch(void) | 374 | tsunami_init_arch(void) |
354 | { | 375 | { |
@@ -393,6 +414,9 @@ tsunami_init_arch(void) | |||
393 | tsunami_init_one_pchip(TSUNAMI_pchip0, 0); | 414 | tsunami_init_one_pchip(TSUNAMI_pchip0, 0); |
394 | if (TSUNAMI_cchip->csc.csr & 1L<<14) | 415 | if (TSUNAMI_cchip->csc.csr & 1L<<14) |
395 | tsunami_init_one_pchip(TSUNAMI_pchip1, 1); | 416 | tsunami_init_one_pchip(TSUNAMI_pchip1, 1); |
417 | |||
418 | /* Check for graphic console location (if any). */ | ||
419 | find_console_vga_hose(); | ||
396 | } | 420 | } |
397 | 421 | ||
398 | static void | 422 | static void |
diff --git a/arch/alpha/kernel/proto.h b/arch/alpha/kernel/proto.h index 95912ecc65e1..708d5ca87782 100644 --- a/arch/alpha/kernel/proto.h +++ b/arch/alpha/kernel/proto.h | |||
@@ -108,6 +108,15 @@ extern int wildfire_cpuid_to_nid(int); | |||
108 | extern unsigned long wildfire_node_mem_start(int); | 108 | extern unsigned long wildfire_node_mem_start(int); |
109 | extern unsigned long wildfire_node_mem_size(int); | 109 | extern unsigned long wildfire_node_mem_size(int); |
110 | 110 | ||
111 | /* console.c */ | ||
112 | #ifdef CONFIG_VGA_HOSE | ||
113 | extern void find_console_vga_hose(void); | ||
114 | extern void locate_and_init_vga(void *(*)(void *, void *)); | ||
115 | #else | ||
116 | static inline void find_console_vga_hose(void) { } | ||
117 | static inline void locate_and_init_vga(void *(*sel_func)(void *, void *)) { } | ||
118 | #endif | ||
119 | |||
111 | /* setup.c */ | 120 | /* setup.c */ |
112 | extern unsigned long srm_hae; | 121 | extern unsigned long srm_hae; |
113 | extern int boot_cpuid; | 122 | extern int boot_cpuid; |
diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c index 85d2f933dd07..c71b0fd7a61f 100644 --- a/arch/alpha/kernel/sys_dp264.c +++ b/arch/alpha/kernel/sys_dp264.c | |||
@@ -543,6 +543,7 @@ dp264_init_pci(void) | |||
543 | { | 543 | { |
544 | common_init_pci(); | 544 | common_init_pci(); |
545 | SMC669_Init(0); | 545 | SMC669_Init(0); |
546 | locate_and_init_vga(NULL); | ||
546 | } | 547 | } |
547 | 548 | ||
548 | static void __init | 549 | static void __init |
@@ -551,6 +552,14 @@ monet_init_pci(void) | |||
551 | common_init_pci(); | 552 | common_init_pci(); |
552 | SMC669_Init(1); | 553 | SMC669_Init(1); |
553 | es1888_init(); | 554 | es1888_init(); |
555 | locate_and_init_vga(NULL); | ||
556 | } | ||
557 | |||
558 | static void __init | ||
559 | clipper_init_pci(void) | ||
560 | { | ||
561 | common_init_pci(); | ||
562 | locate_and_init_vga(NULL); | ||
554 | } | 563 | } |
555 | 564 | ||
556 | static void __init | 565 | static void __init |
@@ -655,7 +664,7 @@ struct alpha_machine_vector clipper_mv __initmv = { | |||
655 | .init_arch = tsunami_init_arch, | 664 | .init_arch = tsunami_init_arch, |
656 | .init_irq = clipper_init_irq, | 665 | .init_irq = clipper_init_irq, |
657 | .init_rtc = common_init_rtc, | 666 | .init_rtc = common_init_rtc, |
658 | .init_pci = common_init_pci, | 667 | .init_pci = clipper_init_pci, |
659 | .kill_arch = tsunami_kill_arch, | 668 | .kill_arch = tsunami_kill_arch, |
660 | .pci_map_irq = clipper_map_irq, | 669 | .pci_map_irq = clipper_map_irq, |
661 | .pci_swizzle = common_swizzle, | 670 | .pci_swizzle = common_swizzle, |
diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c index e349f03b830e..0bcb968cb60a 100644 --- a/arch/alpha/kernel/sys_marvel.c +++ b/arch/alpha/kernel/sys_marvel.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <asm/core_marvel.h> | 22 | #include <asm/core_marvel.h> |
23 | #include <asm/hwrpb.h> | 23 | #include <asm/hwrpb.h> |
24 | #include <asm/tlbflush.h> | 24 | #include <asm/tlbflush.h> |
25 | #include <asm/vga.h> | ||
25 | 26 | ||
26 | #include "proto.h" | 27 | #include "proto.h" |
27 | #include "err_impl.h" | 28 | #include "err_impl.h" |
@@ -412,10 +413,7 @@ marvel_init_pci(void) | |||
412 | 413 | ||
413 | pci_probe_only = 1; | 414 | pci_probe_only = 1; |
414 | common_init_pci(); | 415 | common_init_pci(); |
415 | |||
416 | #ifdef CONFIG_VGA_HOSE | ||
417 | locate_and_init_vga(NULL); | 416 | locate_and_init_vga(NULL); |
418 | #endif | ||
419 | 417 | ||
420 | /* Clear any io7 errors. */ | 418 | /* Clear any io7 errors. */ |
421 | for (io7 = NULL; (io7 = marvel_next_io7(io7)) != NULL; ) | 419 | for (io7 = NULL; (io7 = marvel_next_io7(io7)) != NULL; ) |
diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c index f009b7bc0943..1d3c1398c428 100644 --- a/arch/alpha/kernel/sys_titan.c +++ b/arch/alpha/kernel/sys_titan.c | |||
@@ -331,9 +331,7 @@ titan_init_pci(void) | |||
331 | pci_probe_only = 1; | 331 | pci_probe_only = 1; |
332 | common_init_pci(); | 332 | common_init_pci(); |
333 | SMC669_Init(0); | 333 | SMC669_Init(0); |
334 | #ifdef CONFIG_VGA_HOSE | ||
335 | locate_and_init_vga(NULL); | 334 | locate_and_init_vga(NULL); |
336 | #endif | ||
337 | } | 335 | } |
338 | 336 | ||
339 | 337 | ||
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index 36440c899583..074b7cb07743 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c | |||
@@ -630,7 +630,7 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
630 | 630 | ||
631 | fs = get_fs(); | 631 | fs = get_fs(); |
632 | set_fs(KERNEL_DS); | 632 | set_fs(KERNEL_DS); |
633 | if thumb_mode(regs) { | 633 | if (thumb_mode(regs)) { |
634 | fault = __get_user(tinstr, (u16 *)(instrptr & ~1)); | 634 | fault = __get_user(tinstr, (u16 *)(instrptr & ~1)); |
635 | if (!(fault)) | 635 | if (!(fault)) |
636 | instr = thumb2arm(tinstr); | 636 | instr = thumb2arm(tinstr); |
diff --git a/arch/h8300/kernel/sys_h8300.c b/arch/h8300/kernel/sys_h8300.c index 11ba75a05220..de7688cfd573 100644 --- a/arch/h8300/kernel/sys_h8300.c +++ b/arch/h8300/kernel/sys_h8300.c | |||
@@ -288,9 +288,9 @@ asmlinkage void syscall_print(void *dummy,...) | |||
288 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]) | 288 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]) |
289 | { | 289 | { |
290 | register long res __asm__("er0"); | 290 | register long res __asm__("er0"); |
291 | register char *const *_c __asm__("er3") = envp; | ||
292 | register char *const *_b __asm__("er2") = argv; | ||
291 | register const char * _a __asm__("er1") = filename; | 293 | register const char * _a __asm__("er1") = filename; |
292 | register void *_b __asm__("er2") = argv; | ||
293 | register void *_c __asm__("er3") = envp; | ||
294 | __asm__ __volatile__ ("mov.l %1,er0\n\t" | 294 | __asm__ __volatile__ ("mov.l %1,er0\n\t" |
295 | "trapa #0\n\t" | 295 | "trapa #0\n\t" |
296 | : "=r" (res) | 296 | : "=r" (res) |
diff --git a/arch/h8300/kernel/traps.c b/arch/h8300/kernel/traps.c index 300e3279ca5a..f97183011c2c 100644 --- a/arch/h8300/kernel/traps.c +++ b/arch/h8300/kernel/traps.c | |||
@@ -136,7 +136,7 @@ void show_stack(struct task_struct *task, unsigned long *esp) | |||
136 | printk("\nCall Trace:"); | 136 | printk("\nCall Trace:"); |
137 | i = 0; | 137 | i = 0; |
138 | stack = esp; | 138 | stack = esp; |
139 | while (((unsigned long)stack & (THREAD_SIZE - 1)) == 0) { | 139 | while (((unsigned long)stack & (THREAD_SIZE - 1)) != 0) { |
140 | addr = *stack++; | 140 | addr = *stack++; |
141 | /* | 141 | /* |
142 | * If the address is either in the text segment of the | 142 | * If the address is either in the text segment of the |
diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c index 83f825f2e2d7..d865d041bea1 100644 --- a/arch/i386/kernel/microcode.c +++ b/arch/i386/kernel/microcode.c | |||
@@ -478,7 +478,7 @@ static int __init microcode_dev_init (void) | |||
478 | return 0; | 478 | return 0; |
479 | } | 479 | } |
480 | 480 | ||
481 | static void __exit microcode_dev_exit (void) | 481 | static void microcode_dev_exit (void) |
482 | { | 482 | { |
483 | misc_deregister(µcode_dev); | 483 | misc_deregister(µcode_dev); |
484 | } | 484 | } |
diff --git a/arch/i386/kernel/reboot.c b/arch/i386/kernel/reboot.c index 50dfc65319cd..5513f8d5b5be 100644 --- a/arch/i386/kernel/reboot.c +++ b/arch/i386/kernel/reboot.c | |||
@@ -89,6 +89,14 @@ static int __init set_bios_reboot(struct dmi_system_id *d) | |||
89 | } | 89 | } |
90 | 90 | ||
91 | static struct dmi_system_id __initdata reboot_dmi_table[] = { | 91 | static struct dmi_system_id __initdata reboot_dmi_table[] = { |
92 | { /* Handle problems with rebooting on Dell E520's */ | ||
93 | .callback = set_bios_reboot, | ||
94 | .ident = "Dell E520", | ||
95 | .matches = { | ||
96 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
97 | DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061"), | ||
98 | }, | ||
99 | }, | ||
92 | { /* Handle problems with rebooting on Dell 1300's */ | 100 | { /* Handle problems with rebooting on Dell 1300's */ |
93 | .callback = set_bios_reboot, | 101 | .callback = set_bios_reboot, |
94 | .ident = "Dell PowerEdge 1300", | 102 | .ident = "Dell PowerEdge 1300", |
diff --git a/arch/i386/kernel/vmi.c b/arch/i386/kernel/vmi.c index c8726c424b35..c12720d7cbc5 100644 --- a/arch/i386/kernel/vmi.c +++ b/arch/i386/kernel/vmi.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/bootmem.h> | 27 | #include <linux/bootmem.h> |
28 | #include <linux/mm.h> | 28 | #include <linux/mm.h> |
29 | #include <linux/highmem.h> | 29 | #include <linux/highmem.h> |
30 | #include <linux/sched.h> | ||
30 | #include <asm/vmi.h> | 31 | #include <asm/vmi.h> |
31 | #include <asm/io.h> | 32 | #include <asm/io.h> |
32 | #include <asm/fixmap.h> | 33 | #include <asm/fixmap.h> |
diff --git a/arch/i386/oprofile/nmi_int.c b/arch/i386/oprofile/nmi_int.c index a7c0783b269a..11b7a51566a8 100644 --- a/arch/i386/oprofile/nmi_int.c +++ b/arch/i386/oprofile/nmi_int.c | |||
@@ -154,7 +154,7 @@ static int allocate_msrs(void) | |||
154 | size_t counters_size = sizeof(struct op_msr) * model->num_counters; | 154 | size_t counters_size = sizeof(struct op_msr) * model->num_counters; |
155 | 155 | ||
156 | int i; | 156 | int i; |
157 | for_each_online_cpu(i) { | 157 | for_each_possible_cpu(i) { |
158 | cpu_msrs[i].counters = kmalloc(counters_size, GFP_KERNEL); | 158 | cpu_msrs[i].counters = kmalloc(counters_size, GFP_KERNEL); |
159 | if (!cpu_msrs[i].counters) { | 159 | if (!cpu_msrs[i].counters) { |
160 | success = 0; | 160 | success = 0; |
@@ -211,8 +211,14 @@ static int nmi_setup(void) | |||
211 | /* Assume saved/restored counters are the same on all CPUs */ | 211 | /* Assume saved/restored counters are the same on all CPUs */ |
212 | model->fill_in_addresses(&cpu_msrs[0]); | 212 | model->fill_in_addresses(&cpu_msrs[0]); |
213 | for_each_possible_cpu (cpu) { | 213 | for_each_possible_cpu (cpu) { |
214 | if (cpu != 0) | 214 | if (cpu != 0) { |
215 | cpu_msrs[cpu] = cpu_msrs[0]; | 215 | memcpy(cpu_msrs[cpu].counters, cpu_msrs[0].counters, |
216 | sizeof(struct op_msr) * model->num_counters); | ||
217 | |||
218 | memcpy(cpu_msrs[cpu].controls, cpu_msrs[0].controls, | ||
219 | sizeof(struct op_msr) * model->num_controls); | ||
220 | } | ||
221 | |||
216 | } | 222 | } |
217 | on_each_cpu(nmi_save_registers, NULL, 0, 1); | 223 | on_each_cpu(nmi_save_registers, NULL, 0, 1); |
218 | on_each_cpu(nmi_cpu_setup, NULL, 0, 1); | 224 | on_each_cpu(nmi_cpu_setup, NULL, 0, 1); |
diff --git a/arch/i386/pci/fixup.c b/arch/i386/pci/fixup.c index b62eafb997bc..b95b42950ed4 100644 --- a/arch/i386/pci/fixup.c +++ b/arch/i386/pci/fixup.c | |||
@@ -436,3 +436,14 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, | |||
436 | pci_early_fixup_cyrix_5530); | 436 | pci_early_fixup_cyrix_5530); |
437 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, | 437 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, |
438 | pci_early_fixup_cyrix_5530); | 438 | pci_early_fixup_cyrix_5530); |
439 | |||
440 | /* | ||
441 | * Siemens Nixdorf AG FSC Multiprocessor Interrupt Controller: | ||
442 | * prevent update of the BAR0, which doesn't look like a normal BAR. | ||
443 | */ | ||
444 | static void __devinit pci_siemens_interrupt_controller(struct pci_dev *dev) | ||
445 | { | ||
446 | dev->resource[0].flags |= IORESOURCE_PCI_FIXED; | ||
447 | } | ||
448 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SIEMENS, 0x0015, | ||
449 | pci_siemens_interrupt_controller); | ||
diff --git a/arch/m68k/mac/debug.c b/arch/m68k/mac/debug.c index 7a5bed5bdc57..e8a57138b4a6 100644 --- a/arch/m68k/mac/debug.c +++ b/arch/m68k/mac/debug.c | |||
@@ -71,7 +71,7 @@ void mac_debugging_short(int pos, short num) | |||
71 | 71 | ||
72 | /* calculate current offset */ | 72 | /* calculate current offset */ |
73 | pengoffset = (unsigned char *)mac_videobase + | 73 | pengoffset = (unsigned char *)mac_videobase + |
74 | (150+line*2) * mac_rowbytes) + 80 * peng; | 74 | (150+line*2) * mac_rowbytes + 80 * peng; |
75 | 75 | ||
76 | pptr = pengoffset; | 76 | pptr = pengoffset; |
77 | 77 | ||
diff --git a/arch/mips/jmr3927/rbhma3100/kgdb_io.c b/arch/mips/jmr3927/rbhma3100/kgdb_io.c index 2604f2c9a96e..342579cfdc01 100644 --- a/arch/mips/jmr3927/rbhma3100/kgdb_io.c +++ b/arch/mips/jmr3927/rbhma3100/kgdb_io.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #define TIMEOUT 0xffffff | 36 | #define TIMEOUT 0xffffff |
37 | 37 | ||
38 | static int remoteDebugInitialized = 0; | 38 | static int remoteDebugInitialized = 0; |
39 | static void debugInit(int baud) | 39 | static void debugInit(int baud); |
40 | 40 | ||
41 | int putDebugChar(unsigned char c) | 41 | int putDebugChar(unsigned char c) |
42 | { | 42 | { |
diff --git a/arch/mips/pci/pci-ocelot.c b/arch/mips/pci/pci-ocelot.c index 7f94f26d35ae..1421d34535ef 100644 --- a/arch/mips/pci/pci-ocelot.c +++ b/arch/mips/pci/pci-ocelot.c | |||
@@ -71,19 +71,19 @@ static inline void pci0WriteConfigReg(unsigned int offset, unsigned int data) | |||
71 | } | 71 | } |
72 | 72 | ||
73 | static struct resource ocelot_mem_resource = { | 73 | static struct resource ocelot_mem_resource = { |
74 | start = GT_PCI_MEM_BASE; | 74 | .start = GT_PCI_MEM_BASE, |
75 | end = GT_PCI_MEM_BASE + GT_PCI_MEM_BASE - 1; | 75 | .end = GT_PCI_MEM_BASE + GT_PCI_MEM_BASE - 1, |
76 | }; | 76 | }; |
77 | 77 | ||
78 | static struct resource ocelot_io_resource = { | 78 | static struct resource ocelot_io_resource = { |
79 | start = GT_PCI_IO_BASE; | 79 | .start = GT_PCI_IO_BASE, |
80 | end = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1; | 80 | .end = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1, |
81 | }; | 81 | }; |
82 | 82 | ||
83 | static struct pci_controller ocelot_pci_controller = { | 83 | static struct pci_controller ocelot_pci_controller = { |
84 | .pci_ops = gt64xxx_pci0_ops; | 84 | .pci_ops = gt64xxx_pci0_ops, |
85 | .mem_resource = &ocelot_mem_resource; | 85 | .mem_resource = &ocelot_mem_resource, |
86 | .io_resource = &ocelot_io_resource; | 86 | .io_resource = &ocelot_io_resource, |
87 | }; | 87 | }; |
88 | 88 | ||
89 | static int __init ocelot_pcibios_init(void) | 89 | static int __init ocelot_pcibios_init(void) |
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c index 1336da8bdee1..1ad5111aec38 100644 --- a/arch/x86_64/mm/init.c +++ b/arch/x86_64/mm/init.c | |||
@@ -761,3 +761,9 @@ int in_gate_area_no_task(unsigned long addr) | |||
761 | { | 761 | { |
762 | return (addr >= VSYSCALL_START) && (addr < VSYSCALL_END); | 762 | return (addr >= VSYSCALL_START) && (addr < VSYSCALL_END); |
763 | } | 763 | } |
764 | |||
765 | void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size) | ||
766 | { | ||
767 | return __alloc_bootmem_core(pgdat->bdata, size, | ||
768 | SMP_CACHE_BYTES, (4UL*1024*1024*1024), 0); | ||
769 | } | ||
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c index b770deab968c..6d7d4157e049 100644 --- a/drivers/acpi/asus_acpi.c +++ b/drivers/acpi/asus_acpi.c | |||
@@ -1357,7 +1357,7 @@ static struct backlight_ops asus_backlight_data = { | |||
1357 | .update_status = set_brightness_status, | 1357 | .update_status = set_brightness_status, |
1358 | }; | 1358 | }; |
1359 | 1359 | ||
1360 | static void __exit asus_acpi_exit(void) | 1360 | static void asus_acpi_exit(void) |
1361 | { | 1361 | { |
1362 | if (asus_backlight_device) | 1362 | if (asus_backlight_device) |
1363 | backlight_device_unregister(asus_backlight_device); | 1363 | backlight_device_unregister(asus_backlight_device); |
diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c index 3906d47b9783..1cfbecb0ac10 100644 --- a/drivers/acpi/toshiba_acpi.c +++ b/drivers/acpi/toshiba_acpi.c | |||
@@ -538,7 +538,7 @@ static struct backlight_ops toshiba_backlight_data = { | |||
538 | .update_status = set_lcd_status, | 538 | .update_status = set_lcd_status, |
539 | }; | 539 | }; |
540 | 540 | ||
541 | static void __exit toshiba_acpi_exit(void) | 541 | static void toshiba_acpi_exit(void) |
542 | { | 542 | { |
543 | if (toshiba_backlight_device) | 543 | if (toshiba_backlight_device) |
544 | backlight_device_unregister(toshiba_backlight_device); | 544 | backlight_device_unregister(toshiba_backlight_device); |
diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig index 2e18a63ead36..ea4fe3e48f33 100644 --- a/drivers/auxdisplay/Kconfig +++ b/drivers/auxdisplay/Kconfig | |||
@@ -68,6 +68,10 @@ config CFAG12864B | |||
68 | depends on X86 | 68 | depends on X86 |
69 | depends on FB | 69 | depends on FB |
70 | depends on KS0108 | 70 | depends on KS0108 |
71 | select FB_SYS_FILLRECT | ||
72 | select FB_SYS_COPYAREA | ||
73 | select FB_SYS_IMAGEBLIT | ||
74 | select FB_SYS_FOPS | ||
71 | default n | 75 | default n |
72 | ---help--- | 76 | ---help--- |
73 | If you have a Crystalfontz 128x64 2-color LCD, cfag12864b Series, | 77 | If you have a Crystalfontz 128x64 2-color LCD, cfag12864b Series, |
diff --git a/drivers/auxdisplay/cfag12864bfb.c b/drivers/auxdisplay/cfag12864bfb.c index 66fafbb1d087..307c190699e0 100644 --- a/drivers/auxdisplay/cfag12864bfb.c +++ b/drivers/auxdisplay/cfag12864bfb.c | |||
@@ -73,9 +73,11 @@ static int cfag12864bfb_mmap(struct fb_info *info, struct vm_area_struct *vma) | |||
73 | 73 | ||
74 | static struct fb_ops cfag12864bfb_ops = { | 74 | static struct fb_ops cfag12864bfb_ops = { |
75 | .owner = THIS_MODULE, | 75 | .owner = THIS_MODULE, |
76 | .fb_fillrect = cfb_fillrect, | 76 | .fb_read = fb_sys_read, |
77 | .fb_copyarea = cfb_copyarea, | 77 | .fb_write = fb_sys_write, |
78 | .fb_imageblit = cfb_imageblit, | 78 | .fb_fillrect = sys_fillrect, |
79 | .fb_copyarea = sys_copyarea, | ||
80 | .fb_imageblit = sys_imageblit, | ||
79 | .fb_mmap = cfag12864bfb_mmap, | 81 | .fb_mmap = cfag12864bfb_mmap, |
80 | }; | 82 | }; |
81 | 83 | ||
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index b3d4ccc33a47..154f42203b05 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c | |||
@@ -1191,6 +1191,7 @@ static int job_control(struct tty_struct *tty, struct file *file) | |||
1191 | is_current_pgrp_orphaned()) | 1191 | is_current_pgrp_orphaned()) |
1192 | return -EIO; | 1192 | return -EIO; |
1193 | kill_pgrp(task_pgrp(current), SIGTTIN, 1); | 1193 | kill_pgrp(task_pgrp(current), SIGTTIN, 1); |
1194 | set_thread_flag(TIF_SIGPENDING); | ||
1194 | return -ERESTARTSYS; | 1195 | return -ERESTARTSYS; |
1195 | } | 1196 | } |
1196 | } | 1197 | } |
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 75d2a46e106f..3752edc30c36 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -1148,7 +1148,8 @@ int tty_check_change(struct tty_struct * tty) | |||
1148 | return 0; | 1148 | return 0; |
1149 | if (is_current_pgrp_orphaned()) | 1149 | if (is_current_pgrp_orphaned()) |
1150 | return -EIO; | 1150 | return -EIO; |
1151 | (void) kill_pgrp(task_pgrp(current), SIGTTOU, 1); | 1151 | kill_pgrp(task_pgrp(current), SIGTTOU, 1); |
1152 | set_thread_flag(TIF_SIGPENDING); | ||
1152 | return -ERESTARTSYS; | 1153 | return -ERESTARTSYS; |
1153 | } | 1154 | } |
1154 | 1155 | ||
diff --git a/drivers/char/watchdog/ixp2000_wdt.c b/drivers/char/watchdog/ixp2000_wdt.c index fd955dbd588c..dc7548dcaf35 100644 --- a/drivers/char/watchdog/ixp2000_wdt.c +++ b/drivers/char/watchdog/ixp2000_wdt.c | |||
@@ -205,7 +205,7 @@ static void __exit ixp2000_wdt_exit(void) | |||
205 | module_init(ixp2000_wdt_init); | 205 | module_init(ixp2000_wdt_init); |
206 | module_exit(ixp2000_wdt_exit); | 206 | module_exit(ixp2000_wdt_exit); |
207 | 207 | ||
208 | MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net">); | 208 | MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>"); |
209 | MODULE_DESCRIPTION("IXP2000 Network Processor Watchdog"); | 209 | MODULE_DESCRIPTION("IXP2000 Network Processor Watchdog"); |
210 | 210 | ||
211 | module_param(heartbeat, int, 0); | 211 | module_param(heartbeat, int, 0); |
diff --git a/drivers/isdn/Kconfig b/drivers/isdn/Kconfig index d42fe89cddf6..3e088c42b222 100644 --- a/drivers/isdn/Kconfig +++ b/drivers/isdn/Kconfig | |||
@@ -26,9 +26,9 @@ menu "Old ISDN4Linux" | |||
26 | depends on NET && ISDN | 26 | depends on NET && ISDN |
27 | 27 | ||
28 | config ISDN_I4L | 28 | config ISDN_I4L |
29 | tristate "Old ISDN4Linux (obsolete)" | 29 | tristate "Old ISDN4Linux (deprecated)" |
30 | ---help--- | 30 | ---help--- |
31 | This driver allows you to use an ISDN-card for networking | 31 | This driver allows you to use an ISDN adapter for networking |
32 | connections and as dialin/out device. The isdn-tty's have a built | 32 | connections and as dialin/out device. The isdn-tty's have a built |
33 | in AT-compatible modem emulator. Network devices support autodial, | 33 | in AT-compatible modem emulator. Network devices support autodial, |
34 | channel-bundling, callback and caller-authentication without having | 34 | channel-bundling, callback and caller-authentication without having |
@@ -39,8 +39,9 @@ config ISDN_I4L | |||
39 | 39 | ||
40 | ISDN support in the linux kernel is moving towards a new API, | 40 | ISDN support in the linux kernel is moving towards a new API, |
41 | called CAPI (Common ISDN Application Programming Interface). | 41 | called CAPI (Common ISDN Application Programming Interface). |
42 | Therefore the old ISDN4Linux layer is becoming obsolete. It is | 42 | Therefore the old ISDN4Linux layer will eventually become obsolete. |
43 | still usable, though, if you select this option. | 43 | It is still available, though, for use with adapters that are not |
44 | supported by the new CAPI subsystem yet. | ||
44 | 45 | ||
45 | if ISDN_I4L | 46 | if ISDN_I4L |
46 | source "drivers/isdn/i4l/Kconfig" | 47 | source "drivers/isdn/i4l/Kconfig" |
diff --git a/drivers/isdn/hardware/eicon/diva_didd.c b/drivers/isdn/hardware/eicon/diva_didd.c index 14298b8c835f..d755d904e62c 100644 --- a/drivers/isdn/hardware/eicon/diva_didd.c +++ b/drivers/isdn/hardware/eicon/diva_didd.c | |||
@@ -99,7 +99,7 @@ static int DIVA_INIT_FUNCTION create_proc(void) | |||
99 | return (0); | 99 | return (0); |
100 | } | 100 | } |
101 | 101 | ||
102 | static void DIVA_EXIT_FUNCTION remove_proc(void) | 102 | static void remove_proc(void) |
103 | { | 103 | { |
104 | remove_proc_entry(DRIVERLNAME, proc_net_eicon); | 104 | remove_proc_entry(DRIVERLNAME, proc_net_eicon); |
105 | remove_proc_entry("net/eicon", NULL); | 105 | remove_proc_entry("net/eicon", NULL); |
diff --git a/drivers/isdn/hardware/eicon/divasfunc.c b/drivers/isdn/hardware/eicon/divasfunc.c index df61e510a28b..46fc21a3f8ff 100644 --- a/drivers/isdn/hardware/eicon/divasfunc.c +++ b/drivers/isdn/hardware/eicon/divasfunc.c | |||
@@ -231,7 +231,7 @@ int DIVA_INIT_FUNCTION divasfunc_init(int dbgmask) | |||
231 | /* | 231 | /* |
232 | * exit | 232 | * exit |
233 | */ | 233 | */ |
234 | void DIVA_EXIT_FUNCTION divasfunc_exit(void) | 234 | void divasfunc_exit(void) |
235 | { | 235 | { |
236 | divasa_xdi_driver_unload(); | 236 | divasa_xdi_driver_unload(); |
237 | disconnect_didd(); | 237 | disconnect_didd(); |
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index ea5f30d4a5a2..4e5f87c1e714 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c | |||
@@ -2693,8 +2693,9 @@ isdn_tty_getdial(char *p, char *q,int cnt) | |||
2693 | int limit = ISDN_MSNLEN - 1; /* MUST match the size of interface var to avoid | 2693 | int limit = ISDN_MSNLEN - 1; /* MUST match the size of interface var to avoid |
2694 | buffer overflow */ | 2694 | buffer overflow */ |
2695 | 2695 | ||
2696 | while (strchr(" 0123456789,#.*WPTS-", *p) && *p && --cnt>0) { | 2696 | while (strchr(" 0123456789,#.*WPTSR-", *p) && *p && --cnt>0) { |
2697 | if ((*p >= '0' && *p <= '9') || ((*p == 'S') && first) || | 2697 | if ((*p >= '0' && *p <= '9') || ((*p == 'S') && first) || |
2698 | ((*p == 'R') && first) || | ||
2698 | (*p == '*') || (*p == '#')) { | 2699 | (*p == '*') || (*p == '#')) { |
2699 | *q++ = *p; | 2700 | *q++ = *p; |
2700 | limit--; | 2701 | limit--; |
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index e6e4d240b2a6..184238e2ece4 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -639,7 +639,7 @@ static void free_vmcs(struct vmcs *vmcs) | |||
639 | free_pages((unsigned long)vmcs, vmcs_descriptor.order); | 639 | free_pages((unsigned long)vmcs, vmcs_descriptor.order); |
640 | } | 640 | } |
641 | 641 | ||
642 | static __exit void free_kvm_area(void) | 642 | static void free_kvm_area(void) |
643 | { | 643 | { |
644 | int cpu; | 644 | int cpu; |
645 | 645 | ||
diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c index c08ad8f823d2..2d1b3df95c5b 100644 --- a/drivers/misc/tifm_7xx1.c +++ b/drivers/misc/tifm_7xx1.c | |||
@@ -343,7 +343,7 @@ static int tifm_7xx1_probe(struct pci_dev *dev, | |||
343 | if (!fm->addr) | 343 | if (!fm->addr) |
344 | goto err_out_free; | 344 | goto err_out_free; |
345 | 345 | ||
346 | rc = request_irq(dev->irq, tifm_7xx1_isr, SA_SHIRQ, DRIVER_NAME, fm); | 346 | rc = request_irq(dev->irq, tifm_7xx1_isr, IRQF_SHARED, DRIVER_NAME, fm); |
347 | if (rc) | 347 | if (rc) |
348 | goto err_out_unmap; | 348 | goto err_out_unmap; |
349 | 349 | ||
diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c index a4873ab84e6b..e8f686f7a357 100644 --- a/drivers/mtd/devices/pmc551.c +++ b/drivers/mtd/devices/pmc551.c | |||
@@ -650,7 +650,7 @@ MODULE_DESCRIPTION(PMC551_VERSION); | |||
650 | */ | 650 | */ |
651 | static int msize = 0; | 651 | static int msize = 0; |
652 | #if defined(CONFIG_MTD_PMC551_APERTURE_SIZE) | 652 | #if defined(CONFIG_MTD_PMC551_APERTURE_SIZE) |
653 | static int asize = CONFIG_MTD_PMC551_APERTURE_SIZE | 653 | static int asize = CONFIG_MTD_PMC551_APERTURE_SIZE; |
654 | #else | 654 | #else |
655 | static int asize = 0; | 655 | static int asize = 0; |
656 | #endif | 656 | #endif |
diff --git a/drivers/mtd/nand/autcpu12.c b/drivers/mtd/nand/autcpu12.c index fe94ae9ae1f2..e3744eb8eccb 100644 --- a/drivers/mtd/nand/autcpu12.c +++ b/drivers/mtd/nand/autcpu12.c | |||
@@ -101,7 +101,7 @@ static void autcpu12_hwcontrol(struct mtd_info *mtd, int cmd, | |||
101 | struct nand_chip *chip = mtd->priv; | 101 | struct nand_chip *chip = mtd->priv; |
102 | 102 | ||
103 | if (ctrl & NAND_CTRL_CHANGE) { | 103 | if (ctrl & NAND_CTRL_CHANGE) { |
104 | void __iomem *addr | 104 | void __iomem *addr; |
105 | unsigned char bits; | 105 | unsigned char bits; |
106 | 106 | ||
107 | addr = CS89712_VIRT_BASE + AUTCPU12_SMC_PORT_OFFSET; | 107 | addr = CS89712_VIRT_BASE + AUTCPU12_SMC_PORT_OFFSET; |
diff --git a/drivers/mtd/nand/ppchameleonevb.c b/drivers/mtd/nand/ppchameleonevb.c index eb7d4d443deb..082073acf20f 100644 --- a/drivers/mtd/nand/ppchameleonevb.c +++ b/drivers/mtd/nand/ppchameleonevb.c | |||
@@ -81,7 +81,7 @@ __setup("ppchameleonevb_fio_pbase=", ppchameleonevb_fio_pbase); | |||
81 | */ | 81 | */ |
82 | static struct mtd_partition partition_info_hi[] = { | 82 | static struct mtd_partition partition_info_hi[] = { |
83 | { .name = "PPChameleon HI Nand Flash", | 83 | { .name = "PPChameleon HI Nand Flash", |
84 | offset = 0, | 84 | .offset = 0, |
85 | .size = 128 * 1024 * 1024 | 85 | .size = 128 * 1024 * 1024 |
86 | } | 86 | } |
87 | }; | 87 | }; |
@@ -424,9 +424,9 @@ static void __exit ppchameleonevb_cleanup(void) | |||
424 | 424 | ||
425 | /* Release iomaps */ | 425 | /* Release iomaps */ |
426 | this = (struct nand_chip *) &ppchameleon_mtd[1]; | 426 | this = (struct nand_chip *) &ppchameleon_mtd[1]; |
427 | iounmap((void *) this->IO_ADDR_R; | 427 | iounmap((void *) this->IO_ADDR_R); |
428 | this = (struct nand_chip *) &ppchameleonevb_mtd[1]; | 428 | this = (struct nand_chip *) &ppchameleonevb_mtd[1]; |
429 | iounmap((void *) this->IO_ADDR_R; | 429 | iounmap((void *) this->IO_ADDR_R); |
430 | 430 | ||
431 | /* Free the MTD device structure */ | 431 | /* Free the MTD device structure */ |
432 | kfree (ppchameleon_mtd); | 432 | kfree (ppchameleon_mtd); |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 1798a9f9fb25..7d57f4a25dc1 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -2280,6 +2280,7 @@ config GFAR_NAPI | |||
2280 | config UCC_GETH | 2280 | config UCC_GETH |
2281 | tristate "Freescale QE Gigabit Ethernet" | 2281 | tristate "Freescale QE Gigabit Ethernet" |
2282 | depends on QUICC_ENGINE | 2282 | depends on QUICC_ENGINE |
2283 | select PHYLIB | ||
2283 | help | 2284 | help |
2284 | This driver supports the Gigabit Ethernet mode of the QUICC Engine, | 2285 | This driver supports the Gigabit Ethernet mode of the QUICC Engine, |
2285 | which is available on some Freescale SOCs. | 2286 | which is available on some Freescale SOCs. |
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c index 675fe918421b..84b81642011c 100644 --- a/drivers/net/amd8111e.c +++ b/drivers/net/amd8111e.c | |||
@@ -155,7 +155,7 @@ This function will write into PHY registers. | |||
155 | */ | 155 | */ |
156 | static int amd8111e_write_phy(struct amd8111e_priv* lp,int phy_id, int reg, u32 val) | 156 | static int amd8111e_write_phy(struct amd8111e_priv* lp,int phy_id, int reg, u32 val) |
157 | { | 157 | { |
158 | unsigned int repeat = REPEAT_CNT | 158 | unsigned int repeat = REPEAT_CNT; |
159 | void __iomem *mmio = lp->mmio; | 159 | void __iomem *mmio = lp->mmio; |
160 | unsigned int reg_val; | 160 | unsigned int reg_val; |
161 | 161 | ||
diff --git a/drivers/net/amd8111e.h b/drivers/net/amd8111e.h index 2007510c4eb6..e65080a5994a 100644 --- a/drivers/net/amd8111e.h +++ b/drivers/net/amd8111e.h | |||
@@ -615,7 +615,7 @@ typedef enum { | |||
615 | #define SSTATE 2 | 615 | #define SSTATE 2 |
616 | 616 | ||
617 | /* Assume contoller gets data 10 times the maximum processing time */ | 617 | /* Assume contoller gets data 10 times the maximum processing time */ |
618 | #define REPEAT_CNT 10; | 618 | #define REPEAT_CNT 10 |
619 | 619 | ||
620 | /* amd8111e decriptor flag definitions */ | 620 | /* amd8111e decriptor flag definitions */ |
621 | typedef enum { | 621 | typedef enum { |
diff --git a/drivers/net/fec_8xx/fec_main.c b/drivers/net/fec_8xx/fec_main.c index 88efe9731bab..e5502af5b8e2 100644 --- a/drivers/net/fec_8xx/fec_main.c +++ b/drivers/net/fec_8xx/fec_main.c | |||
@@ -550,7 +550,7 @@ static int fec_enet_rx_common(struct net_device *dev, int *budget) | |||
550 | skbn = dev_alloc_skb(pkt_len + 2); | 550 | skbn = dev_alloc_skb(pkt_len + 2); |
551 | if (skbn != NULL) { | 551 | if (skbn != NULL) { |
552 | skb_reserve(skbn, 2); /* align IP header */ | 552 | skb_reserve(skbn, 2); /* align IP header */ |
553 | skb_copy_from_linear_data(skb | 553 | skb_copy_from_linear_data(skb, |
554 | skbn->data, | 554 | skbn->data, |
555 | pkt_len); | 555 | pkt_len); |
556 | /* swap */ | 556 | /* swap */ |
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index 8118a6750b61..8caa591c5649 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c | |||
@@ -3005,7 +3005,7 @@ static int __init hp100_isa_init(void) | |||
3005 | return cards > 0 ? 0 : -ENODEV; | 3005 | return cards > 0 ? 0 : -ENODEV; |
3006 | } | 3006 | } |
3007 | 3007 | ||
3008 | static void __exit hp100_isa_cleanup(void) | 3008 | static void hp100_isa_cleanup(void) |
3009 | { | 3009 | { |
3010 | int i; | 3010 | int i; |
3011 | 3011 | ||
diff --git a/drivers/net/skfp/smt.c b/drivers/net/skfp/smt.c index fe847800acdc..75afc1f07ba0 100644 --- a/drivers/net/skfp/smt.c +++ b/drivers/net/skfp/smt.c | |||
@@ -1748,7 +1748,7 @@ char *addr_to_string(struct fddi_addr *addr) | |||
1748 | #endif | 1748 | #endif |
1749 | 1749 | ||
1750 | #ifdef AM29K | 1750 | #ifdef AM29K |
1751 | smt_ifconfig(int argc, char *argv[]) | 1751 | int smt_ifconfig(int argc, char *argv[]) |
1752 | { | 1752 | { |
1753 | if (argc >= 2 && !strcmp(argv[0],"opt_bypass") && | 1753 | if (argc >= 2 && !strcmp(argv[0],"opt_bypass") && |
1754 | !strcmp(argv[1],"yes")) { | 1754 | !strcmp(argv[1],"yes")) { |
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index d9cbd586ae4b..be1df85e5e2d 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -15,10 +15,10 @@ | |||
15 | #include <linux/pci.h> | 15 | #include <linux/pci.h> |
16 | #include <linux/proc_fs.h> | 16 | #include <linux/proc_fs.h> |
17 | #include <linux/msi.h> | 17 | #include <linux/msi.h> |
18 | #include <linux/smp.h> | ||
18 | 19 | ||
19 | #include <asm/errno.h> | 20 | #include <asm/errno.h> |
20 | #include <asm/io.h> | 21 | #include <asm/io.h> |
21 | #include <asm/smp.h> | ||
22 | 22 | ||
23 | #include "pci.h" | 23 | #include "pci.h" |
24 | #include "msi.h" | 24 | #include "msi.h" |
@@ -333,7 +333,7 @@ static int msi_capability_init(struct pci_dev *dev) | |||
333 | msi_mask_bits_reg(pos, is_64bit_address(control)), | 333 | msi_mask_bits_reg(pos, is_64bit_address(control)), |
334 | maskbits); | 334 | maskbits); |
335 | } | 335 | } |
336 | list_add(&entry->list, &dev->msi_list); | 336 | list_add_tail(&entry->list, &dev->msi_list); |
337 | 337 | ||
338 | /* Configure MSI capability structure */ | 338 | /* Configure MSI capability structure */ |
339 | ret = arch_setup_msi_irqs(dev, 1, PCI_CAP_ID_MSI); | 339 | ret = arch_setup_msi_irqs(dev, 1, PCI_CAP_ID_MSI); |
@@ -404,7 +404,7 @@ static int msix_capability_init(struct pci_dev *dev, | |||
404 | entry->dev = dev; | 404 | entry->dev = dev; |
405 | entry->mask_base = base; | 405 | entry->mask_base = base; |
406 | 406 | ||
407 | list_add(&entry->list, &dev->msi_list); | 407 | list_add_tail(&entry->list, &dev->msi_list); |
408 | } | 408 | } |
409 | 409 | ||
410 | ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX); | 410 | ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX); |
@@ -558,12 +558,12 @@ static int msi_free_irqs(struct pci_dev* dev) | |||
558 | 558 | ||
559 | list_for_each_entry_safe(entry, tmp, &dev->msi_list, list) { | 559 | list_for_each_entry_safe(entry, tmp, &dev->msi_list, list) { |
560 | if (entry->msi_attrib.type == PCI_CAP_ID_MSIX) { | 560 | if (entry->msi_attrib.type == PCI_CAP_ID_MSIX) { |
561 | if (list_is_last(&entry->list, &dev->msi_list)) | ||
562 | iounmap(entry->mask_base); | ||
563 | |||
564 | writel(1, entry->mask_base + entry->msi_attrib.entry_nr | 561 | writel(1, entry->mask_base + entry->msi_attrib.entry_nr |
565 | * PCI_MSIX_ENTRY_SIZE | 562 | * PCI_MSIX_ENTRY_SIZE |
566 | + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET); | 563 | + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET); |
564 | |||
565 | if (list_is_last(&entry->list, &dev->msi_list)) | ||
566 | iounmap(entry->mask_base); | ||
567 | } | 567 | } |
568 | list_del(&entry->list); | 568 | list_del(&entry->list); |
569 | kfree(entry); | 569 | kfree(entry); |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 1cff65fb9c43..01d8f8a8843c 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -1637,8 +1637,10 @@ static void __init quirk_disable_all_msi(struct pci_dev *dev) | |||
1637 | printk(KERN_WARNING "PCI: MSI quirk detected. MSI deactivated.\n"); | 1637 | printk(KERN_WARNING "PCI: MSI quirk detected. MSI deactivated.\n"); |
1638 | } | 1638 | } |
1639 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_disable_all_msi); | 1639 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_disable_all_msi); |
1640 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000_PCIX, quirk_disable_all_msi); | ||
1640 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_all_msi); | 1641 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_all_msi); |
1641 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_all_msi); | 1642 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_all_msi); |
1643 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351, quirk_disable_all_msi); | ||
1642 | 1644 | ||
1643 | /* Disable MSI on chipsets that are known to not support it */ | 1645 | /* Disable MSI on chipsets that are known to not support it */ |
1644 | static void __devinit quirk_disable_msi(struct pci_dev *dev) | 1646 | static void __devinit quirk_disable_msi(struct pci_dev *dev) |
diff --git a/drivers/pci/search.c b/drivers/pci/search.c index b137a27472c7..c13232435dc0 100644 --- a/drivers/pci/search.c +++ b/drivers/pci/search.c | |||
@@ -403,10 +403,11 @@ const struct pci_device_id *pci_find_present(const struct pci_device_id *ids) | |||
403 | while (ids->vendor || ids->subvendor || ids->class_mask) { | 403 | while (ids->vendor || ids->subvendor || ids->class_mask) { |
404 | list_for_each_entry(dev, &pci_devices, global_list) { | 404 | list_for_each_entry(dev, &pci_devices, global_list) { |
405 | if ((found = pci_match_one_device(ids, dev)) != NULL) | 405 | if ((found = pci_match_one_device(ids, dev)) != NULL) |
406 | break; | 406 | goto exit; |
407 | } | 407 | } |
408 | ids++; | 408 | ids++; |
409 | } | 409 | } |
410 | exit: | ||
410 | up_read(&pci_bus_sem); | 411 | up_read(&pci_bus_sem); |
411 | return found; | 412 | return found; |
412 | } | 413 | } |
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index 6085261aa2c1..e24ea82dc35b 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c | |||
@@ -641,9 +641,16 @@ cmos_pnp_probe(struct pnp_dev *pnp, const struct pnp_device_id *id) | |||
641 | * drivers can't provide shutdown() methods to disable IRQs. | 641 | * drivers can't provide shutdown() methods to disable IRQs. |
642 | * Or better yet, fix PNP to allow those methods... | 642 | * Or better yet, fix PNP to allow those methods... |
643 | */ | 643 | */ |
644 | return cmos_do_probe(&pnp->dev, | 644 | if (pnp_port_start(pnp,0) == 0x70 && !pnp_irq_valid(pnp,0)) |
645 | &pnp->res.port_resource[0], | 645 | /* Some machines contain a PNP entry for the RTC, but |
646 | pnp->res.irq_resource[0].start); | 646 | * don't define the IRQ. It should always be safe to |
647 | * hardcode it in these cases | ||
648 | */ | ||
649 | return cmos_do_probe(&pnp->dev, &pnp->res.port_resource[0], 8); | ||
650 | else | ||
651 | return cmos_do_probe(&pnp->dev, | ||
652 | &pnp->res.port_resource[0], | ||
653 | pnp->res.irq_resource[0].start); | ||
647 | } | 654 | } |
648 | 655 | ||
649 | static void __exit cmos_pnp_remove(struct pnp_dev *pnp) | 656 | static void __exit cmos_pnp_remove(struct pnp_dev *pnp) |
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index bb3cb3360541..88ea5a1fb606 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c | |||
@@ -2625,7 +2625,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) { | |||
2625 | #ifdef REAL_DMA | 2625 | #ifdef REAL_DMA |
2626 | static void NCR5380_dma_complete(NCR5380_instance * instance) { | 2626 | static void NCR5380_dma_complete(NCR5380_instance * instance) { |
2627 | NCR5380_local_declare(); | 2627 | NCR5380_local_declare(); |
2628 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata * instance->hostdata); | 2628 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; |
2629 | int transferred; | 2629 | int transferred; |
2630 | NCR5380_setup(instance); | 2630 | NCR5380_setup(instance); |
2631 | 2631 | ||
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c index 9ddc6e4a74b0..05f692bd0adc 100644 --- a/drivers/scsi/aic7xxx/aic79xx_core.c +++ b/drivers/scsi/aic7xxx/aic79xx_core.c | |||
@@ -5180,7 +5180,7 @@ ahd_handle_devreset(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, | |||
5180 | cur_lun = lun; | 5180 | cur_lun = lun; |
5181 | max_lun = lun; | 5181 | max_lun = lun; |
5182 | } | 5182 | } |
5183 | for (cur_lun <= max_lun; cur_lun++) { | 5183 | for (;cur_lun <= max_lun; cur_lun++) { |
5184 | struct ahd_tmode_lstate* lstate; | 5184 | struct ahd_tmode_lstate* lstate; |
5185 | 5185 | ||
5186 | lstate = tstate->enabled_luns[cur_lun]; | 5186 | lstate = tstate->enabled_luns[cur_lun]; |
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c index 1d8a2f6bb8eb..8b2601de3630 100644 --- a/drivers/spi/atmel_spi.c +++ b/drivers/spi/atmel_spi.c | |||
@@ -113,16 +113,16 @@ static void atmel_spi_next_xfer(struct spi_master *master, | |||
113 | 113 | ||
114 | len = as->remaining_bytes; | 114 | len = as->remaining_bytes; |
115 | 115 | ||
116 | tx_dma = xfer->tx_dma; | 116 | tx_dma = xfer->tx_dma + xfer->len - len; |
117 | rx_dma = xfer->rx_dma; | 117 | rx_dma = xfer->rx_dma + xfer->len - len; |
118 | 118 | ||
119 | /* use scratch buffer only when rx or tx data is unspecified */ | 119 | /* use scratch buffer only when rx or tx data is unspecified */ |
120 | if (rx_dma == INVALID_DMA_ADDRESS) { | 120 | if (!xfer->rx_buf) { |
121 | rx_dma = as->buffer_dma; | 121 | rx_dma = as->buffer_dma; |
122 | if (len > BUFFER_SIZE) | 122 | if (len > BUFFER_SIZE) |
123 | len = BUFFER_SIZE; | 123 | len = BUFFER_SIZE; |
124 | } | 124 | } |
125 | if (tx_dma == INVALID_DMA_ADDRESS) { | 125 | if (!xfer->tx_buf) { |
126 | tx_dma = as->buffer_dma; | 126 | tx_dma = as->buffer_dma; |
127 | if (len > BUFFER_SIZE) | 127 | if (len > BUFFER_SIZE) |
128 | len = BUFFER_SIZE; | 128 | len = BUFFER_SIZE; |
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c index 51daa212c6b7..656be4a5094a 100644 --- a/drivers/spi/spi_imx.c +++ b/drivers/spi/spi_imx.c | |||
@@ -121,7 +121,7 @@ | |||
121 | 32.768 KHz Clock */ | 121 | 32.768 KHz Clock */ |
122 | 122 | ||
123 | /* SPI DMA Register Bit Fields & Masks */ | 123 | /* SPI DMA Register Bit Fields & Masks */ |
124 | #define SPI_DMA_RHDMA (0xF << 4) /* RXFIFO Half Status */ | 124 | #define SPI_DMA_RHDMA (0x1 << 4) /* RXFIFO Half Status */ |
125 | #define SPI_DMA_RFDMA (0x1 << 5) /* RXFIFO Full Status */ | 125 | #define SPI_DMA_RFDMA (0x1 << 5) /* RXFIFO Full Status */ |
126 | #define SPI_DMA_TEDMA (0x1 << 6) /* TXFIFO Empty Status */ | 126 | #define SPI_DMA_TEDMA (0x1 << 6) /* TXFIFO Empty Status */ |
127 | #define SPI_DMA_THDMA (0x1 << 7) /* TXFIFO Half Status */ | 127 | #define SPI_DMA_THDMA (0x1 << 7) /* TXFIFO Half Status */ |
@@ -1355,6 +1355,7 @@ static int setup(struct spi_device *spi) | |||
1355 | spi->bits_per_word, | 1355 | spi->bits_per_word, |
1356 | spi_speed_hz(SPI_CONTROL_DATARATE_MIN), | 1356 | spi_speed_hz(SPI_CONTROL_DATARATE_MIN), |
1357 | spi->max_speed_hz); | 1357 | spi->max_speed_hz); |
1358 | return status; | ||
1358 | 1359 | ||
1359 | err_first_setup: | 1360 | err_first_setup: |
1360 | kfree(chip); | 1361 | kfree(chip); |
diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c index ba6fede5c466..8a1b07c74394 100644 --- a/drivers/video/arkfb.c +++ b/drivers/video/arkfb.c | |||
@@ -1055,9 +1055,10 @@ err_enable_device: | |||
1055 | static void __devexit ark_pci_remove(struct pci_dev *dev) | 1055 | static void __devexit ark_pci_remove(struct pci_dev *dev) |
1056 | { | 1056 | { |
1057 | struct fb_info *info = pci_get_drvdata(dev); | 1057 | struct fb_info *info = pci_get_drvdata(dev); |
1058 | struct arkfb_info *par = info->par; | ||
1059 | 1058 | ||
1060 | if (info) { | 1059 | if (info) { |
1060 | struct arkfb_info *par = info->par; | ||
1061 | |||
1061 | #ifdef CONFIG_MTRR | 1062 | #ifdef CONFIG_MTRR |
1062 | if (par->mtrr_reg >= 0) { | 1063 | if (par->mtrr_reg >= 0) { |
1063 | mtrr_del(par->mtrr_reg, 0, 0); | 1064 | mtrr_del(par->mtrr_reg, 0, 0); |
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h index 71f24e00fcd0..8e6ef4bc7a5c 100644 --- a/drivers/video/console/fbcon.h +++ b/drivers/video/console/fbcon.h | |||
@@ -176,7 +176,6 @@ extern void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info); | |||
176 | #endif | 176 | #endif |
177 | extern void fbcon_set_bitops(struct fbcon_ops *ops); | 177 | extern void fbcon_set_bitops(struct fbcon_ops *ops); |
178 | extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor); | 178 | extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor); |
179 | extern struct class *fb_class; | ||
180 | 179 | ||
181 | #define FBCON_ATTRIBUTE_UNDERLINE 1 | 180 | #define FBCON_ATTRIBUTE_UNDERLINE 1 |
182 | #define FBCON_ATTRIBUTE_REVERSE 2 | 181 | #define FBCON_ATTRIBUTE_REVERSE 2 |
diff --git a/drivers/video/pm3fb.c b/drivers/video/pm3fb.c index 616a0c08e30c..b52e883f0a52 100644 --- a/drivers/video/pm3fb.c +++ b/drivers/video/pm3fb.c | |||
@@ -498,7 +498,7 @@ static int pm3fb_set_par(struct fb_info *info) | |||
498 | else | 498 | else |
499 | par->video |= PM3VideoControl_LINE_DOUBLE_OFF; | 499 | par->video |= PM3VideoControl_LINE_DOUBLE_OFF; |
500 | 500 | ||
501 | if (info->var.activate == FB_ACTIVATE_NOW) | 501 | if ((info->var.activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) |
502 | par->video |= PM3VideoControl_ENABLE; | 502 | par->video |= PM3VideoControl_ENABLE; |
503 | else { | 503 | else { |
504 | par->video |= PM3VideoControl_DISABLE; | 504 | par->video |= PM3VideoControl_DISABLE; |
diff --git a/drivers/video/skeletonfb.c b/drivers/video/skeletonfb.c index 836a612af977..64779e70408f 100644 --- a/drivers/video/skeletonfb.c +++ b/drivers/video/skeletonfb.c | |||
@@ -132,7 +132,6 @@ static struct fb_info info; | |||
132 | static struct xxx_par __initdata current_par; | 132 | static struct xxx_par __initdata current_par; |
133 | 133 | ||
134 | int xxxfb_init(void); | 134 | int xxxfb_init(void); |
135 | int xxxfb_setup(char*); | ||
136 | 135 | ||
137 | /** | 136 | /** |
138 | * xxxfb_open - Optional function. Called when the framebuffer is | 137 | * xxxfb_open - Optional function. Called when the framebuffer is |
@@ -975,6 +974,21 @@ static struct platform_device xxxfb_device = { | |||
975 | .name = "xxxfb", | 974 | .name = "xxxfb", |
976 | }; | 975 | }; |
977 | 976 | ||
977 | #ifndef MODULE | ||
978 | /* | ||
979 | * Setup | ||
980 | */ | ||
981 | |||
982 | /* | ||
983 | * Only necessary if your driver takes special options, | ||
984 | * otherwise we fall back on the generic fb_setup(). | ||
985 | */ | ||
986 | int __init xxxfb_setup(char *options) | ||
987 | { | ||
988 | /* Parse user speficied options (`video=xxxfb:') */ | ||
989 | } | ||
990 | #endif /* MODULE */ | ||
991 | |||
978 | static int __init xxxfb_init(void) | 992 | static int __init xxxfb_init(void) |
979 | { | 993 | { |
980 | int ret; | 994 | int ret; |
@@ -1006,21 +1020,6 @@ static void __exit xxxfb_exit(void) | |||
1006 | } | 1020 | } |
1007 | #endif /* CONFIG_PCI */ | 1021 | #endif /* CONFIG_PCI */ |
1008 | 1022 | ||
1009 | #ifdef MODULE | ||
1010 | /* | ||
1011 | * Setup | ||
1012 | */ | ||
1013 | |||
1014 | /* | ||
1015 | * Only necessary if your driver takes special options, | ||
1016 | * otherwise we fall back on the generic fb_setup(). | ||
1017 | */ | ||
1018 | int __init xxxfb_setup(char *options) | ||
1019 | { | ||
1020 | /* Parse user speficied options (`video=xxxfb:') */ | ||
1021 | } | ||
1022 | #endif /* MODULE */ | ||
1023 | |||
1024 | /* ------------------------------------------------------------------------- */ | 1023 | /* ------------------------------------------------------------------------- */ |
1025 | 1024 | ||
1026 | 1025 | ||
diff --git a/drivers/video/vt8623fb.c b/drivers/video/vt8623fb.c index 5e9755e464a1..30c0b948852b 100644 --- a/drivers/video/vt8623fb.c +++ b/drivers/video/vt8623fb.c | |||
@@ -778,9 +778,10 @@ err_enable_device: | |||
778 | static void __devexit vt8623_pci_remove(struct pci_dev *dev) | 778 | static void __devexit vt8623_pci_remove(struct pci_dev *dev) |
779 | { | 779 | { |
780 | struct fb_info *info = pci_get_drvdata(dev); | 780 | struct fb_info *info = pci_get_drvdata(dev); |
781 | struct vt8623fb_info *par = info->par; | ||
782 | 781 | ||
783 | if (info) { | 782 | if (info) { |
783 | struct vt8623fb_info *par = info->par; | ||
784 | |||
784 | #ifdef CONFIG_MTRR | 785 | #ifdef CONFIG_MTRR |
785 | if (par->mtrr_reg >= 0) { | 786 | if (par->mtrr_reg >= 0) { |
786 | mtrr_del(par->mtrr_reg, 0, 0); | 787 | mtrr_del(par->mtrr_reg, 0, 0); |
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 8a23483ca8d0..3b64bb16c727 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c | |||
@@ -30,15 +30,15 @@ | |||
30 | void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr, | 30 | void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr, |
31 | unsigned long *blockgrpp, ext4_grpblk_t *offsetp) | 31 | unsigned long *blockgrpp, ext4_grpblk_t *offsetp) |
32 | { | 32 | { |
33 | struct ext4_super_block *es = EXT4_SB(sb)->s_es; | 33 | struct ext4_super_block *es = EXT4_SB(sb)->s_es; |
34 | ext4_grpblk_t offset; | 34 | ext4_grpblk_t offset; |
35 | 35 | ||
36 | blocknr = blocknr - le32_to_cpu(es->s_first_data_block); | 36 | blocknr = blocknr - le32_to_cpu(es->s_first_data_block); |
37 | offset = do_div(blocknr, EXT4_BLOCKS_PER_GROUP(sb)); | 37 | offset = do_div(blocknr, EXT4_BLOCKS_PER_GROUP(sb)); |
38 | if (offsetp) | 38 | if (offsetp) |
39 | *offsetp = offset; | 39 | *offsetp = offset; |
40 | if (blockgrpp) | 40 | if (blockgrpp) |
41 | *blockgrpp = blocknr; | 41 | *blockgrpp = blocknr; |
42 | 42 | ||
43 | } | 43 | } |
44 | 44 | ||
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index a0f0c04e79b2..b9ce24129070 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -374,7 +374,7 @@ ext4_ext_binsearch_idx(struct inode *inode, struct ext4_ext_path *path, int bloc | |||
374 | le32_to_cpu(ix[-1].ei_block)); | 374 | le32_to_cpu(ix[-1].ei_block)); |
375 | } | 375 | } |
376 | BUG_ON(k && le32_to_cpu(ix->ei_block) | 376 | BUG_ON(k && le32_to_cpu(ix->ei_block) |
377 | <= le32_to_cpu(ix[-1].ei_block)); | 377 | <= le32_to_cpu(ix[-1].ei_block)); |
378 | if (block < le32_to_cpu(ix->ei_block)) | 378 | if (block < le32_to_cpu(ix->ei_block)) |
379 | break; | 379 | break; |
380 | chix = ix; | 380 | chix = ix; |
@@ -423,8 +423,8 @@ ext4_ext_binsearch(struct inode *inode, struct ext4_ext_path *path, int block) | |||
423 | 423 | ||
424 | path->p_ext = l - 1; | 424 | path->p_ext = l - 1; |
425 | ext_debug(" -> %d:%llu:%d ", | 425 | ext_debug(" -> %d:%llu:%d ", |
426 | le32_to_cpu(path->p_ext->ee_block), | 426 | le32_to_cpu(path->p_ext->ee_block), |
427 | ext_pblock(path->p_ext), | 427 | ext_pblock(path->p_ext), |
428 | le16_to_cpu(path->p_ext->ee_len)); | 428 | le16_to_cpu(path->p_ext->ee_len)); |
429 | 429 | ||
430 | #ifdef CHECK_BINSEARCH | 430 | #ifdef CHECK_BINSEARCH |
@@ -435,7 +435,7 @@ ext4_ext_binsearch(struct inode *inode, struct ext4_ext_path *path, int block) | |||
435 | chex = ex = EXT_FIRST_EXTENT(eh); | 435 | chex = ex = EXT_FIRST_EXTENT(eh); |
436 | for (k = 0; k < le16_to_cpu(eh->eh_entries); k++, ex++) { | 436 | for (k = 0; k < le16_to_cpu(eh->eh_entries); k++, ex++) { |
437 | BUG_ON(k && le32_to_cpu(ex->ee_block) | 437 | BUG_ON(k && le32_to_cpu(ex->ee_block) |
438 | <= le32_to_cpu(ex[-1].ee_block)); | 438 | <= le32_to_cpu(ex[-1].ee_block)); |
439 | if (block < le32_to_cpu(ex->ee_block)) | 439 | if (block < le32_to_cpu(ex->ee_block)) |
440 | break; | 440 | break; |
441 | chex = ex; | 441 | chex = ex; |
@@ -577,7 +577,7 @@ static int ext4_ext_insert_index(handle_t *handle, struct inode *inode, | |||
577 | curp->p_hdr->eh_entries = cpu_to_le16(le16_to_cpu(curp->p_hdr->eh_entries)+1); | 577 | curp->p_hdr->eh_entries = cpu_to_le16(le16_to_cpu(curp->p_hdr->eh_entries)+1); |
578 | 578 | ||
579 | BUG_ON(le16_to_cpu(curp->p_hdr->eh_entries) | 579 | BUG_ON(le16_to_cpu(curp->p_hdr->eh_entries) |
580 | > le16_to_cpu(curp->p_hdr->eh_max)); | 580 | > le16_to_cpu(curp->p_hdr->eh_max)); |
581 | BUG_ON(ix > EXT_LAST_INDEX(curp->p_hdr)); | 581 | BUG_ON(ix > EXT_LAST_INDEX(curp->p_hdr)); |
582 | 582 | ||
583 | err = ext4_ext_dirty(handle, inode, curp); | 583 | err = ext4_ext_dirty(handle, inode, curp); |
@@ -621,12 +621,12 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode, | |||
621 | border = path[depth].p_ext[1].ee_block; | 621 | border = path[depth].p_ext[1].ee_block; |
622 | ext_debug("leaf will be split." | 622 | ext_debug("leaf will be split." |
623 | " next leaf starts at %d\n", | 623 | " next leaf starts at %d\n", |
624 | le32_to_cpu(border)); | 624 | le32_to_cpu(border)); |
625 | } else { | 625 | } else { |
626 | border = newext->ee_block; | 626 | border = newext->ee_block; |
627 | ext_debug("leaf will be added." | 627 | ext_debug("leaf will be added." |
628 | " next leaf starts at %d\n", | 628 | " next leaf starts at %d\n", |
629 | le32_to_cpu(border)); | 629 | le32_to_cpu(border)); |
630 | } | 630 | } |
631 | 631 | ||
632 | /* | 632 | /* |
@@ -684,9 +684,9 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode, | |||
684 | while (path[depth].p_ext <= | 684 | while (path[depth].p_ext <= |
685 | EXT_MAX_EXTENT(path[depth].p_hdr)) { | 685 | EXT_MAX_EXTENT(path[depth].p_hdr)) { |
686 | ext_debug("move %d:%llu:%d in new leaf %llu\n", | 686 | ext_debug("move %d:%llu:%d in new leaf %llu\n", |
687 | le32_to_cpu(path[depth].p_ext->ee_block), | 687 | le32_to_cpu(path[depth].p_ext->ee_block), |
688 | ext_pblock(path[depth].p_ext), | 688 | ext_pblock(path[depth].p_ext), |
689 | le16_to_cpu(path[depth].p_ext->ee_len), | 689 | le16_to_cpu(path[depth].p_ext->ee_len), |
690 | newblock); | 690 | newblock); |
691 | /*memmove(ex++, path[depth].p_ext++, | 691 | /*memmove(ex++, path[depth].p_ext++, |
692 | sizeof(struct ext4_extent)); | 692 | sizeof(struct ext4_extent)); |
@@ -765,9 +765,9 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode, | |||
765 | EXT_LAST_INDEX(path[i].p_hdr)); | 765 | EXT_LAST_INDEX(path[i].p_hdr)); |
766 | while (path[i].p_idx <= EXT_MAX_INDEX(path[i].p_hdr)) { | 766 | while (path[i].p_idx <= EXT_MAX_INDEX(path[i].p_hdr)) { |
767 | ext_debug("%d: move %d:%d in new index %llu\n", i, | 767 | ext_debug("%d: move %d:%d in new index %llu\n", i, |
768 | le32_to_cpu(path[i].p_idx->ei_block), | 768 | le32_to_cpu(path[i].p_idx->ei_block), |
769 | idx_pblock(path[i].p_idx), | 769 | idx_pblock(path[i].p_idx), |
770 | newblock); | 770 | newblock); |
771 | /*memmove(++fidx, path[i].p_idx++, | 771 | /*memmove(++fidx, path[i].p_idx++, |
772 | sizeof(struct ext4_extent_idx)); | 772 | sizeof(struct ext4_extent_idx)); |
773 | neh->eh_entries++; | 773 | neh->eh_entries++; |
@@ -1128,6 +1128,55 @@ ext4_can_extents_be_merged(struct inode *inode, struct ext4_extent *ex1, | |||
1128 | } | 1128 | } |
1129 | 1129 | ||
1130 | /* | 1130 | /* |
1131 | * check if a portion of the "newext" extent overlaps with an | ||
1132 | * existing extent. | ||
1133 | * | ||
1134 | * If there is an overlap discovered, it updates the length of the newext | ||
1135 | * such that there will be no overlap, and then returns 1. | ||
1136 | * If there is no overlap found, it returns 0. | ||
1137 | */ | ||
1138 | unsigned int ext4_ext_check_overlap(struct inode *inode, | ||
1139 | struct ext4_extent *newext, | ||
1140 | struct ext4_ext_path *path) | ||
1141 | { | ||
1142 | unsigned long b1, b2; | ||
1143 | unsigned int depth, len1; | ||
1144 | unsigned int ret = 0; | ||
1145 | |||
1146 | b1 = le32_to_cpu(newext->ee_block); | ||
1147 | len1 = le16_to_cpu(newext->ee_len); | ||
1148 | depth = ext_depth(inode); | ||
1149 | if (!path[depth].p_ext) | ||
1150 | goto out; | ||
1151 | b2 = le32_to_cpu(path[depth].p_ext->ee_block); | ||
1152 | |||
1153 | /* | ||
1154 | * get the next allocated block if the extent in the path | ||
1155 | * is before the requested block(s) | ||
1156 | */ | ||
1157 | if (b2 < b1) { | ||
1158 | b2 = ext4_ext_next_allocated_block(path); | ||
1159 | if (b2 == EXT_MAX_BLOCK) | ||
1160 | goto out; | ||
1161 | } | ||
1162 | |||
1163 | /* check for wrap through zero */ | ||
1164 | if (b1 + len1 < b1) { | ||
1165 | len1 = EXT_MAX_BLOCK - b1; | ||
1166 | newext->ee_len = cpu_to_le16(len1); | ||
1167 | ret = 1; | ||
1168 | } | ||
1169 | |||
1170 | /* check for overlap */ | ||
1171 | if (b1 + len1 > b2) { | ||
1172 | newext->ee_len = cpu_to_le16(b2 - b1); | ||
1173 | ret = 1; | ||
1174 | } | ||
1175 | out: | ||
1176 | return ret; | ||
1177 | } | ||
1178 | |||
1179 | /* | ||
1131 | * ext4_ext_insert_extent: | 1180 | * ext4_ext_insert_extent: |
1132 | * tries to merge requsted extent into the existing extent or | 1181 | * tries to merge requsted extent into the existing extent or |
1133 | * inserts requested extent as new one into the tree, | 1182 | * inserts requested extent as new one into the tree, |
@@ -1212,12 +1261,12 @@ has_space: | |||
1212 | if (!nearex) { | 1261 | if (!nearex) { |
1213 | /* there is no extent in this leaf, create first one */ | 1262 | /* there is no extent in this leaf, create first one */ |
1214 | ext_debug("first extent in the leaf: %d:%llu:%d\n", | 1263 | ext_debug("first extent in the leaf: %d:%llu:%d\n", |
1215 | le32_to_cpu(newext->ee_block), | 1264 | le32_to_cpu(newext->ee_block), |
1216 | ext_pblock(newext), | 1265 | ext_pblock(newext), |
1217 | le16_to_cpu(newext->ee_len)); | 1266 | le16_to_cpu(newext->ee_len)); |
1218 | path[depth].p_ext = EXT_FIRST_EXTENT(eh); | 1267 | path[depth].p_ext = EXT_FIRST_EXTENT(eh); |
1219 | } else if (le32_to_cpu(newext->ee_block) | 1268 | } else if (le32_to_cpu(newext->ee_block) |
1220 | > le32_to_cpu(nearex->ee_block)) { | 1269 | > le32_to_cpu(nearex->ee_block)) { |
1221 | /* BUG_ON(newext->ee_block == nearex->ee_block); */ | 1270 | /* BUG_ON(newext->ee_block == nearex->ee_block); */ |
1222 | if (nearex != EXT_LAST_EXTENT(eh)) { | 1271 | if (nearex != EXT_LAST_EXTENT(eh)) { |
1223 | len = EXT_MAX_EXTENT(eh) - nearex; | 1272 | len = EXT_MAX_EXTENT(eh) - nearex; |
@@ -1225,9 +1274,9 @@ has_space: | |||
1225 | len = len < 0 ? 0 : len; | 1274 | len = len < 0 ? 0 : len; |
1226 | ext_debug("insert %d:%llu:%d after: nearest 0x%p, " | 1275 | ext_debug("insert %d:%llu:%d after: nearest 0x%p, " |
1227 | "move %d from 0x%p to 0x%p\n", | 1276 | "move %d from 0x%p to 0x%p\n", |
1228 | le32_to_cpu(newext->ee_block), | 1277 | le32_to_cpu(newext->ee_block), |
1229 | ext_pblock(newext), | 1278 | ext_pblock(newext), |
1230 | le16_to_cpu(newext->ee_len), | 1279 | le16_to_cpu(newext->ee_len), |
1231 | nearex, len, nearex + 1, nearex + 2); | 1280 | nearex, len, nearex + 1, nearex + 2); |
1232 | memmove(nearex + 2, nearex + 1, len); | 1281 | memmove(nearex + 2, nearex + 1, len); |
1233 | } | 1282 | } |
@@ -1358,9 +1407,9 @@ int ext4_ext_walk_space(struct inode *inode, unsigned long block, | |||
1358 | cbex.ec_start = 0; | 1407 | cbex.ec_start = 0; |
1359 | cbex.ec_type = EXT4_EXT_CACHE_GAP; | 1408 | cbex.ec_type = EXT4_EXT_CACHE_GAP; |
1360 | } else { | 1409 | } else { |
1361 | cbex.ec_block = le32_to_cpu(ex->ee_block); | 1410 | cbex.ec_block = le32_to_cpu(ex->ee_block); |
1362 | cbex.ec_len = le16_to_cpu(ex->ee_len); | 1411 | cbex.ec_len = le16_to_cpu(ex->ee_len); |
1363 | cbex.ec_start = ext_pblock(ex); | 1412 | cbex.ec_start = ext_pblock(ex); |
1364 | cbex.ec_type = EXT4_EXT_CACHE_EXTENT; | 1413 | cbex.ec_type = EXT4_EXT_CACHE_EXTENT; |
1365 | } | 1414 | } |
1366 | 1415 | ||
@@ -1431,16 +1480,16 @@ ext4_ext_put_gap_in_cache(struct inode *inode, struct ext4_ext_path *path, | |||
1431 | len = le32_to_cpu(ex->ee_block) - block; | 1480 | len = le32_to_cpu(ex->ee_block) - block; |
1432 | ext_debug("cache gap(before): %lu [%lu:%lu]", | 1481 | ext_debug("cache gap(before): %lu [%lu:%lu]", |
1433 | (unsigned long) block, | 1482 | (unsigned long) block, |
1434 | (unsigned long) le32_to_cpu(ex->ee_block), | 1483 | (unsigned long) le32_to_cpu(ex->ee_block), |
1435 | (unsigned long) le16_to_cpu(ex->ee_len)); | 1484 | (unsigned long) le16_to_cpu(ex->ee_len)); |
1436 | } else if (block >= le32_to_cpu(ex->ee_block) | 1485 | } else if (block >= le32_to_cpu(ex->ee_block) |
1437 | + le16_to_cpu(ex->ee_len)) { | 1486 | + le16_to_cpu(ex->ee_len)) { |
1438 | lblock = le32_to_cpu(ex->ee_block) | 1487 | lblock = le32_to_cpu(ex->ee_block) |
1439 | + le16_to_cpu(ex->ee_len); | 1488 | + le16_to_cpu(ex->ee_len); |
1440 | len = ext4_ext_next_allocated_block(path); | 1489 | len = ext4_ext_next_allocated_block(path); |
1441 | ext_debug("cache gap(after): [%lu:%lu] %lu", | 1490 | ext_debug("cache gap(after): [%lu:%lu] %lu", |
1442 | (unsigned long) le32_to_cpu(ex->ee_block), | 1491 | (unsigned long) le32_to_cpu(ex->ee_block), |
1443 | (unsigned long) le16_to_cpu(ex->ee_len), | 1492 | (unsigned long) le16_to_cpu(ex->ee_len), |
1444 | (unsigned long) block); | 1493 | (unsigned long) block); |
1445 | BUG_ON(len == lblock); | 1494 | BUG_ON(len == lblock); |
1446 | len = len - lblock; | 1495 | len = len - lblock; |
@@ -1468,9 +1517,9 @@ ext4_ext_in_cache(struct inode *inode, unsigned long block, | |||
1468 | BUG_ON(cex->ec_type != EXT4_EXT_CACHE_GAP && | 1517 | BUG_ON(cex->ec_type != EXT4_EXT_CACHE_GAP && |
1469 | cex->ec_type != EXT4_EXT_CACHE_EXTENT); | 1518 | cex->ec_type != EXT4_EXT_CACHE_EXTENT); |
1470 | if (block >= cex->ec_block && block < cex->ec_block + cex->ec_len) { | 1519 | if (block >= cex->ec_block && block < cex->ec_block + cex->ec_len) { |
1471 | ex->ee_block = cpu_to_le32(cex->ec_block); | 1520 | ex->ee_block = cpu_to_le32(cex->ec_block); |
1472 | ext4_ext_store_pblock(ex, cex->ec_start); | 1521 | ext4_ext_store_pblock(ex, cex->ec_start); |
1473 | ex->ee_len = cpu_to_le16(cex->ec_len); | 1522 | ex->ee_len = cpu_to_le16(cex->ec_len); |
1474 | ext_debug("%lu cached by %lu:%lu:%llu\n", | 1523 | ext_debug("%lu cached by %lu:%lu:%llu\n", |
1475 | (unsigned long) block, | 1524 | (unsigned long) block, |
1476 | (unsigned long) cex->ec_block, | 1525 | (unsigned long) cex->ec_block, |
@@ -1956,9 +2005,9 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode, | |||
1956 | /* we should allocate requested block */ | 2005 | /* we should allocate requested block */ |
1957 | } else if (goal == EXT4_EXT_CACHE_EXTENT) { | 2006 | } else if (goal == EXT4_EXT_CACHE_EXTENT) { |
1958 | /* block is already allocated */ | 2007 | /* block is already allocated */ |
1959 | newblock = iblock | 2008 | newblock = iblock |
1960 | - le32_to_cpu(newex.ee_block) | 2009 | - le32_to_cpu(newex.ee_block) |
1961 | + ext_pblock(&newex); | 2010 | + ext_pblock(&newex); |
1962 | /* number of remaining blocks in the extent */ | 2011 | /* number of remaining blocks in the extent */ |
1963 | allocated = le16_to_cpu(newex.ee_len) - | 2012 | allocated = le16_to_cpu(newex.ee_len) - |
1964 | (iblock - le32_to_cpu(newex.ee_block)); | 2013 | (iblock - le32_to_cpu(newex.ee_block)); |
@@ -1987,7 +2036,7 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode, | |||
1987 | 2036 | ||
1988 | ex = path[depth].p_ext; | 2037 | ex = path[depth].p_ext; |
1989 | if (ex) { | 2038 | if (ex) { |
1990 | unsigned long ee_block = le32_to_cpu(ex->ee_block); | 2039 | unsigned long ee_block = le32_to_cpu(ex->ee_block); |
1991 | ext4_fsblk_t ee_start = ext_pblock(ex); | 2040 | ext4_fsblk_t ee_start = ext_pblock(ex); |
1992 | unsigned short ee_len = le16_to_cpu(ex->ee_len); | 2041 | unsigned short ee_len = le16_to_cpu(ex->ee_len); |
1993 | 2042 | ||
@@ -2000,7 +2049,7 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode, | |||
2000 | if (ee_len > EXT_MAX_LEN) | 2049 | if (ee_len > EXT_MAX_LEN) |
2001 | goto out2; | 2050 | goto out2; |
2002 | /* if found extent covers block, simply return it */ | 2051 | /* if found extent covers block, simply return it */ |
2003 | if (iblock >= ee_block && iblock < ee_block + ee_len) { | 2052 | if (iblock >= ee_block && iblock < ee_block + ee_len) { |
2004 | newblock = iblock - ee_block + ee_start; | 2053 | newblock = iblock - ee_block + ee_start; |
2005 | /* number of remaining blocks in the extent */ | 2054 | /* number of remaining blocks in the extent */ |
2006 | allocated = ee_len - (iblock - ee_block); | 2055 | allocated = ee_len - (iblock - ee_block); |
@@ -2031,7 +2080,15 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode, | |||
2031 | 2080 | ||
2032 | /* allocate new block */ | 2081 | /* allocate new block */ |
2033 | goal = ext4_ext_find_goal(inode, path, iblock); | 2082 | goal = ext4_ext_find_goal(inode, path, iblock); |
2034 | allocated = max_blocks; | 2083 | |
2084 | /* Check if we can really insert (iblock)::(iblock+max_blocks) extent */ | ||
2085 | newex.ee_block = cpu_to_le32(iblock); | ||
2086 | newex.ee_len = cpu_to_le16(max_blocks); | ||
2087 | err = ext4_ext_check_overlap(inode, &newex, path); | ||
2088 | if (err) | ||
2089 | allocated = le16_to_cpu(newex.ee_len); | ||
2090 | else | ||
2091 | allocated = max_blocks; | ||
2035 | newblock = ext4_new_blocks(handle, inode, goal, &allocated, &err); | 2092 | newblock = ext4_new_blocks(handle, inode, goal, &allocated, &err); |
2036 | if (!newblock) | 2093 | if (!newblock) |
2037 | goto out2; | 2094 | goto out2; |
@@ -2039,12 +2096,15 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode, | |||
2039 | goal, newblock, allocated); | 2096 | goal, newblock, allocated); |
2040 | 2097 | ||
2041 | /* try to insert new extent into found leaf and return */ | 2098 | /* try to insert new extent into found leaf and return */ |
2042 | newex.ee_block = cpu_to_le32(iblock); | ||
2043 | ext4_ext_store_pblock(&newex, newblock); | 2099 | ext4_ext_store_pblock(&newex, newblock); |
2044 | newex.ee_len = cpu_to_le16(allocated); | 2100 | newex.ee_len = cpu_to_le16(allocated); |
2045 | err = ext4_ext_insert_extent(handle, inode, path, &newex); | 2101 | err = ext4_ext_insert_extent(handle, inode, path, &newex); |
2046 | if (err) | 2102 | if (err) { |
2103 | /* free data blocks we just allocated */ | ||
2104 | ext4_free_blocks(handle, inode, ext_pblock(&newex), | ||
2105 | le16_to_cpu(newex.ee_len)); | ||
2047 | goto out2; | 2106 | goto out2; |
2107 | } | ||
2048 | 2108 | ||
2049 | if (extend_disksize && inode->i_size > EXT4_I(inode)->i_disksize) | 2109 | if (extend_disksize && inode->i_size > EXT4_I(inode)->i_disksize) |
2050 | EXT4_I(inode)->i_disksize = inode->i_size; | 2110 | EXT4_I(inode)->i_disksize = inode->i_size; |
@@ -2157,11 +2217,3 @@ int ext4_ext_writepage_trans_blocks(struct inode *inode, int num) | |||
2157 | 2217 | ||
2158 | return needed; | 2218 | return needed; |
2159 | } | 2219 | } |
2160 | |||
2161 | EXPORT_SYMBOL(ext4_mark_inode_dirty); | ||
2162 | EXPORT_SYMBOL(ext4_ext_invalidate_cache); | ||
2163 | EXPORT_SYMBOL(ext4_ext_insert_extent); | ||
2164 | EXPORT_SYMBOL(ext4_ext_walk_space); | ||
2165 | EXPORT_SYMBOL(ext4_ext_find_goal); | ||
2166 | EXPORT_SYMBOL(ext4_ext_calc_credits_for_insert); | ||
2167 | |||
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index b34182b6ee4d..0bcf62a750ff 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -255,8 +255,8 @@ static int verify_chain(Indirect *from, Indirect *to) | |||
255 | * @inode: inode in question (we are only interested in its superblock) | 255 | * @inode: inode in question (we are only interested in its superblock) |
256 | * @i_block: block number to be parsed | 256 | * @i_block: block number to be parsed |
257 | * @offsets: array to store the offsets in | 257 | * @offsets: array to store the offsets in |
258 | * @boundary: set this non-zero if the referred-to block is likely to be | 258 | * @boundary: set this non-zero if the referred-to block is likely to be |
259 | * followed (on disk) by an indirect block. | 259 | * followed (on disk) by an indirect block. |
260 | * | 260 | * |
261 | * To store the locations of file's data ext4 uses a data structure common | 261 | * To store the locations of file's data ext4 uses a data structure common |
262 | * for UNIX filesystems - tree of pointers anchored in the inode, with | 262 | * for UNIX filesystems - tree of pointers anchored in the inode, with |
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 4ec57be5baf5..2811e5720ad0 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -46,7 +46,7 @@ | |||
46 | */ | 46 | */ |
47 | #define NAMEI_RA_CHUNKS 2 | 47 | #define NAMEI_RA_CHUNKS 2 |
48 | #define NAMEI_RA_BLOCKS 4 | 48 | #define NAMEI_RA_BLOCKS 4 |
49 | #define NAMEI_RA_SIZE (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS) | 49 | #define NAMEI_RA_SIZE (NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS) |
50 | #define NAMEI_RA_INDEX(c,b) (((c) * NAMEI_RA_BLOCKS) + (b)) | 50 | #define NAMEI_RA_INDEX(c,b) (((c) * NAMEI_RA_BLOCKS) + (b)) |
51 | 51 | ||
52 | static struct buffer_head *ext4_append(handle_t *handle, | 52 | static struct buffer_head *ext4_append(handle_t *handle, |
@@ -241,7 +241,7 @@ static inline unsigned dx_node_limit (struct inode *dir) | |||
241 | static void dx_show_index (char * label, struct dx_entry *entries) | 241 | static void dx_show_index (char * label, struct dx_entry *entries) |
242 | { | 242 | { |
243 | int i, n = dx_get_count (entries); | 243 | int i, n = dx_get_count (entries); |
244 | printk("%s index ", label); | 244 | printk("%s index ", label); |
245 | for (i = 0; i < n; i++) { | 245 | for (i = 0; i < n; i++) { |
246 | printk("%x->%u ", i? dx_get_hash(entries + i) : | 246 | printk("%x->%u ", i? dx_get_hash(entries + i) : |
247 | 0, dx_get_block(entries + i)); | 247 | 0, dx_get_block(entries + i)); |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index cb9afdd0e26e..175b68c60968 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1985,7 +1985,7 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb, | |||
1985 | 1985 | ||
1986 | if (bd_claim(bdev, sb)) { | 1986 | if (bd_claim(bdev, sb)) { |
1987 | printk(KERN_ERR | 1987 | printk(KERN_ERR |
1988 | "EXT4: failed to claim external journal device.\n"); | 1988 | "EXT4: failed to claim external journal device.\n"); |
1989 | blkdev_put(bdev); | 1989 | blkdev_put(bdev); |
1990 | return NULL; | 1990 | return NULL; |
1991 | } | 1991 | } |
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index c8461551e108..1f0129405cf4 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c | |||
@@ -460,8 +460,8 @@ static struct buffer_head * inode_getblk(struct inode * inode, sector_t block, | |||
460 | kernel_long_ad laarr[EXTENT_MERGE_SIZE]; | 460 | kernel_long_ad laarr[EXTENT_MERGE_SIZE]; |
461 | struct extent_position prev_epos, cur_epos, next_epos; | 461 | struct extent_position prev_epos, cur_epos, next_epos; |
462 | int count = 0, startnum = 0, endnum = 0; | 462 | int count = 0, startnum = 0, endnum = 0; |
463 | uint32_t elen = 0; | 463 | uint32_t elen = 0, tmpelen; |
464 | kernel_lb_addr eloc; | 464 | kernel_lb_addr eloc, tmpeloc; |
465 | int c = 1; | 465 | int c = 1; |
466 | loff_t lbcount = 0, b_off = 0; | 466 | loff_t lbcount = 0, b_off = 0; |
467 | uint32_t newblocknum, newblock; | 467 | uint32_t newblocknum, newblock; |
@@ -520,8 +520,12 @@ static struct buffer_head * inode_getblk(struct inode * inode, sector_t block, | |||
520 | 520 | ||
521 | b_off -= lbcount; | 521 | b_off -= lbcount; |
522 | offset = b_off >> inode->i_sb->s_blocksize_bits; | 522 | offset = b_off >> inode->i_sb->s_blocksize_bits; |
523 | /* Move into indirect extent if we are at a pointer to it */ | 523 | /* |
524 | udf_next_aext(inode, &prev_epos, &eloc, &elen, 0); | 524 | * Move prev_epos and cur_epos into indirect extent if we are at |
525 | * the pointer to it | ||
526 | */ | ||
527 | udf_next_aext(inode, &prev_epos, &tmpeloc, &tmpelen, 0); | ||
528 | udf_next_aext(inode, &cur_epos, &tmpeloc, &tmpelen, 0); | ||
525 | 529 | ||
526 | /* if the extent is allocated and recorded, return the block | 530 | /* if the extent is allocated and recorded, return the block |
527 | if the extent is not a multiple of the blocksize, round up */ | 531 | if the extent is not a multiple of the blocksize, round up */ |
diff --git a/fs/udf/super.c b/fs/udf/super.c index 3a743d854c17..6658afb41cc7 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -1351,7 +1351,7 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset) | |||
1351 | 1351 | ||
1352 | for (i=0; i<UDF_SB_NUMPARTS(sb); i++) | 1352 | for (i=0; i<UDF_SB_NUMPARTS(sb); i++) |
1353 | { | 1353 | { |
1354 | switch UDF_SB_PARTTYPE(sb, i) | 1354 | switch (UDF_SB_PARTTYPE(sb, i)) |
1355 | { | 1355 | { |
1356 | case UDF_VIRTUAL_MAP15: | 1356 | case UDF_VIRTUAL_MAP15: |
1357 | case UDF_VIRTUAL_MAP20: | 1357 | case UDF_VIRTUAL_MAP20: |
diff --git a/include/asm-alpha/core_t2.h b/include/asm-alpha/core_t2.h index 457c34b6eb09..90e6b5d6c214 100644 --- a/include/asm-alpha/core_t2.h +++ b/include/asm-alpha/core_t2.h | |||
@@ -437,9 +437,15 @@ static inline void t2_outl(u32 b, unsigned long addr) | |||
437 | 437 | ||
438 | static DEFINE_SPINLOCK(t2_hae_lock); | 438 | static DEFINE_SPINLOCK(t2_hae_lock); |
439 | 439 | ||
440 | /* | ||
441 | * NOTE: take T2_DENSE_MEM off in each readX/writeX routine, since | ||
442 | * they may be called directly, rather than through the | ||
443 | * ioreadNN/iowriteNN routines. | ||
444 | */ | ||
445 | |||
440 | __EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr) | 446 | __EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr) |
441 | { | 447 | { |
442 | unsigned long addr = (unsigned long) xaddr; | 448 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; |
443 | unsigned long result, msb; | 449 | unsigned long result, msb; |
444 | unsigned long flags; | 450 | unsigned long flags; |
445 | spin_lock_irqsave(&t2_hae_lock, flags); | 451 | spin_lock_irqsave(&t2_hae_lock, flags); |
@@ -453,7 +459,7 @@ __EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr) | |||
453 | 459 | ||
454 | __EXTERN_INLINE u16 t2_readw(const volatile void __iomem *xaddr) | 460 | __EXTERN_INLINE u16 t2_readw(const volatile void __iomem *xaddr) |
455 | { | 461 | { |
456 | unsigned long addr = (unsigned long) xaddr; | 462 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; |
457 | unsigned long result, msb; | 463 | unsigned long result, msb; |
458 | unsigned long flags; | 464 | unsigned long flags; |
459 | spin_lock_irqsave(&t2_hae_lock, flags); | 465 | spin_lock_irqsave(&t2_hae_lock, flags); |
@@ -471,7 +477,7 @@ __EXTERN_INLINE u16 t2_readw(const volatile void __iomem *xaddr) | |||
471 | */ | 477 | */ |
472 | __EXTERN_INLINE u32 t2_readl(const volatile void __iomem *xaddr) | 478 | __EXTERN_INLINE u32 t2_readl(const volatile void __iomem *xaddr) |
473 | { | 479 | { |
474 | unsigned long addr = (unsigned long) xaddr; | 480 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; |
475 | unsigned long result, msb; | 481 | unsigned long result, msb; |
476 | unsigned long flags; | 482 | unsigned long flags; |
477 | spin_lock_irqsave(&t2_hae_lock, flags); | 483 | spin_lock_irqsave(&t2_hae_lock, flags); |
@@ -485,7 +491,7 @@ __EXTERN_INLINE u32 t2_readl(const volatile void __iomem *xaddr) | |||
485 | 491 | ||
486 | __EXTERN_INLINE u64 t2_readq(const volatile void __iomem *xaddr) | 492 | __EXTERN_INLINE u64 t2_readq(const volatile void __iomem *xaddr) |
487 | { | 493 | { |
488 | unsigned long addr = (unsigned long) xaddr; | 494 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; |
489 | unsigned long r0, r1, work, msb; | 495 | unsigned long r0, r1, work, msb; |
490 | unsigned long flags; | 496 | unsigned long flags; |
491 | spin_lock_irqsave(&t2_hae_lock, flags); | 497 | spin_lock_irqsave(&t2_hae_lock, flags); |
@@ -501,7 +507,7 @@ __EXTERN_INLINE u64 t2_readq(const volatile void __iomem *xaddr) | |||
501 | 507 | ||
502 | __EXTERN_INLINE void t2_writeb(u8 b, volatile void __iomem *xaddr) | 508 | __EXTERN_INLINE void t2_writeb(u8 b, volatile void __iomem *xaddr) |
503 | { | 509 | { |
504 | unsigned long addr = (unsigned long) xaddr; | 510 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; |
505 | unsigned long msb, w; | 511 | unsigned long msb, w; |
506 | unsigned long flags; | 512 | unsigned long flags; |
507 | spin_lock_irqsave(&t2_hae_lock, flags); | 513 | spin_lock_irqsave(&t2_hae_lock, flags); |
@@ -515,7 +521,7 @@ __EXTERN_INLINE void t2_writeb(u8 b, volatile void __iomem *xaddr) | |||
515 | 521 | ||
516 | __EXTERN_INLINE void t2_writew(u16 b, volatile void __iomem *xaddr) | 522 | __EXTERN_INLINE void t2_writew(u16 b, volatile void __iomem *xaddr) |
517 | { | 523 | { |
518 | unsigned long addr = (unsigned long) xaddr; | 524 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; |
519 | unsigned long msb, w; | 525 | unsigned long msb, w; |
520 | unsigned long flags; | 526 | unsigned long flags; |
521 | spin_lock_irqsave(&t2_hae_lock, flags); | 527 | spin_lock_irqsave(&t2_hae_lock, flags); |
@@ -533,7 +539,7 @@ __EXTERN_INLINE void t2_writew(u16 b, volatile void __iomem *xaddr) | |||
533 | */ | 539 | */ |
534 | __EXTERN_INLINE void t2_writel(u32 b, volatile void __iomem *xaddr) | 540 | __EXTERN_INLINE void t2_writel(u32 b, volatile void __iomem *xaddr) |
535 | { | 541 | { |
536 | unsigned long addr = (unsigned long) xaddr; | 542 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; |
537 | unsigned long msb; | 543 | unsigned long msb; |
538 | unsigned long flags; | 544 | unsigned long flags; |
539 | spin_lock_irqsave(&t2_hae_lock, flags); | 545 | spin_lock_irqsave(&t2_hae_lock, flags); |
@@ -546,7 +552,7 @@ __EXTERN_INLINE void t2_writel(u32 b, volatile void __iomem *xaddr) | |||
546 | 552 | ||
547 | __EXTERN_INLINE void t2_writeq(u64 b, volatile void __iomem *xaddr) | 553 | __EXTERN_INLINE void t2_writeq(u64 b, volatile void __iomem *xaddr) |
548 | { | 554 | { |
549 | unsigned long addr = (unsigned long) xaddr; | 555 | unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM; |
550 | unsigned long msb, work; | 556 | unsigned long msb, work; |
551 | unsigned long flags; | 557 | unsigned long flags; |
552 | spin_lock_irqsave(&t2_hae_lock, flags); | 558 | spin_lock_irqsave(&t2_hae_lock, flags); |
@@ -587,14 +593,14 @@ __EXTERN_INLINE int t2_is_mmio(const volatile void __iomem *addr) | |||
587 | __EXTERN_INLINE unsigned int t2_ioread##NS(void __iomem *xaddr) \ | 593 | __EXTERN_INLINE unsigned int t2_ioread##NS(void __iomem *xaddr) \ |
588 | { \ | 594 | { \ |
589 | if (t2_is_mmio(xaddr)) \ | 595 | if (t2_is_mmio(xaddr)) \ |
590 | return t2_read##OS(xaddr - T2_DENSE_MEM); \ | 596 | return t2_read##OS(xaddr); \ |
591 | else \ | 597 | else \ |
592 | return t2_in##OS((unsigned long)xaddr - T2_IO); \ | 598 | return t2_in##OS((unsigned long)xaddr - T2_IO); \ |
593 | } \ | 599 | } \ |
594 | __EXTERN_INLINE void t2_iowrite##NS(u##NS b, void __iomem *xaddr) \ | 600 | __EXTERN_INLINE void t2_iowrite##NS(u##NS b, void __iomem *xaddr) \ |
595 | { \ | 601 | { \ |
596 | if (t2_is_mmio(xaddr)) \ | 602 | if (t2_is_mmio(xaddr)) \ |
597 | t2_write##OS(b, xaddr - T2_DENSE_MEM); \ | 603 | t2_write##OS(b, xaddr); \ |
598 | else \ | 604 | else \ |
599 | t2_out##OS(b, (unsigned long)xaddr - T2_IO); \ | 605 | t2_out##OS(b, (unsigned long)xaddr - T2_IO); \ |
600 | } | 606 | } |
diff --git a/include/asm-alpha/core_titan.h b/include/asm-alpha/core_titan.h index a64ccbff7d98..a17f6f33b68e 100644 --- a/include/asm-alpha/core_titan.h +++ b/include/asm-alpha/core_titan.h | |||
@@ -380,12 +380,7 @@ struct el_PRIVATEER_envdata_mcheck { | |||
380 | /* | 380 | /* |
381 | * Memory functions. all accesses are done through linear space. | 381 | * Memory functions. all accesses are done through linear space. |
382 | */ | 382 | */ |
383 | 383 | extern void __iomem *titan_ioportmap(unsigned long addr); | |
384 | __EXTERN_INLINE void __iomem *titan_ioportmap(unsigned long addr) | ||
385 | { | ||
386 | return (void __iomem *)(addr + TITAN_IO_BIAS); | ||
387 | } | ||
388 | |||
389 | extern void __iomem *titan_ioremap(unsigned long addr, unsigned long size); | 384 | extern void __iomem *titan_ioremap(unsigned long addr, unsigned long size); |
390 | extern void titan_iounmap(volatile void __iomem *addr); | 385 | extern void titan_iounmap(volatile void __iomem *addr); |
391 | 386 | ||
diff --git a/include/asm-alpha/core_tsunami.h b/include/asm-alpha/core_tsunami.h index 44e635d2c571..58d4fe48742c 100644 --- a/include/asm-alpha/core_tsunami.h +++ b/include/asm-alpha/core_tsunami.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __ALPHA_TSUNAMI__H__ | 2 | #define __ALPHA_TSUNAMI__H__ |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/pci.h> | ||
5 | #include <asm/compiler.h> | 6 | #include <asm/compiler.h> |
6 | 7 | ||
7 | /* | 8 | /* |
@@ -302,18 +303,8 @@ struct el_TSUNAMI_sysdata_mcheck { | |||
302 | /* | 303 | /* |
303 | * Memory functions. all accesses are done through linear space. | 304 | * Memory functions. all accesses are done through linear space. |
304 | */ | 305 | */ |
305 | 306 | extern void __iomem *tsunami_ioportmap(unsigned long addr); | |
306 | __EXTERN_INLINE void __iomem *tsunami_ioportmap(unsigned long addr) | 307 | extern void __iomem *tsunami_ioremap(unsigned long addr, unsigned long size); |
307 | { | ||
308 | return (void __iomem *)(addr + TSUNAMI_IO_BIAS); | ||
309 | } | ||
310 | |||
311 | __EXTERN_INLINE void __iomem *tsunami_ioremap(unsigned long addr, | ||
312 | unsigned long size) | ||
313 | { | ||
314 | return (void __iomem *)(addr + TSUNAMI_MEM_BIAS); | ||
315 | } | ||
316 | |||
317 | __EXTERN_INLINE int tsunami_is_ioaddr(unsigned long addr) | 308 | __EXTERN_INLINE int tsunami_is_ioaddr(unsigned long addr) |
318 | { | 309 | { |
319 | return addr >= TSUNAMI_BASE; | 310 | return addr >= TSUNAMI_BASE; |
diff --git a/include/asm-alpha/core_wildfire.h b/include/asm-alpha/core_wildfire.h index 12af803d445a..cd562f544ba2 100644 --- a/include/asm-alpha/core_wildfire.h +++ b/include/asm-alpha/core_wildfire.h | |||
@@ -295,7 +295,7 @@ __EXTERN_INLINE int wildfire_is_ioaddr(unsigned long addr) | |||
295 | 295 | ||
296 | __EXTERN_INLINE int wildfire_is_mmio(const volatile void __iomem *xaddr) | 296 | __EXTERN_INLINE int wildfire_is_mmio(const volatile void __iomem *xaddr) |
297 | { | 297 | { |
298 | unsigned long addr = (unsigned long)addr; | 298 | unsigned long addr = (unsigned long)xaddr; |
299 | return (addr & 0x100000000UL) == 0; | 299 | return (addr & 0x100000000UL) == 0; |
300 | } | 300 | } |
301 | 301 | ||
diff --git a/include/asm-alpha/vga.h b/include/asm-alpha/vga.h index ed06f59b544d..e8df1e7aae6b 100644 --- a/include/asm-alpha/vga.h +++ b/include/asm-alpha/vga.h | |||
@@ -46,6 +46,37 @@ extern void scr_memcpyw(u16 *d, const u16 *s, unsigned int count); | |||
46 | #define vga_readb(a) readb((u8 __iomem *)(a)) | 46 | #define vga_readb(a) readb((u8 __iomem *)(a)) |
47 | #define vga_writeb(v,a) writeb(v, (u8 __iomem *)(a)) | 47 | #define vga_writeb(v,a) writeb(v, (u8 __iomem *)(a)) |
48 | 48 | ||
49 | #ifdef CONFIG_VGA_HOSE | ||
50 | #include <linux/ioport.h> | ||
51 | #include <linux/pci.h> | ||
52 | |||
53 | extern struct pci_controller *pci_vga_hose; | ||
54 | |||
55 | # define __is_port_vga(a) \ | ||
56 | (((a) >= 0x3b0) && ((a) < 0x3e0) && \ | ||
57 | ((a) != 0x3b3) && ((a) != 0x3d3)) | ||
58 | |||
59 | # define __is_mem_vga(a) \ | ||
60 | (((a) >= 0xa0000) && ((a) <= 0xc0000)) | ||
61 | |||
62 | # define FIXUP_IOADDR_VGA(a) do { \ | ||
63 | if (pci_vga_hose && __is_port_vga(a)) \ | ||
64 | (a) += pci_vga_hose->io_space->start; \ | ||
65 | } while(0) | ||
66 | |||
67 | # define FIXUP_MEMADDR_VGA(a) do { \ | ||
68 | if (pci_vga_hose && __is_mem_vga(a)) \ | ||
69 | (a) += pci_vga_hose->mem_space->start; \ | ||
70 | } while(0) | ||
71 | |||
72 | #else /* CONFIG_VGA_HOSE */ | ||
73 | # define pci_vga_hose 0 | ||
74 | # define __is_port_vga(a) 0 | ||
75 | # define __is_mem_vga(a) 0 | ||
76 | # define FIXUP_IOADDR_VGA(a) | ||
77 | # define FIXUP_MEMADDR_VGA(a) | ||
78 | #endif /* CONFIG_VGA_HOSE */ | ||
79 | |||
49 | #define VGA_MAP_MEM(x,s) ((unsigned long) ioremap(x, s)) | 80 | #define VGA_MAP_MEM(x,s) ((unsigned long) ioremap(x, s)) |
50 | 81 | ||
51 | #endif | 82 | #endif |
diff --git a/include/asm-h8300/processor.h b/include/asm-h8300/processor.h index 99b664aa2083..49fc886a6232 100644 --- a/include/asm-h8300/processor.h +++ b/include/asm-h8300/processor.h | |||
@@ -78,7 +78,7 @@ struct thread_struct { | |||
78 | do { \ | 78 | do { \ |
79 | set_fs(USER_DS); /* reads from user space */ \ | 79 | set_fs(USER_DS); /* reads from user space */ \ |
80 | (_regs)->pc = (_pc); \ | 80 | (_regs)->pc = (_pc); \ |
81 | (_regs)->ccr &= 0x00; /* clear kernel flag */ \ | 81 | (_regs)->ccr = 0x00; /* clear all flags */ \ |
82 | (_regs)->er5 = current->mm->start_data; /* GOT base */ \ | 82 | (_regs)->er5 = current->mm->start_data; /* GOT base */ \ |
83 | wrusp((unsigned long)(_usp) - sizeof(unsigned long)*3); \ | 83 | wrusp((unsigned long)(_usp) - sizeof(unsigned long)*3); \ |
84 | } while(0) | 84 | } while(0) |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 0365ec9fc0c9..c83534ee1e79 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -59,6 +59,7 @@ extern void *__alloc_bootmem_core(struct bootmem_data *bdata, | |||
59 | unsigned long align, | 59 | unsigned long align, |
60 | unsigned long goal, | 60 | unsigned long goal, |
61 | unsigned long limit); | 61 | unsigned long limit); |
62 | extern void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size); | ||
62 | 63 | ||
63 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | 64 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE |
64 | extern void reserve_bootmem(unsigned long addr, unsigned long size); | 65 | extern void reserve_bootmem(unsigned long addr, unsigned long size); |
diff --git a/include/linux/errno.h b/include/linux/errno.h index d90b80f9b28c..46685832ed99 100644 --- a/include/linux/errno.h +++ b/include/linux/errno.h | |||
@@ -5,7 +5,12 @@ | |||
5 | 5 | ||
6 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
7 | 7 | ||
8 | /* Should never be seen by user programs */ | 8 | /* |
9 | * These should never be seen by user programs. To return one of ERESTART* | ||
10 | * codes, signal_pending() MUST be set. Note that ptrace can observe these | ||
11 | * at syscall exit tracing, but they will never be left for the debugged user | ||
12 | * process to see. | ||
13 | */ | ||
9 | #define ERESTARTSYS 512 | 14 | #define ERESTARTSYS 512 |
10 | #define ERESTARTNOINTR 513 | 15 | #define ERESTARTNOINTR 513 |
11 | #define ERESTARTNOHAND 514 /* restart if no handler.. */ | 16 | #define ERESTARTNOHAND 514 /* restart if no handler.. */ |
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h index 54c576d414c3..de1f9f78625a 100644 --- a/include/linux/ext4_fs.h +++ b/include/linux/ext4_fs.h | |||
@@ -32,9 +32,9 @@ | |||
32 | /* | 32 | /* |
33 | * Define EXT4_RESERVATION to reserve data blocks for expanding files | 33 | * Define EXT4_RESERVATION to reserve data blocks for expanding files |
34 | */ | 34 | */ |
35 | #define EXT4_DEFAULT_RESERVE_BLOCKS 8 | 35 | #define EXT4_DEFAULT_RESERVE_BLOCKS 8 |
36 | /*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */ | 36 | /*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */ |
37 | #define EXT4_MAX_RESERVE_BLOCKS 1027 | 37 | #define EXT4_MAX_RESERVE_BLOCKS 1027 |
38 | #define EXT4_RESERVE_WINDOW_NOT_ALLOCATED 0 | 38 | #define EXT4_RESERVE_WINDOW_NOT_ALLOCATED 0 |
39 | /* | 39 | /* |
40 | * Always enable hashed directories | 40 | * Always enable hashed directories |
@@ -204,12 +204,12 @@ struct ext4_group_desc | |||
204 | 204 | ||
205 | /* Used to pass group descriptor data when online resize is done */ | 205 | /* Used to pass group descriptor data when online resize is done */ |
206 | struct ext4_new_group_input { | 206 | struct ext4_new_group_input { |
207 | __u32 group; /* Group number for this data */ | 207 | __u32 group; /* Group number for this data */ |
208 | __u64 block_bitmap; /* Absolute block number of block bitmap */ | 208 | __u64 block_bitmap; /* Absolute block number of block bitmap */ |
209 | __u64 inode_bitmap; /* Absolute block number of inode bitmap */ | 209 | __u64 inode_bitmap; /* Absolute block number of inode bitmap */ |
210 | __u64 inode_table; /* Absolute block number of inode table start */ | 210 | __u64 inode_table; /* Absolute block number of inode table start */ |
211 | __u32 blocks_count; /* Total number of blocks in this group */ | 211 | __u32 blocks_count; /* Total number of blocks in this group */ |
212 | __u16 reserved_blocks; /* Number of reserved blocks in this group */ | 212 | __u16 reserved_blocks; /* Number of reserved blocks in this group */ |
213 | __u16 unused; | 213 | __u16 unused; |
214 | }; | 214 | }; |
215 | 215 | ||
@@ -310,7 +310,7 @@ struct ext4_inode { | |||
310 | __u8 l_i_frag; /* Fragment number */ | 310 | __u8 l_i_frag; /* Fragment number */ |
311 | __u8 l_i_fsize; /* Fragment size */ | 311 | __u8 l_i_fsize; /* Fragment size */ |
312 | __le16 l_i_file_acl_high; | 312 | __le16 l_i_file_acl_high; |
313 | __le16 l_i_uid_high; /* these 2 fields */ | 313 | __le16 l_i_uid_high; /* these 2 fields */ |
314 | __le16 l_i_gid_high; /* were reserved2[0] */ | 314 | __le16 l_i_gid_high; /* were reserved2[0] */ |
315 | __u32 l_i_reserved2; | 315 | __u32 l_i_reserved2; |
316 | } linux2; | 316 | } linux2; |
@@ -513,7 +513,14 @@ struct ext4_super_block { | |||
513 | /*150*/ __le32 s_blocks_count_hi; /* Blocks count */ | 513 | /*150*/ __le32 s_blocks_count_hi; /* Blocks count */ |
514 | __le32 s_r_blocks_count_hi; /* Reserved blocks count */ | 514 | __le32 s_r_blocks_count_hi; /* Reserved blocks count */ |
515 | __le32 s_free_blocks_count_hi; /* Free blocks count */ | 515 | __le32 s_free_blocks_count_hi; /* Free blocks count */ |
516 | __u32 s_reserved[169]; /* Padding to the end of the block */ | 516 | __u16 s_min_extra_isize; /* All inodes have at least # bytes */ |
517 | __u16 s_want_extra_isize; /* New inodes should reserve # bytes */ | ||
518 | __u32 s_flags; /* Miscellaneous flags */ | ||
519 | __u16 s_raid_stride; /* RAID stride */ | ||
520 | __u16 s_mmp_interval; /* # seconds to wait in MMP checking */ | ||
521 | __u64 s_mmp_block; /* Block for multi-mount protection */ | ||
522 | __u32 s_raid_stripe_width; /* blocks on all data disks (N*stride)*/ | ||
523 | __u32 s_reserved[163]; /* Padding to the end of the block */ | ||
517 | }; | 524 | }; |
518 | 525 | ||
519 | #ifdef __KERNEL__ | 526 | #ifdef __KERNEL__ |
@@ -780,9 +787,9 @@ void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr, | |||
780 | * Ok, these declarations are also in <linux/kernel.h> but none of the | 787 | * Ok, these declarations are also in <linux/kernel.h> but none of the |
781 | * ext4 source programs needs to include it so they are duplicated here. | 788 | * ext4 source programs needs to include it so they are duplicated here. |
782 | */ | 789 | */ |
783 | # define NORET_TYPE /**/ | 790 | # define NORET_TYPE /**/ |
784 | # define ATTRIB_NORET __attribute__((noreturn)) | 791 | # define ATTRIB_NORET __attribute__((noreturn)) |
785 | # define NORET_AND noreturn, | 792 | # define NORET_AND noreturn, |
786 | 793 | ||
787 | /* balloc.c */ | 794 | /* balloc.c */ |
788 | extern unsigned int ext4_block_group(struct super_block *sb, | 795 | extern unsigned int ext4_block_group(struct super_block *sb, |
diff --git a/include/linux/ext4_fs_extents.h b/include/linux/ext4_fs_extents.h index 7eb1d73fc5d1..acfe59740b03 100644 --- a/include/linux/ext4_fs_extents.h +++ b/include/linux/ext4_fs_extents.h | |||
@@ -151,8 +151,8 @@ typedef int (*ext_prepare_callback)(struct inode *, struct ext4_ext_path *, | |||
151 | ((struct ext4_extent_idx *) (((char *) (__hdr__)) + \ | 151 | ((struct ext4_extent_idx *) (((char *) (__hdr__)) + \ |
152 | sizeof(struct ext4_extent_header))) | 152 | sizeof(struct ext4_extent_header))) |
153 | #define EXT_HAS_FREE_INDEX(__path__) \ | 153 | #define EXT_HAS_FREE_INDEX(__path__) \ |
154 | (le16_to_cpu((__path__)->p_hdr->eh_entries) \ | 154 | (le16_to_cpu((__path__)->p_hdr->eh_entries) \ |
155 | < le16_to_cpu((__path__)->p_hdr->eh_max)) | 155 | < le16_to_cpu((__path__)->p_hdr->eh_max)) |
156 | #define EXT_LAST_EXTENT(__hdr__) \ | 156 | #define EXT_LAST_EXTENT(__hdr__) \ |
157 | (EXT_FIRST_EXTENT((__hdr__)) + le16_to_cpu((__hdr__)->eh_entries) - 1) | 157 | (EXT_FIRST_EXTENT((__hdr__)) + le16_to_cpu((__hdr__)->eh_entries) - 1) |
158 | #define EXT_LAST_INDEX(__hdr__) \ | 158 | #define EXT_LAST_INDEX(__hdr__) \ |
@@ -190,6 +190,7 @@ ext4_ext_invalidate_cache(struct inode *inode) | |||
190 | 190 | ||
191 | extern int ext4_extent_tree_init(handle_t *, struct inode *); | 191 | extern int ext4_extent_tree_init(handle_t *, struct inode *); |
192 | extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *); | 192 | extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *); |
193 | extern unsigned int ext4_ext_check_overlap(struct inode *, struct ext4_extent *, struct ext4_ext_path *); | ||
193 | extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *); | 194 | extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *); |
194 | extern int ext4_ext_walk_space(struct inode *, unsigned long, unsigned long, ext_prepare_callback, void *); | 195 | extern int ext4_ext_walk_space(struct inode *, unsigned long, unsigned long, ext_prepare_callback, void *); |
195 | extern struct ext4_ext_path * ext4_ext_find_extent(struct inode *, int, struct ext4_ext_path *); | 196 | extern struct ext4_ext_path * ext4_ext_find_extent(struct inode *, int, struct ext4_ext_path *); |
diff --git a/include/linux/ext4_fs_i.h b/include/linux/ext4_fs_i.h index d5b177e5b395..9de494406995 100644 --- a/include/linux/ext4_fs_i.h +++ b/include/linux/ext4_fs_i.h | |||
@@ -41,14 +41,14 @@ struct ext4_reserve_window_node { | |||
41 | 41 | ||
42 | struct ext4_block_alloc_info { | 42 | struct ext4_block_alloc_info { |
43 | /* information about reservation window */ | 43 | /* information about reservation window */ |
44 | struct ext4_reserve_window_node rsv_window_node; | 44 | struct ext4_reserve_window_node rsv_window_node; |
45 | /* | 45 | /* |
46 | * was i_next_alloc_block in ext4_inode_info | 46 | * was i_next_alloc_block in ext4_inode_info |
47 | * is the logical (file-relative) number of the | 47 | * is the logical (file-relative) number of the |
48 | * most-recently-allocated block in this file. | 48 | * most-recently-allocated block in this file. |
49 | * We use this for detecting linearly ascending allocation requests. | 49 | * We use this for detecting linearly ascending allocation requests. |
50 | */ | 50 | */ |
51 | __u32 last_alloc_logical_block; | 51 | __u32 last_alloc_logical_block; |
52 | /* | 52 | /* |
53 | * Was i_next_alloc_goal in ext4_inode_info | 53 | * Was i_next_alloc_goal in ext4_inode_info |
54 | * is the *physical* companion to i_next_alloc_block. | 54 | * is the *physical* companion to i_next_alloc_block. |
@@ -56,7 +56,7 @@ struct ext4_block_alloc_info { | |||
56 | * allocated to this file. This give us the goal (target) for the next | 56 | * allocated to this file. This give us the goal (target) for the next |
57 | * allocation when we detect linearly ascending requests. | 57 | * allocation when we detect linearly ascending requests. |
58 | */ | 58 | */ |
59 | ext4_fsblk_t last_alloc_physical_block; | 59 | ext4_fsblk_t last_alloc_physical_block; |
60 | }; | 60 | }; |
61 | 61 | ||
62 | #define rsv_start rsv_window._rsv_start | 62 | #define rsv_start rsv_window._rsv_start |
diff --git a/include/linux/fb.h b/include/linux/fb.h index c654d0e9ce33..66226824ab68 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -942,6 +942,7 @@ extern int fb_new_modelist(struct fb_info *info); | |||
942 | 942 | ||
943 | extern struct fb_info *registered_fb[FB_MAX]; | 943 | extern struct fb_info *registered_fb[FB_MAX]; |
944 | extern int num_registered_fb; | 944 | extern int num_registered_fb; |
945 | extern struct class *fb_class; | ||
945 | 946 | ||
946 | static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, | 947 | static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, |
947 | u8 *src, u32 s_pitch, u32 height) | 948 | u8 *src, u32 s_pitch, u32 height) |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 4712e269d8d3..6a115cffea34 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1292,6 +1292,7 @@ | |||
1292 | #define PCI_DEVICE_ID_VIA_P4M890 0x0327 | 1292 | #define PCI_DEVICE_ID_VIA_P4M890 0x0327 |
1293 | #define PCI_DEVICE_ID_VIA_VT3324 0x0324 | 1293 | #define PCI_DEVICE_ID_VIA_VT3324 0x0324 |
1294 | #define PCI_DEVICE_ID_VIA_VT3336 0x0336 | 1294 | #define PCI_DEVICE_ID_VIA_VT3336 0x0336 |
1295 | #define PCI_DEVICE_ID_VIA_VT3351 0x0351 | ||
1295 | #define PCI_DEVICE_ID_VIA_8371_0 0x0391 | 1296 | #define PCI_DEVICE_ID_VIA_8371_0 0x0391 |
1296 | #define PCI_DEVICE_ID_VIA_8501_0 0x0501 | 1297 | #define PCI_DEVICE_ID_VIA_8501_0 0x0501 |
1297 | #define PCI_DEVICE_ID_VIA_82C561 0x0561 | 1298 | #define PCI_DEVICE_ID_VIA_82C561 0x0561 |
@@ -1437,6 +1438,7 @@ | |||
1437 | #define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 | 1438 | #define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 |
1438 | #define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017 | 1439 | #define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017 |
1439 | #define PCI_DEVICE_ID_SERVERWORKS_EPB 0x0103 | 1440 | #define PCI_DEVICE_ID_SERVERWORKS_EPB 0x0103 |
1441 | #define PCI_DEVICE_ID_SERVERWORKS_HT1000_PCIX 0x0104 | ||
1440 | #define PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE 0x0132 | 1442 | #define PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE 0x0132 |
1441 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 | 1443 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 |
1442 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 | 1444 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 |
@@ -2267,11 +2269,11 @@ | |||
2267 | #define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e | 2269 | #define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e |
2268 | #define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 | 2270 | #define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 |
2269 | #define PCI_DEVICE_ID_INTEL_ICH9_0 0x2910 | 2271 | #define PCI_DEVICE_ID_INTEL_ICH9_0 0x2910 |
2270 | #define PCI_DEVICE_ID_INTEL_ICH9_1 0x2911 | 2272 | #define PCI_DEVICE_ID_INTEL_ICH9_1 0x2917 |
2271 | #define PCI_DEVICE_ID_INTEL_ICH9_2 0x2912 | 2273 | #define PCI_DEVICE_ID_INTEL_ICH9_2 0x2912 |
2272 | #define PCI_DEVICE_ID_INTEL_ICH9_3 0x2913 | 2274 | #define PCI_DEVICE_ID_INTEL_ICH9_3 0x2913 |
2273 | #define PCI_DEVICE_ID_INTEL_ICH9_4 0x2914 | 2275 | #define PCI_DEVICE_ID_INTEL_ICH9_4 0x2914 |
2274 | #define PCI_DEVICE_ID_INTEL_ICH9_5 0x2915 | 2276 | #define PCI_DEVICE_ID_INTEL_ICH9_5 0x2919 |
2275 | #define PCI_DEVICE_ID_INTEL_ICH9_6 0x2930 | 2277 | #define PCI_DEVICE_ID_INTEL_ICH9_6 0x2930 |
2276 | #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 | 2278 | #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 |
2277 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 | 2279 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index a3ac4c896831..7f2c99d66e9d 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -152,6 +152,7 @@ | |||
152 | #include <linux/sched.h> | 152 | #include <linux/sched.h> |
153 | #include <linux/tty.h> | 153 | #include <linux/tty.h> |
154 | #include <linux/mutex.h> | 154 | #include <linux/mutex.h> |
155 | #include <linux/sysrq.h> | ||
155 | 156 | ||
156 | struct uart_port; | 157 | struct uart_port; |
157 | struct uart_info; | 158 | struct uart_info; |
diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c index 338a9b489fbc..27478948b318 100644 --- a/kernel/futex_compat.c +++ b/kernel/futex_compat.c | |||
@@ -144,20 +144,21 @@ asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val, | |||
144 | struct timespec ts; | 144 | struct timespec ts; |
145 | ktime_t t, *tp = NULL; | 145 | ktime_t t, *tp = NULL; |
146 | int val2 = 0; | 146 | int val2 = 0; |
147 | int cmd = op & FUTEX_CMD_MASK; | ||
147 | 148 | ||
148 | if (utime && (op == FUTEX_WAIT || op == FUTEX_LOCK_PI)) { | 149 | if (utime && (cmd == FUTEX_WAIT || cmd == FUTEX_LOCK_PI)) { |
149 | if (get_compat_timespec(&ts, utime)) | 150 | if (get_compat_timespec(&ts, utime)) |
150 | return -EFAULT; | 151 | return -EFAULT; |
151 | if (!timespec_valid(&ts)) | 152 | if (!timespec_valid(&ts)) |
152 | return -EINVAL; | 153 | return -EINVAL; |
153 | 154 | ||
154 | t = timespec_to_ktime(ts); | 155 | t = timespec_to_ktime(ts); |
155 | if (op == FUTEX_WAIT) | 156 | if (cmd == FUTEX_WAIT) |
156 | t = ktime_add(ktime_get(), t); | 157 | t = ktime_add(ktime_get(), t); |
157 | tp = &t; | 158 | tp = &t; |
158 | } | 159 | } |
159 | if (op == FUTEX_REQUEUE || op == FUTEX_CMP_REQUEUE | 160 | if (cmd == FUTEX_REQUEUE || cmd == FUTEX_CMP_REQUEUE |
160 | || op == FUTEX_CMP_REQUEUE_PI) | 161 | || cmd == FUTEX_CMP_REQUEUE_PI) |
161 | val2 = (int) (unsigned long) utime; | 162 | val2 = (int) (unsigned long) utime; |
162 | 163 | ||
163 | return do_futex(uaddr, op, val, tp, uaddr2, val2, val3); | 164 | return do_futex(uaddr, op, val, tp, uaddr2, val2, val3); |
diff --git a/kernel/time/timer_stats.c b/kernel/time/timer_stats.c index 868f1bceb07f..321693724ad7 100644 --- a/kernel/time/timer_stats.c +++ b/kernel/time/timer_stats.c | |||
@@ -117,21 +117,6 @@ static struct entry entries[MAX_ENTRIES]; | |||
117 | 117 | ||
118 | static atomic_t overflow_count; | 118 | static atomic_t overflow_count; |
119 | 119 | ||
120 | static void reset_entries(void) | ||
121 | { | ||
122 | nr_entries = 0; | ||
123 | memset(entries, 0, sizeof(entries)); | ||
124 | atomic_set(&overflow_count, 0); | ||
125 | } | ||
126 | |||
127 | static struct entry *alloc_entry(void) | ||
128 | { | ||
129 | if (nr_entries >= MAX_ENTRIES) | ||
130 | return NULL; | ||
131 | |||
132 | return entries + nr_entries++; | ||
133 | } | ||
134 | |||
135 | /* | 120 | /* |
136 | * The entries are in a hash-table, for fast lookup: | 121 | * The entries are in a hash-table, for fast lookup: |
137 | */ | 122 | */ |
@@ -149,6 +134,22 @@ static struct entry *alloc_entry(void) | |||
149 | 134 | ||
150 | static struct entry *tstat_hash_table[TSTAT_HASH_SIZE] __read_mostly; | 135 | static struct entry *tstat_hash_table[TSTAT_HASH_SIZE] __read_mostly; |
151 | 136 | ||
137 | static void reset_entries(void) | ||
138 | { | ||
139 | nr_entries = 0; | ||
140 | memset(entries, 0, sizeof(entries)); | ||
141 | memset(tstat_hash_table, 0, sizeof(tstat_hash_table)); | ||
142 | atomic_set(&overflow_count, 0); | ||
143 | } | ||
144 | |||
145 | static struct entry *alloc_entry(void) | ||
146 | { | ||
147 | if (nr_entries >= MAX_ENTRIES) | ||
148 | return NULL; | ||
149 | |||
150 | return entries + nr_entries++; | ||
151 | } | ||
152 | |||
152 | static int match_entries(struct entry *entry1, struct entry *entry2) | 153 | static int match_entries(struct entry *entry1, struct entry *entry2) |
153 | { | 154 | { |
154 | return entry1->timer == entry2->timer && | 155 | return entry1->timer == entry2->timer && |
@@ -202,12 +203,15 @@ static struct entry *tstat_lookup(struct entry *entry, char *comm) | |||
202 | if (curr) { | 203 | if (curr) { |
203 | *curr = *entry; | 204 | *curr = *entry; |
204 | curr->count = 0; | 205 | curr->count = 0; |
206 | curr->next = NULL; | ||
205 | memcpy(curr->comm, comm, TASK_COMM_LEN); | 207 | memcpy(curr->comm, comm, TASK_COMM_LEN); |
208 | |||
209 | smp_mb(); /* Ensure that curr is initialized before insert */ | ||
210 | |||
206 | if (prev) | 211 | if (prev) |
207 | prev->next = curr; | 212 | prev->next = curr; |
208 | else | 213 | else |
209 | *head = curr; | 214 | *head = curr; |
210 | curr->next = NULL; | ||
211 | } | 215 | } |
212 | out_unlock: | 216 | out_unlock: |
213 | spin_unlock(&table_lock); | 217 | spin_unlock(&table_lock); |
@@ -232,10 +236,15 @@ void timer_stats_update_stats(void *timer, pid_t pid, void *startf, | |||
232 | /* | 236 | /* |
233 | * It doesnt matter which lock we take: | 237 | * It doesnt matter which lock we take: |
234 | */ | 238 | */ |
235 | spinlock_t *lock = &per_cpu(lookup_lock, raw_smp_processor_id()); | 239 | spinlock_t *lock; |
236 | struct entry *entry, input; | 240 | struct entry *entry, input; |
237 | unsigned long flags; | 241 | unsigned long flags; |
238 | 242 | ||
243 | if (likely(!active)) | ||
244 | return; | ||
245 | |||
246 | lock = &per_cpu(lookup_lock, raw_smp_processor_id()); | ||
247 | |||
239 | input.timer = timer; | 248 | input.timer = timer; |
240 | input.start_func = startf; | 249 | input.start_func = startf; |
241 | input.expire_func = timerf; | 250 | input.expire_func = timerf; |
@@ -360,6 +369,7 @@ static ssize_t tstats_write(struct file *file, const char __user *buf, | |||
360 | if (!active) { | 369 | if (!active) { |
361 | reset_entries(); | 370 | reset_entries(); |
362 | time_start = ktime_get(); | 371 | time_start = ktime_get(); |
372 | smp_mb(); | ||
363 | active = 1; | 373 | active = 1; |
364 | } | 374 | } |
365 | break; | 375 | break; |
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 1ba77ca7d165..da95e10cfd70 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -126,7 +126,10 @@ config TIMER_STATS | |||
126 | reprogrammed. The statistics can be read from /proc/timer_stats. | 126 | reprogrammed. The statistics can be read from /proc/timer_stats. |
127 | The statistics collection is started by writing 1 to /proc/timer_stats, | 127 | The statistics collection is started by writing 1 to /proc/timer_stats, |
128 | writing 0 stops it. This feature is useful to collect information | 128 | writing 0 stops it. This feature is useful to collect information |
129 | about timer usage patterns in kernel and userspace. | 129 | about timer usage patterns in kernel and userspace. This feature |
130 | is lightweight if enabled in the kernel config but not activated | ||
131 | (it defaults to deactivated on bootup and will only be activated | ||
132 | if some application like powertop activates it explicitly). | ||
130 | 133 | ||
131 | config DEBUG_SLAB | 134 | config DEBUG_SLAB |
132 | bool "Debug slab memory allocations" | 135 | bool "Debug slab memory allocations" |
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 84279127fcd3..df9d554bea30 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -65,7 +65,7 @@ static int __add_zone(struct zone *zone, unsigned long phys_start_pfn) | |||
65 | int zone_type; | 65 | int zone_type; |
66 | 66 | ||
67 | zone_type = zone - pgdat->node_zones; | 67 | zone_type = zone - pgdat->node_zones; |
68 | if (!populated_zone(zone)) { | 68 | if (!zone->wait_table) { |
69 | int ret = 0; | 69 | int ret = 0; |
70 | ret = init_currently_empty_zone(zone, phys_start_pfn, | 70 | ret = init_currently_empty_zone(zone, phys_start_pfn, |
71 | nr_pages, MEMMAP_HOTPLUG); | 71 | nr_pages, MEMMAP_HOTPLUG); |
@@ -2608,6 +2608,19 @@ static void for_all_slabs(void (*func)(struct kmem_cache *, int), int cpu) | |||
2608 | } | 2608 | } |
2609 | 2609 | ||
2610 | /* | 2610 | /* |
2611 | * Version of __flush_cpu_slab for the case that interrupts | ||
2612 | * are enabled. | ||
2613 | */ | ||
2614 | static void cpu_slab_flush(struct kmem_cache *s, int cpu) | ||
2615 | { | ||
2616 | unsigned long flags; | ||
2617 | |||
2618 | local_irq_save(flags); | ||
2619 | __flush_cpu_slab(s, cpu); | ||
2620 | local_irq_restore(flags); | ||
2621 | } | ||
2622 | |||
2623 | /* | ||
2611 | * Use the cpu notifier to insure that the cpu slabs are flushed when | 2624 | * Use the cpu notifier to insure that the cpu slabs are flushed when |
2612 | * necessary. | 2625 | * necessary. |
2613 | */ | 2626 | */ |
@@ -2621,7 +2634,7 @@ static int __cpuinit slab_cpuup_callback(struct notifier_block *nfb, | |||
2621 | case CPU_UP_CANCELED_FROZEN: | 2634 | case CPU_UP_CANCELED_FROZEN: |
2622 | case CPU_DEAD: | 2635 | case CPU_DEAD: |
2623 | case CPU_DEAD_FROZEN: | 2636 | case CPU_DEAD_FROZEN: |
2624 | for_all_slabs(__flush_cpu_slab, cpu); | 2637 | for_all_slabs(cpu_slab_flush, cpu); |
2625 | break; | 2638 | break; |
2626 | default: | 2639 | default: |
2627 | break; | 2640 | break; |
diff --git a/mm/sparse.c b/mm/sparse.c index 1302f8348d51..545e4d3afcdf 100644 --- a/mm/sparse.c +++ b/mm/sparse.c | |||
@@ -209,6 +209,12 @@ static int __meminit sparse_init_one_section(struct mem_section *ms, | |||
209 | return 1; | 209 | return 1; |
210 | } | 210 | } |
211 | 211 | ||
212 | __attribute__((weak)) | ||
213 | void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size) | ||
214 | { | ||
215 | return NULL; | ||
216 | } | ||
217 | |||
212 | static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum) | 218 | static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum) |
213 | { | 219 | { |
214 | struct page *map; | 220 | struct page *map; |
@@ -219,6 +225,11 @@ static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum) | |||
219 | if (map) | 225 | if (map) |
220 | return map; | 226 | return map; |
221 | 227 | ||
228 | map = alloc_bootmem_high_node(NODE_DATA(nid), | ||
229 | sizeof(struct page) * PAGES_PER_SECTION); | ||
230 | if (map) | ||
231 | return map; | ||
232 | |||
222 | map = alloc_bootmem_node(NODE_DATA(nid), | 233 | map = alloc_bootmem_node(NODE_DATA(nid), |
223 | sizeof(struct page) * PAGES_PER_SECTION); | 234 | sizeof(struct page) * PAGES_PER_SECTION); |
224 | if (map) | 235 | if (map) |
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl new file mode 100644 index 000000000000..e216d49624b7 --- /dev/null +++ b/scripts/checkpatch.pl | |||
@@ -0,0 +1,595 @@ | |||
1 | #!/usr/bin/perl -w | ||
2 | # (c) 2001, Dave Jones. <davej@codemonkey.org.uk> (the file handling bit) | ||
3 | # (c) 2005, Joel Scohpp <jschopp@austin.ibm.com> (the ugly bit) | ||
4 | # (c) 2007, Andy Whitcroft <apw@uk.ibm.com> (new conditions, test suite, etc) | ||
5 | # Licensed under the terms of the GNU GPL License version 2 | ||
6 | |||
7 | use strict; | ||
8 | |||
9 | my $P = $0; | ||
10 | |||
11 | my $V = '0.01'; | ||
12 | |||
13 | use Getopt::Long qw(:config no_auto_abbrev); | ||
14 | |||
15 | my $quiet = 0; | ||
16 | my $tree = 1; | ||
17 | my $chk_signoff = 1; | ||
18 | my $chk_patch = 1; | ||
19 | GetOptions( | ||
20 | 'q|quiet' => \$quiet, | ||
21 | 'tree!' => \$tree, | ||
22 | 'signoff!' => \$chk_signoff, | ||
23 | 'patch!' => \$chk_patch, | ||
24 | ) or exit; | ||
25 | |||
26 | my $exit = 0; | ||
27 | |||
28 | if ($#ARGV < 0) { | ||
29 | print "usage: patchstylecheckemail.pl [options] patchfile\n"; | ||
30 | print "version: $V\n"; | ||
31 | print "options: -q => quiet\n"; | ||
32 | print " --no-tree => run without a kernel tree\n"; | ||
33 | exit(1); | ||
34 | } | ||
35 | |||
36 | if ($tree && !top_of_kernel_tree()) { | ||
37 | print "Must be run from the top-level dir. of a kernel tree\n"; | ||
38 | exit(2); | ||
39 | } | ||
40 | |||
41 | my @deprecated = (); | ||
42 | my $removal = 'Documentation/feature-removal-schedule.txt'; | ||
43 | if ($tree && -f $removal) { | ||
44 | open(REMOVE, "<$removal") || die "$P: $removal: open failed - $!\n"; | ||
45 | while (<REMOVE>) { | ||
46 | if (/^Files:\s+(.*\S)/) { | ||
47 | for my $file (split(/[, ]+/, $1)) { | ||
48 | if ($file =~ m@include/(.*)@) { | ||
49 | push(@deprecated, $1); | ||
50 | } | ||
51 | } | ||
52 | } | ||
53 | } | ||
54 | } | ||
55 | |||
56 | my @lines = (); | ||
57 | while (<>) { | ||
58 | chomp; | ||
59 | push(@lines, $_); | ||
60 | if (eof(ARGV)) { | ||
61 | if (!process($ARGV, @lines)) { | ||
62 | $exit = 1; | ||
63 | } | ||
64 | @lines = (); | ||
65 | } | ||
66 | } | ||
67 | |||
68 | exit($exit); | ||
69 | |||
70 | sub top_of_kernel_tree { | ||
71 | if ((-f "COPYING") && (-f "CREDITS") && (-f "Kbuild") && | ||
72 | (-f "MAINTAINERS") && (-f "Makefile") && (-f "README") && | ||
73 | (-d "Documentation") && (-d "arch") && (-d "include") && | ||
74 | (-d "drivers") && (-d "fs") && (-d "init") && (-d "ipc") && | ||
75 | (-d "kernel") && (-d "lib") && (-d "scripts")) { | ||
76 | return 1; | ||
77 | } | ||
78 | return 0; | ||
79 | } | ||
80 | |||
81 | sub expand_tabs { | ||
82 | my ($str) = @_; | ||
83 | |||
84 | my $res = ''; | ||
85 | my $n = 0; | ||
86 | for my $c (split(//, $str)) { | ||
87 | if ($c eq "\t") { | ||
88 | $res .= ' '; | ||
89 | $n++; | ||
90 | for (; ($n % 8) != 0; $n++) { | ||
91 | $res .= ' '; | ||
92 | } | ||
93 | next; | ||
94 | } | ||
95 | $res .= $c; | ||
96 | $n++; | ||
97 | } | ||
98 | |||
99 | return $res; | ||
100 | } | ||
101 | |||
102 | sub cat_vet { | ||
103 | my ($vet) = @_; | ||
104 | |||
105 | $vet =~ s/\t/^I/; | ||
106 | $vet =~ s/$/\$/; | ||
107 | |||
108 | return $vet; | ||
109 | } | ||
110 | |||
111 | sub process { | ||
112 | my $filename = shift; | ||
113 | my @lines = @_; | ||
114 | |||
115 | my $linenr=0; | ||
116 | my $prevline=""; | ||
117 | my $stashline=""; | ||
118 | |||
119 | my $lineforcounting=''; | ||
120 | my $indent; | ||
121 | my $previndent=0; | ||
122 | my $stashindent=0; | ||
123 | |||
124 | my $clean = 1; | ||
125 | my $signoff = 0; | ||
126 | my $is_patch = 0; | ||
127 | |||
128 | # Trace the real file/line as we go. | ||
129 | my $realfile = ''; | ||
130 | my $realline = 0; | ||
131 | my $realcnt = 0; | ||
132 | my $here = ''; | ||
133 | my $in_comment = 0; | ||
134 | my $first_line = 0; | ||
135 | |||
136 | foreach my $line (@lines) { | ||
137 | $linenr++; | ||
138 | |||
139 | #extract the filename as it passes | ||
140 | if ($line=~/^\+\+\+\s+(\S+)/) { | ||
141 | $realfile=$1; | ||
142 | $in_comment = 0; | ||
143 | next; | ||
144 | } | ||
145 | #extract the line range in the file after the patch is applied | ||
146 | if ($line=~/^\@\@ -\d+,\d+ \+(\d+)(,(\d+))? \@\@/) { | ||
147 | $is_patch = 1; | ||
148 | $first_line = 1; | ||
149 | $in_comment = 0; | ||
150 | $realline=$1-1; | ||
151 | if (defined $2) { | ||
152 | $realcnt=$3+1; | ||
153 | } else { | ||
154 | $realcnt=1+1; | ||
155 | } | ||
156 | next; | ||
157 | } | ||
158 | |||
159 | #track the line number as we move through the hunk | ||
160 | if ($line=~/^[ \+]/) { | ||
161 | $realline++; | ||
162 | $realcnt-- if ($realcnt != 0); | ||
163 | |||
164 | # track any sort of multi-line comment. Obviously if | ||
165 | # the added text or context do not include the whole | ||
166 | # comment we will not see it. Such is life. | ||
167 | # | ||
168 | # Guestimate if this is a continuing comment. If this | ||
169 | # is the start of a diff block and this line starts | ||
170 | # ' *' then it is very likely a comment. | ||
171 | if ($first_line and $line =~ m@^.\s*\*@) { | ||
172 | $in_comment = 1; | ||
173 | } | ||
174 | if ($line =~ m@/\*@) { | ||
175 | $in_comment = 1; | ||
176 | } | ||
177 | if ($line =~ m@\*/@) { | ||
178 | $in_comment = 0; | ||
179 | } | ||
180 | |||
181 | $lineforcounting = $line; | ||
182 | $lineforcounting =~ s/^\+//; | ||
183 | $lineforcounting = expand_tabs($lineforcounting); | ||
184 | |||
185 | my ($white) = ($lineforcounting =~ /^(\s*)/); | ||
186 | $indent = length($white); | ||
187 | |||
188 | # Track the previous line. | ||
189 | ($prevline, $stashline) = ($stashline, $line); | ||
190 | ($previndent, $stashindent) = ($stashindent, $indent); | ||
191 | $first_line = 0; | ||
192 | } | ||
193 | |||
194 | #make up the handle for any error we report on this line | ||
195 | $here = "PATCH: $ARGV:$linenr:"; | ||
196 | $here .= "\nFILE: $realfile:$realline:" if ($realcnt != 0); | ||
197 | |||
198 | my $herecurr = "$here\n$line\n\n"; | ||
199 | my $hereprev = "$here\n$prevline\n$line\n\n"; | ||
200 | |||
201 | #check the patch for a signoff: | ||
202 | if ($line =~ /^\s*Signed-off-by:\s/) { | ||
203 | $signoff++; | ||
204 | |||
205 | } elsif ($line =~ /^\s*signed-off-by:/i) { | ||
206 | if (!($line =~ /^\s*Signed-off-by:/)) { | ||
207 | print "use Signed-off-by:\n"; | ||
208 | print "$herecurr"; | ||
209 | $clean = 0; | ||
210 | } | ||
211 | if ($line =~ /^\s*signed-off-by:\S/i) { | ||
212 | print "need space after Signed-off-by:\n"; | ||
213 | print "$herecurr"; | ||
214 | $clean = 0; | ||
215 | } | ||
216 | } | ||
217 | |||
218 | #ignore lines not being added | ||
219 | if ($line=~/^[^\+]/) {next;} | ||
220 | |||
221 | # check we are in a valid source file *.[hcsS] if not then ignore this hunk | ||
222 | next if ($realfile !~ /\.[hcsS]$/); | ||
223 | |||
224 | #trailing whitespace | ||
225 | if ($line=~/\S\s+$/) { | ||
226 | my $herevet = "$here\n" . cat_vet($line) . "\n\n"; | ||
227 | print "trailing whitespace\n"; | ||
228 | print "$herevet"; | ||
229 | $clean = 0; | ||
230 | } | ||
231 | #80 column limit | ||
232 | if (!($prevline=~/\/\*\*/) && length($lineforcounting) > 80) { | ||
233 | print "line over 80 characters\n"; | ||
234 | print "$herecurr"; | ||
235 | $clean = 0; | ||
236 | } | ||
237 | |||
238 | # check we are in a valid source file *.[hc] if not then ignore this hunk | ||
239 | next if ($realfile !~ /\.[hc]$/); | ||
240 | |||
241 | # at the beginning of a line any tabs must come first and anything | ||
242 | # more than 8 must use tabs. | ||
243 | if ($line=~/^\+\s* \t\s*\S/ or $line=~/^\+\s* \s*/) { | ||
244 | my $herevet = "$here\n" . cat_vet($line) . "\n\n"; | ||
245 | print "use tabs not spaces\n"; | ||
246 | print "$herevet"; | ||
247 | $clean = 0; | ||
248 | } | ||
249 | |||
250 | # | ||
251 | # The rest of our checks refer specifically to C style | ||
252 | # only apply those _outside_ comments. | ||
253 | # | ||
254 | next if ($in_comment); | ||
255 | |||
256 | # no C99 // comments | ||
257 | if ($line =~ m@//@ and !($line =~ m@\".*//.*\"@)) { | ||
258 | print "do not use C99 // comments\n"; | ||
259 | print "$herecurr"; | ||
260 | $clean = 0; | ||
261 | } | ||
262 | |||
263 | # Remove comments from the line before processing. | ||
264 | $line =~ s@/\*.*\*/@@g; | ||
265 | $line =~ s@/\*.*@@; | ||
266 | $line =~ s@.*\*/@@; | ||
267 | $line =~ s@//.*@@; | ||
268 | |||
269 | #EXPORT_SYMBOL should immediately follow its function closing }. | ||
270 | if (($line =~ /EXPORT_SYMBOL.*\(.*\)/) || | ||
271 | ($line =~ /EXPORT_UNUSED_SYMBOL.*\(.*\)/)) { | ||
272 | if (($prevline !~ /^}/) && | ||
273 | ($prevline !~ /^\+}/) && | ||
274 | ($prevline !~ /^ }/)) { | ||
275 | print "EXPORT_SYMBOL(func); should immediately follow its function\n"; | ||
276 | print "$herecurr"; | ||
277 | $clean = 0; | ||
278 | } | ||
279 | } | ||
280 | |||
281 | # check for static initialisers. | ||
282 | if ($line=~/\s*static\s.*=\s+(0|NULL);/) { | ||
283 | print "do not initialise statics to 0 or NULL\n"; | ||
284 | print "$herecurr"; | ||
285 | $clean = 0; | ||
286 | } | ||
287 | |||
288 | # check for new typedefs. | ||
289 | if ($line=~/\s*typedef\s/) { | ||
290 | print "do not add new typedefs\n"; | ||
291 | print "$herecurr"; | ||
292 | $clean = 0; | ||
293 | } | ||
294 | |||
295 | # * goes on variable not on type | ||
296 | if ($line=~/[A-Za-z\d_]+\* [A-Za-z\d_]+/) { | ||
297 | print "\"foo* bar\" should be \"foo *bar\"\n"; | ||
298 | print "$herecurr"; | ||
299 | $clean = 0; | ||
300 | } | ||
301 | |||
302 | # # no BUG() or BUG_ON() | ||
303 | # if ($line =~ /\b(BUG|BUG_ON)\b/) { | ||
304 | # print "Try to use WARN_ON & Recovery code rather than BUG() or BUG_ON()\n"; | ||
305 | # print "$herecurr"; | ||
306 | # $clean = 0; | ||
307 | # } | ||
308 | |||
309 | # printk should use KERN_* levels | ||
310 | if ($line =~ /\bprintk\((?!KERN_)/) { | ||
311 | print "printk() should include KERN_ facility level\n"; | ||
312 | print "$herecurr"; | ||
313 | $clean = 0; | ||
314 | } | ||
315 | |||
316 | #function brace can't be on same line, except for #defines of do while, or if closed on same line | ||
317 | if (($line=~/[A-Za-z\d_]+\**\s+\**[A-Za-z\d_]+\(.*\).* {/) and | ||
318 | !($line=~/\#define.*do\s{/) and !($line=~/}/)) { | ||
319 | print "braces following function declarations go on the next line\n"; | ||
320 | print "$herecurr"; | ||
321 | $clean = 0; | ||
322 | } | ||
323 | my $opline = $line; | ||
324 | $opline =~ s/^.//; | ||
325 | if (!($line=~/\#\s*include/)) { | ||
326 | # Check operator spacing. | ||
327 | my @elements = split(/(<<=|>>=|<=|>=|==|!=|\+=|-=|\*=|\/=|%=|\^=|\|=|&=|->|<<|>>|<|>|=|!|~|&&|\|\||,|\^|\+\+|--|;|&|\||\+|-|\*|\/\/|\/)/, $opline); | ||
328 | for (my $n = 0; $n < $#elements; $n += 2) { | ||
329 | # $wN says we have white-space before or after | ||
330 | # $sN says we have a separator before or after | ||
331 | # $oN says we have another operator before or after | ||
332 | my $w1 = $elements[$n] =~ /\s$/; | ||
333 | my $s1 = $elements[$n] =~ /(\[|\(|\s)$/; | ||
334 | my $o1 = $elements[$n] eq ''; | ||
335 | my $op = $elements[$n + 1]; | ||
336 | my $w2 = 1; | ||
337 | my $s2 = 1; | ||
338 | my $o2 = 0; | ||
339 | # If we have something after the operator handle it. | ||
340 | if (defined $elements[$n + 2]) { | ||
341 | $w2 = $elements[$n + 2] =~ /^\s/; | ||
342 | $s2 = $elements[$n + 2] =~ /^(\s|\)|\]|;)/; | ||
343 | $o2 = $elements[$n + 2] eq ''; | ||
344 | } | ||
345 | |||
346 | # Generate the context. | ||
347 | my $at = "here: "; | ||
348 | for (my $m = $n; $m >= 0; $m--) { | ||
349 | if ($elements[$m] ne '') { | ||
350 | $at .= $elements[$m]; | ||
351 | last; | ||
352 | } | ||
353 | } | ||
354 | $at .= $op; | ||
355 | for (my $m = $n + 2; defined $elements[$m]; $m++) { | ||
356 | if ($elements[$m] ne '') { | ||
357 | $at .= $elements[$m]; | ||
358 | last; | ||
359 | } | ||
360 | } | ||
361 | |||
362 | ##print "<$s1:$op:$s2> <$elements[$n]:$elements[$n + 1]:$elements[$n + 2]>\n"; | ||
363 | # Skip things apparently in quotes. | ||
364 | next if ($line=~/\".*\Q$op\E.*\"/ or $line=~/\'\Q$op\E\'/); | ||
365 | |||
366 | # We need ; as an operator. // is a comment. | ||
367 | if ($op eq ';' or $op eq '//') { | ||
368 | |||
369 | # -> should have no spaces | ||
370 | } elsif ($op eq '->') { | ||
371 | if ($s1 or $s2) { | ||
372 | print "no spaces around that '$op' $at\n"; | ||
373 | print "$herecurr"; | ||
374 | $clean = 0; | ||
375 | } | ||
376 | |||
377 | # , must have a space on the right. | ||
378 | } elsif ($op eq ',') { | ||
379 | if (!$s2) { | ||
380 | print "need space after that '$op' $at\n"; | ||
381 | print "$herecurr"; | ||
382 | $clean = 0; | ||
383 | } | ||
384 | |||
385 | # unary ! and unary ~ are allowed no space on the right | ||
386 | } elsif ($op eq '!' or $op eq '~') { | ||
387 | if (!$s1 && !$o1) { | ||
388 | print "need space before that '$op' $at\n"; | ||
389 | print "$herecurr"; | ||
390 | $clean = 0; | ||
391 | } | ||
392 | if ($s2) { | ||
393 | print "no space after that '$op' $at\n"; | ||
394 | print "$herecurr"; | ||
395 | $clean = 0; | ||
396 | } | ||
397 | |||
398 | # unary ++ and unary -- are allowed no space on one side. | ||
399 | } elsif ($op eq '++' or $op eq '--') { | ||
400 | if (($s1 && $s2) || ((!$s1 && !$o1) && (!$s2 && !$o2))) { | ||
401 | print "need space one side of that '$op' $at\n"; | ||
402 | print "$herecurr"; | ||
403 | $clean = 0; | ||
404 | } | ||
405 | |||
406 | # & is both unary and binary | ||
407 | # unary: | ||
408 | # a &b | ||
409 | # binary (consistent spacing): | ||
410 | # a&b OK | ||
411 | # a & b OK | ||
412 | # | ||
413 | # boiling down to: if there is a space on the right then there | ||
414 | # should be one on the left. | ||
415 | # | ||
416 | # - is the same | ||
417 | # | ||
418 | # * is the same only adding: | ||
419 | # type: | ||
420 | # (foo *) | ||
421 | # (foo **) | ||
422 | # | ||
423 | } elsif ($op eq '&' or $op eq '-' or $op eq '*') { | ||
424 | if ($w2 and !$w1) { | ||
425 | print "need space before that '$op' $at\n"; | ||
426 | print "$herecurr"; | ||
427 | $clean = 0; | ||
428 | } | ||
429 | |||
430 | # << and >> may either have or not have spaces both sides | ||
431 | } elsif ($op eq '<<' or $op eq '>>' or $op eq '+' or $op eq '/' or | ||
432 | $op eq '^' or $op eq '|') | ||
433 | { | ||
434 | if ($s1 != $s2) { | ||
435 | print "need consistent spacing around '$op' $at\n"; | ||
436 | print "$herecurr"; | ||
437 | $clean = 0; | ||
438 | } | ||
439 | |||
440 | # All the others need spaces both sides. | ||
441 | } elsif (!$s1 or !$s2) { | ||
442 | print "need spaces around that '$op' $at\n"; | ||
443 | print "$herecurr"; | ||
444 | $clean = 0; | ||
445 | } | ||
446 | } | ||
447 | } | ||
448 | |||
449 | #need space before brace following if, while, etc | ||
450 | if ($line=~/\(.*\){/) { | ||
451 | print "need a space before the brace\n"; | ||
452 | print "$herecurr"; | ||
453 | $clean = 0; | ||
454 | } | ||
455 | |||
456 | #goto labels aren't indented, allow a single space however | ||
457 | if ($line=~/^.\s+[A-Za-z\d_]+:/ and | ||
458 | !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) { | ||
459 | print "labels should not be indented\n"; | ||
460 | print "$herecurr"; | ||
461 | $clean = 0; | ||
462 | } | ||
463 | |||
464 | # Need a space before open parenthesis after if, while etc | ||
465 | if ($line=~/(if|while|for|switch)\(/) { | ||
466 | print "need a space before the open parenthesis\n"; | ||
467 | print "$herecurr"; | ||
468 | $clean = 0; | ||
469 | } | ||
470 | |||
471 | # Check for illegal assignment in if conditional. | ||
472 | if ($line=~/(if|while)\s*\(.*[^<>!=]=[^=].*\)/) { | ||
473 | print "do not use assignment in if condition\n"; | ||
474 | print "$herecurr"; | ||
475 | $clean = 0; | ||
476 | } | ||
477 | |||
478 | # Check for }<nl>else {, these must be at the same | ||
479 | # indent level to be relevant to each other. | ||
480 | if ($prevline=~/}\s*$/ and $line=~/^.\s*else\s*/ and | ||
481 | $previndent == $indent) { | ||
482 | print "else should follow close brace\n"; | ||
483 | print "$hereprev"; | ||
484 | $clean = 0; | ||
485 | } | ||
486 | |||
487 | # Check for switch () {<nl>case, these must be at the | ||
488 | # same indent. We will only catch the first one, as our | ||
489 | # context is very small but people tend to be consistent | ||
490 | # so we will catch them out more often than not. | ||
491 | if ($prevline=~/\s*switch\s*\(.*\)/ and $line=~/\s*case\s+/ | ||
492 | and $previndent != $indent) { | ||
493 | print "switch and case should be at the same indent\n"; | ||
494 | print "$hereprev"; | ||
495 | $clean = 0; | ||
496 | } | ||
497 | |||
498 | #studly caps, commented out until figure out how to distinguish between use of existing and adding new | ||
499 | # if (($line=~/[\w_][a-z\d]+[A-Z]/) and !($line=~/print/)) { | ||
500 | # print "No studly caps, use _\n"; | ||
501 | # print "$herecurr"; | ||
502 | # $clean = 0; | ||
503 | # } | ||
504 | |||
505 | #no spaces allowed after \ in define | ||
506 | if ($line=~/\#define.*\\\s$/) { | ||
507 | print("Whitepspace after \\ makes next lines useless\n"); | ||
508 | print "$herecurr"; | ||
509 | $clean = 0; | ||
510 | } | ||
511 | |||
512 | #warn if <asm/foo.h> is #included and <linux/foo.h> is available. | ||
513 | if ($tree && $line =~ qr|\s*\#\s*include\s*\<asm\/(.*)\.h\>|) { | ||
514 | my $checkfile = "include/linux/$1.h"; | ||
515 | if (-f $checkfile) { | ||
516 | print "Use #include <linux/$1.h> instead of <asm/$1.h>\n"; | ||
517 | print $herecurr; | ||
518 | $clean = 0; | ||
519 | } | ||
520 | } | ||
521 | |||
522 | #if/while/etc brace do not go on next line, unless #defining a do while loop, or if that brace on the next line is for something else | ||
523 | if ($prevline=~/(if|while|for|switch)\s*\(/) { | ||
524 | my @opened = $prevline=~/\(/g; | ||
525 | my @closed = $prevline=~/\)/g; | ||
526 | my $nr_line = $linenr; | ||
527 | my $remaining = $realcnt; | ||
528 | my $next_line = $line; | ||
529 | my $extra_lines = 0; | ||
530 | my $display_segment = $prevline; | ||
531 | |||
532 | while ($remaining > 0 && scalar @opened > scalar @closed) { | ||
533 | $prevline .= $next_line; | ||
534 | $display_segment .= "\n" . $next_line; | ||
535 | $next_line = $lines[$nr_line]; | ||
536 | $nr_line++; | ||
537 | $remaining--; | ||
538 | |||
539 | @opened = $prevline=~/\(/g; | ||
540 | @closed = $prevline=~/\)/g; | ||
541 | } | ||
542 | |||
543 | if (($prevline=~/(if|while|for|switch)\s*\(.*\)\s*$/) and ($next_line=~/{/) and | ||
544 | !($next_line=~/(if|while|for)/) and !($next_line=~/\#define.*do.*while/)) { | ||
545 | print "That { should be on the previous line\n"; | ||
546 | print "$display_segment\n$next_line\n\n"; | ||
547 | $clean = 0; | ||
548 | } | ||
549 | } | ||
550 | |||
551 | #multiline macros should be enclosed in a do while loop | ||
552 | if (($prevline=~/\#define.*\\/) and !($prevline=~/do\s+{/) and | ||
553 | !($prevline=~/\(\{/) and ($line=~/;\s*\\/) and | ||
554 | !($line=~/do.*{/) and !($line=~/\(\{/)) { | ||
555 | print "Macros with multiple statements should be enclosed in a do - while loop\n"; | ||
556 | print "$hereprev"; | ||
557 | $clean = 0; | ||
558 | } | ||
559 | |||
560 | # don't include deprecated include files | ||
561 | for my $inc (@deprecated) { | ||
562 | if ($line =~ m@\#\s*include\s*\<$inc>@) { | ||
563 | print "Don't use <$inc>: see Documentation/feature-removal-schedule.txt\n"; | ||
564 | print "$herecurr"; | ||
565 | $clean = 0; | ||
566 | } | ||
567 | } | ||
568 | |||
569 | # don't use kernel_thread() | ||
570 | if ($line =~ /\bkernel_thread\b/) { | ||
571 | print "Don't use kernel_thread(), use kthread(): see Documentation/feature-removal-schedule.txt\n"; | ||
572 | print "$herecurr"; | ||
573 | $clean = 0; | ||
574 | } | ||
575 | } | ||
576 | |||
577 | if ($chk_patch && !$is_patch) { | ||
578 | $clean = 0; | ||
579 | print "Does not appear to be a unified-diff format patch\n"; | ||
580 | } | ||
581 | if ($is_patch && $chk_signoff && $signoff == 0) { | ||
582 | $clean = 0; | ||
583 | print "Missing Signed-off-by: line(s)\n"; | ||
584 | } | ||
585 | |||
586 | if ($clean == 1 && $quiet == 0) { | ||
587 | print "Your patch has no obvious style problems and is ready for submission.\n" | ||
588 | } | ||
589 | if ($clean == 0 && $quiet == 0) { | ||
590 | print "Your patch has style problems, please review. If any of these errors\n"; | ||
591 | print "are false positives report them to the maintainer, see\n"; | ||
592 | print "CHECKPATCH in MAINTAINERS.\n"; | ||
593 | } | ||
594 | return $clean; | ||
595 | } | ||
diff --git a/sound/arm/sa11xx-uda1341.c b/sound/arm/sa11xx-uda1341.c index c7e1b2646193..e7ed868fa7c0 100644 --- a/sound/arm/sa11xx-uda1341.c +++ b/sound/arm/sa11xx-uda1341.c | |||
@@ -987,7 +987,7 @@ static int __init sa11xx_uda1341_init(void) | |||
987 | if (platform_get_drvdata(device)) | 987 | if (platform_get_drvdata(device)) |
988 | return 0; | 988 | return 0; |
989 | platform_device_unregister(device); | 989 | platform_device_unregister(device); |
990 | err = -ENODEV | 990 | err = -ENODEV; |
991 | } else | 991 | } else |
992 | err = PTR_ERR(device); | 992 | err = PTR_ERR(device); |
993 | platform_driver_unregister(&sa11xx_uda1341_driver); | 993 | platform_driver_unregister(&sa11xx_uda1341_driver); |