1 |
commit: 219e6220b29d24e43cc5b8304c8a365bdcb4e4ba |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Feb 8 11:16:27 2017 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 8 11:16:27 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=219e6220 |
7 |
|
8 |
Linux patch 3.18.48 |
9 |
|
10 |
0000_README | 4 + |
11 |
1047_linux-3.18.48.patch | 1219 ++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 1223 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index 957c01d..4676a64 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -231,6 +231,10 @@ Patch: 1046_linux-3.18.47.patch |
19 |
From: http://www.kernel.org |
20 |
Desc: Linux 3.18.47 |
21 |
|
22 |
+Patch: 1047_linux-3.18.48.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 3.18.48 |
25 |
+ |
26 |
Patch: 1500_XATTR_USER_PREFIX.patch |
27 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
28 |
Desc: Support for namespace user.pax.* on tmpfs. |
29 |
|
30 |
diff --git a/1047_linux-3.18.48.patch b/1047_linux-3.18.48.patch |
31 |
new file mode 100644 |
32 |
index 0000000..7884316 |
33 |
--- /dev/null |
34 |
+++ b/1047_linux-3.18.48.patch |
35 |
@@ -0,0 +1,1219 @@ |
36 |
+diff --git a/Documentation/Makefile b/Documentation/Makefile |
37 |
+index 6883a1b9b351..bc0548201755 100644 |
38 |
+--- a/Documentation/Makefile |
39 |
++++ b/Documentation/Makefile |
40 |
+@@ -1,4 +1,4 @@ |
41 |
+-subdir-y := accounting arm auxdisplay blackfin connector \ |
42 |
++subdir-y := accounting auxdisplay blackfin connector \ |
43 |
+ filesystems filesystems ia64 laptops mic misc-devices \ |
44 |
+ networking pcmcia prctl ptp spi timers vDSO video4linux \ |
45 |
+ watchdog |
46 |
+diff --git a/Documentation/arm/Makefile b/Documentation/arm/Makefile |
47 |
+deleted file mode 100644 |
48 |
+index 732c77050cff..000000000000 |
49 |
+--- a/Documentation/arm/Makefile |
50 |
++++ /dev/null |
51 |
+@@ -1 +0,0 @@ |
52 |
+-subdir-y := SH-Mobile |
53 |
+diff --git a/Documentation/arm/SH-Mobile/Makefile b/Documentation/arm/SH-Mobile/Makefile |
54 |
+deleted file mode 100644 |
55 |
+index bca8a7ef6bbe..000000000000 |
56 |
+--- a/Documentation/arm/SH-Mobile/Makefile |
57 |
++++ /dev/null |
58 |
+@@ -1,7 +0,0 @@ |
59 |
+-# List of programs to build |
60 |
+-hostprogs-y := vrl4 |
61 |
+- |
62 |
+-# Tell kbuild to always build the programs |
63 |
+-always := $(hostprogs-y) |
64 |
+- |
65 |
+-HOSTCFLAGS_vrl4.o += -I$(objtree)/usr/include -I$(srctree)/tools/include |
66 |
+diff --git a/Documentation/arm/SH-Mobile/vrl4.c b/Documentation/arm/SH-Mobile/vrl4.c |
67 |
+deleted file mode 100644 |
68 |
+index f4cd8ad4e720..000000000000 |
69 |
+--- a/Documentation/arm/SH-Mobile/vrl4.c |
70 |
++++ /dev/null |
71 |
+@@ -1,170 +0,0 @@ |
72 |
+-/* |
73 |
+- * vrl4 format generator |
74 |
+- * |
75 |
+- * Copyright (C) 2010 Simon Horman |
76 |
+- * |
77 |
+- * This file is subject to the terms and conditions of the GNU General Public |
78 |
+- * License. See the file "COPYING" in the main directory of this archive |
79 |
+- * for more details. |
80 |
+- */ |
81 |
+- |
82 |
+-/* |
83 |
+- * usage: vrl4 < zImage > out |
84 |
+- * dd if=out of=/dev/sdx bs=512 seek=1 # Write the image to sector 1 |
85 |
+- * |
86 |
+- * Reads a zImage from stdin and writes a vrl4 image to stdout. |
87 |
+- * In practice this means writing a padded vrl4 header to stdout followed |
88 |
+- * by the zImage. |
89 |
+- * |
90 |
+- * The padding places the zImage at ALIGN bytes into the output. |
91 |
+- * The vrl4 uses ALIGN + START_BASE as the start_address. |
92 |
+- * This is where the mask ROM will jump to after verifying the header. |
93 |
+- * |
94 |
+- * The header sets copy_size to min(sizeof(zImage), MAX_BOOT_PROG_LEN) + ALIGN. |
95 |
+- * That is, the mask ROM will load the padded header (ALIGN bytes) |
96 |
+- * And then MAX_BOOT_PROG_LEN bytes of the image, or the entire image, |
97 |
+- * whichever is smaller. |
98 |
+- * |
99 |
+- * The zImage is not modified in any way. |
100 |
+- */ |
101 |
+- |
102 |
+-#define _BSD_SOURCE |
103 |
+-#include <endian.h> |
104 |
+-#include <unistd.h> |
105 |
+-#include <stdint.h> |
106 |
+-#include <stdio.h> |
107 |
+-#include <errno.h> |
108 |
+-#include <tools/endian.h> |
109 |
+- |
110 |
+-struct hdr { |
111 |
+- uint32_t magic1; |
112 |
+- uint32_t reserved1; |
113 |
+- uint32_t magic2; |
114 |
+- uint32_t reserved2; |
115 |
+- uint16_t copy_size; |
116 |
+- uint16_t boot_options; |
117 |
+- uint32_t reserved3; |
118 |
+- uint32_t start_address; |
119 |
+- uint32_t reserved4; |
120 |
+- uint32_t reserved5; |
121 |
+- char reserved6[308]; |
122 |
+-}; |
123 |
+- |
124 |
+-#define DECLARE_HDR(h) \ |
125 |
+- struct hdr (h) = { \ |
126 |
+- .magic1 = htole32(0xea000000), \ |
127 |
+- .reserved1 = htole32(0x56), \ |
128 |
+- .magic2 = htole32(0xe59ff008), \ |
129 |
+- .reserved3 = htole16(0x1) } |
130 |
+- |
131 |
+-/* Align to 512 bytes, the MMCIF sector size */ |
132 |
+-#define ALIGN_BITS 9 |
133 |
+-#define ALIGN (1 << ALIGN_BITS) |
134 |
+- |
135 |
+-#define START_BASE 0xe55b0000 |
136 |
+- |
137 |
+-/* |
138 |
+- * With an alignment of 512 the header uses the first sector. |
139 |
+- * There is a 128 sector (64kbyte) limit on the data loaded by the mask ROM. |
140 |
+- * So there are 127 sectors left for the boot programme. But in practice |
141 |
+- * Only a small portion of a zImage is needed, 16 sectors should be more |
142 |
+- * than enough. |
143 |
+- * |
144 |
+- * Note that this sets how much of the zImage is copied by the mask ROM. |
145 |
+- * The entire zImage is present after the header and is loaded |
146 |
+- * by the code in the boot program (which is the first portion of the zImage). |
147 |
+- */ |
148 |
+-#define MAX_BOOT_PROG_LEN (16 * 512) |
149 |
+- |
150 |
+-#define ROUND_UP(x) ((x + ALIGN - 1) & ~(ALIGN - 1)) |
151 |
+- |
152 |
+-static ssize_t do_read(int fd, void *buf, size_t count) |
153 |
+-{ |
154 |
+- size_t offset = 0; |
155 |
+- ssize_t l; |
156 |
+- |
157 |
+- while (offset < count) { |
158 |
+- l = read(fd, buf + offset, count - offset); |
159 |
+- if (!l) |
160 |
+- break; |
161 |
+- if (l < 0) { |
162 |
+- if (errno == EAGAIN || errno == EWOULDBLOCK) |
163 |
+- continue; |
164 |
+- perror("read"); |
165 |
+- return -1; |
166 |
+- } |
167 |
+- offset += l; |
168 |
+- } |
169 |
+- |
170 |
+- return offset; |
171 |
+-} |
172 |
+- |
173 |
+-static ssize_t do_write(int fd, const void *buf, size_t count) |
174 |
+-{ |
175 |
+- size_t offset = 0; |
176 |
+- ssize_t l; |
177 |
+- |
178 |
+- while (offset < count) { |
179 |
+- l = write(fd, buf + offset, count - offset); |
180 |
+- if (l < 0) { |
181 |
+- if (errno == EAGAIN || errno == EWOULDBLOCK) |
182 |
+- continue; |
183 |
+- perror("write"); |
184 |
+- return -1; |
185 |
+- } |
186 |
+- offset += l; |
187 |
+- } |
188 |
+- |
189 |
+- return offset; |
190 |
+-} |
191 |
+- |
192 |
+-static ssize_t write_zero(int fd, size_t len) |
193 |
+-{ |
194 |
+- size_t i = len; |
195 |
+- |
196 |
+- while (i--) { |
197 |
+- const char x = 0; |
198 |
+- if (do_write(fd, &x, 1) < 0) |
199 |
+- return -1; |
200 |
+- } |
201 |
+- |
202 |
+- return len; |
203 |
+-} |
204 |
+- |
205 |
+-int main(void) |
206 |
+-{ |
207 |
+- DECLARE_HDR(hdr); |
208 |
+- char boot_program[MAX_BOOT_PROG_LEN]; |
209 |
+- size_t aligned_hdr_len, alligned_prog_len; |
210 |
+- ssize_t prog_len; |
211 |
+- |
212 |
+- prog_len = do_read(0, boot_program, sizeof(boot_program)); |
213 |
+- if (prog_len <= 0) |
214 |
+- return -1; |
215 |
+- |
216 |
+- aligned_hdr_len = ROUND_UP(sizeof(hdr)); |
217 |
+- hdr.start_address = htole32(START_BASE + aligned_hdr_len); |
218 |
+- alligned_prog_len = ROUND_UP(prog_len); |
219 |
+- hdr.copy_size = htole16(aligned_hdr_len + alligned_prog_len); |
220 |
+- |
221 |
+- if (do_write(1, &hdr, sizeof(hdr)) < 0) |
222 |
+- return -1; |
223 |
+- if (write_zero(1, aligned_hdr_len - sizeof(hdr)) < 0) |
224 |
+- return -1; |
225 |
+- |
226 |
+- if (do_write(1, boot_program, prog_len) < 0) |
227 |
+- return 1; |
228 |
+- |
229 |
+- /* Write out the rest of the kernel */ |
230 |
+- while (1) { |
231 |
+- prog_len = do_read(0, boot_program, sizeof(boot_program)); |
232 |
+- if (prog_len < 0) |
233 |
+- return 1; |
234 |
+- if (prog_len == 0) |
235 |
+- break; |
236 |
+- if (do_write(1, boot_program, prog_len) < 0) |
237 |
+- return 1; |
238 |
+- } |
239 |
+- |
240 |
+- return 0; |
241 |
+-} |
242 |
+diff --git a/Documentation/arm/SH-Mobile/zboot-rom-mmcif.txt b/Documentation/arm/SH-Mobile/zboot-rom-mmcif.txt |
243 |
+deleted file mode 100644 |
244 |
+index efff8ae2713d..000000000000 |
245 |
+--- a/Documentation/arm/SH-Mobile/zboot-rom-mmcif.txt |
246 |
++++ /dev/null |
247 |
+@@ -1,29 +0,0 @@ |
248 |
+-ROM-able zImage boot from MMC |
249 |
+------------------------------ |
250 |
+- |
251 |
+-An ROM-able zImage compiled with ZBOOT_ROM_MMCIF may be written to MMC and |
252 |
+-SuperH Mobile ARM will to boot directly from the MMCIF hardware block. |
253 |
+- |
254 |
+-This is achieved by the mask ROM loading the first portion of the image into |
255 |
+-MERAM and then jumping to it. This portion contains loader code which |
256 |
+-copies the entire image to SDRAM and jumps to it. From there the zImage |
257 |
+-boot code proceeds as normal, uncompressing the image into its final |
258 |
+-location and then jumping to it. |
259 |
+- |
260 |
+-This code has been tested on an AP4EB board using the developer 1A eMMC |
261 |
+-boot mode which is configured using the following jumper settings. |
262 |
+-The board used for testing required a patched mask ROM in order for |
263 |
+-this mode to function. |
264 |
+- |
265 |
+- 8 7 6 5 4 3 2 1 |
266 |
+- x|x|x|x|x| |x| |
267 |
+-S4 -+-+-+-+-+-+-+- |
268 |
+- | | | | |x| |x on |
269 |
+- |
270 |
+-The zImage must be written to the MMC card at sector 1 (512 bytes) in |
271 |
+-vrl4 format. A utility vrl4 is supplied to accomplish this. |
272 |
+- |
273 |
+-e.g. |
274 |
+- vrl4 < zImage | dd of=/dev/sdX bs=512 seek=1 |
275 |
+- |
276 |
+-A dual-voltage MMC 4.0 card was used for testing. |
277 |
+diff --git a/Documentation/arm/SH-Mobile/zboot-rom-sdhi.txt b/Documentation/arm/SH-Mobile/zboot-rom-sdhi.txt |
278 |
+deleted file mode 100644 |
279 |
+index 441959846e1a..000000000000 |
280 |
+--- a/Documentation/arm/SH-Mobile/zboot-rom-sdhi.txt |
281 |
++++ /dev/null |
282 |
+@@ -1,42 +0,0 @@ |
283 |
+-ROM-able zImage boot from eSD |
284 |
+------------------------------ |
285 |
+- |
286 |
+-An ROM-able zImage compiled with ZBOOT_ROM_SDHI may be written to eSD and |
287 |
+-SuperH Mobile ARM will to boot directly from the SDHI hardware block. |
288 |
+- |
289 |
+-This is achieved by the mask ROM loading the first portion of the image into |
290 |
+-MERAM and then jumping to it. This portion contains loader code which |
291 |
+-copies the entire image to SDRAM and jumps to it. From there the zImage |
292 |
+-boot code proceeds as normal, uncompressing the image into its final |
293 |
+-location and then jumping to it. |
294 |
+- |
295 |
+-This code has been tested on an mackerel board using the developer 1A eSD |
296 |
+-boot mode which is configured using the following jumper settings. |
297 |
+- |
298 |
+- 8 7 6 5 4 3 2 1 |
299 |
+- x|x|x|x| |x|x| |
300 |
+-S4 -+-+-+-+-+-+-+- |
301 |
+- | | | |x| | |x on |
302 |
+- |
303 |
+-The eSD card needs to be present in SDHI slot 1 (CN7). |
304 |
+-As such S1 and S33 also need to be configured as per |
305 |
+-the notes in arch/arm/mach-shmobile/board-mackerel.c. |
306 |
+- |
307 |
+-A partial zImage must be written to physical partition #1 (boot) |
308 |
+-of the eSD at sector 0 in vrl4 format. A utility vrl4 is supplied to |
309 |
+-accomplish this. |
310 |
+- |
311 |
+-e.g. |
312 |
+- vrl4 < zImage | dd of=/dev/sdX bs=512 count=17 |
313 |
+- |
314 |
+-A full copy of _the same_ zImage should be written to physical partition #1 |
315 |
+-(boot) of the eSD at sector 0. This should _not_ be in vrl4 format. |
316 |
+- |
317 |
+- vrl4 < zImage | dd of=/dev/sdX bs=512 |
318 |
+- |
319 |
+-Note: The commands above assume that the physical partition has been |
320 |
+-switched. No such facility currently exists in the Linux Kernel. |
321 |
+- |
322 |
+-Physical partitions are described in the eSD specification. At the time of |
323 |
+-writing they are not the same as partitions that are typically configured |
324 |
+-using fdisk and visible through /proc/partitions |
325 |
+diff --git a/Documentation/video4linux/v4l2-pci-skeleton.c b/Documentation/video4linux/v4l2-pci-skeleton.c |
326 |
+index 006721e43b2a..7bd1b975bfd2 100644 |
327 |
+--- a/Documentation/video4linux/v4l2-pci-skeleton.c |
328 |
++++ b/Documentation/video4linux/v4l2-pci-skeleton.c |
329 |
+@@ -42,7 +42,6 @@ |
330 |
+ MODULE_DESCRIPTION("V4L2 PCI Skeleton Driver"); |
331 |
+ MODULE_AUTHOR("Hans Verkuil"); |
332 |
+ MODULE_LICENSE("GPL v2"); |
333 |
+-MODULE_DEVICE_TABLE(pci, skeleton_pci_tbl); |
334 |
+ |
335 |
+ /** |
336 |
+ * struct skeleton - All internal data for one instance of device |
337 |
+@@ -95,6 +94,7 @@ static const struct pci_device_id skeleton_pci_tbl[] = { |
338 |
+ /* { PCI_DEVICE(PCI_VENDOR_ID_, PCI_DEVICE_ID_) }, */ |
339 |
+ { 0, } |
340 |
+ }; |
341 |
++MODULE_DEVICE_TABLE(pci, skeleton_pci_tbl); |
342 |
+ |
343 |
+ /* |
344 |
+ * HDTV: this structure has the capabilities of the HDTV receiver. |
345 |
+diff --git a/Makefile b/Makefile |
346 |
+index 9132f73528b3..52d32f6bd7c5 100644 |
347 |
+--- a/Makefile |
348 |
++++ b/Makefile |
349 |
+@@ -1,6 +1,6 @@ |
350 |
+ VERSION = 3 |
351 |
+ PATCHLEVEL = 18 |
352 |
+-SUBLEVEL = 47 |
353 |
++SUBLEVEL = 48 |
354 |
+ EXTRAVERSION = |
355 |
+ NAME = Diseased Newt |
356 |
+ |
357 |
+@@ -610,6 +610,7 @@ all: vmlinux |
358 |
+ include $(srctree)/arch/$(SRCARCH)/Makefile |
359 |
+ |
360 |
+ KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) |
361 |
++KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) |
362 |
+ KBUILD_CFLAGS += $(call cc-option,-fno-PIE) |
363 |
+ KBUILD_AFLAGS += $(call cc-option,-fno-PIE) |
364 |
+ |
365 |
+diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h |
366 |
+index 24e3e569a13c..124312be129b 100644 |
367 |
+--- a/arch/x86/boot/compressed/misc.h |
368 |
++++ b/arch/x86/boot/compressed/misc.h |
369 |
+@@ -2,14 +2,13 @@ |
370 |
+ #define BOOT_COMPRESSED_MISC_H |
371 |
+ |
372 |
+ /* |
373 |
+- * we have to be careful, because no indirections are allowed here, and |
374 |
+- * paravirt_ops is a kind of one. As it will only run in baremetal anyway, |
375 |
+- * we just keep it from happening |
376 |
++ * Special hack: we have to be careful, because no indirections are allowed here, |
377 |
++ * and paravirt_ops is a kind of one. As it will only run in baremetal anyway, |
378 |
++ * we just keep it from happening. (This list needs to be extended when new |
379 |
++ * paravirt and debugging variants are added.) |
380 |
+ */ |
381 |
+ #undef CONFIG_PARAVIRT |
382 |
+-#ifdef CONFIG_X86_32 |
383 |
+-#define _ASM_X86_DESC_H 1 |
384 |
+-#endif |
385 |
++#undef CONFIG_PARAVIRT_SPINLOCKS |
386 |
+ |
387 |
+ #include <linux/linkage.h> |
388 |
+ #include <linux/screen_info.h> |
389 |
+diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c |
390 |
+index a8a1a3d08d4d..039d4e14194d 100644 |
391 |
+--- a/arch/x86/xen/mmu.c |
392 |
++++ b/arch/x86/xen/mmu.c |
393 |
+@@ -1147,7 +1147,7 @@ static void __init xen_cleanhighmap(unsigned long vaddr, |
394 |
+ |
395 |
+ /* NOTE: The loop is more greedy than the cleanup_highmap variant. |
396 |
+ * We include the PMD passed in on _both_ boundaries. */ |
397 |
+- for (; vaddr <= vaddr_end && (pmd < (level2_kernel_pgt + PAGE_SIZE)); |
398 |
++ for (; vaddr <= vaddr_end && (pmd < (level2_kernel_pgt + PTRS_PER_PMD)); |
399 |
+ pmd++, vaddr += PMD_SIZE) { |
400 |
+ if (pmd_none(*pmd)) |
401 |
+ continue; |
402 |
+diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c |
403 |
+index 434af81b9e33..df99445a899a 100644 |
404 |
+--- a/crypto/algif_hash.c |
405 |
++++ b/crypto/algif_hash.c |
406 |
+@@ -283,8 +283,8 @@ unlock_child: |
407 |
+ return err; |
408 |
+ } |
409 |
+ |
410 |
+-static int hash_sendmsg_nokey(struct socket *sock, struct msghdr *msg, |
411 |
+- size_t size) |
412 |
++static int hash_sendmsg_nokey(struct kiocb *unused, struct socket *sock, |
413 |
++ struct msghdr *msg, size_t size) |
414 |
+ { |
415 |
+ int err; |
416 |
+ |
417 |
+@@ -307,8 +307,8 @@ static ssize_t hash_sendpage_nokey(struct socket *sock, struct page *page, |
418 |
+ return hash_sendpage(sock, page, offset, size, flags); |
419 |
+ } |
420 |
+ |
421 |
+-static int hash_recvmsg_nokey(struct socket *sock, struct msghdr *msg, |
422 |
+- size_t ignored, int flags) |
423 |
++static int hash_recvmsg_nokey(struct kiocb *unused, struct socket *sock, |
424 |
++ struct msghdr *msg, size_t ignored, int flags) |
425 |
+ { |
426 |
+ int err; |
427 |
+ |
428 |
+diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c |
429 |
+index cbc3de793d1d..0038dc4c06c7 100644 |
430 |
+--- a/drivers/ata/pata_hpt366.c |
431 |
++++ b/drivers/ata/pata_hpt366.c |
432 |
+@@ -352,7 +352,7 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id) |
433 |
+ }; |
434 |
+ const struct ata_port_info *ppi[] = { &info_hpt366, NULL }; |
435 |
+ |
436 |
+- void *hpriv = NULL; |
437 |
++ const void *hpriv = NULL; |
438 |
+ u32 reg1; |
439 |
+ int rc; |
440 |
+ |
441 |
+@@ -383,7 +383,7 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id) |
442 |
+ break; |
443 |
+ } |
444 |
+ /* Now kick off ATA set up */ |
445 |
+- return ata_pci_bmdma_init_one(dev, ppi, &hpt36x_sht, hpriv, 0); |
446 |
++ return ata_pci_bmdma_init_one(dev, ppi, &hpt36x_sht, (void *)hpriv, 0); |
447 |
+ } |
448 |
+ |
449 |
+ #ifdef CONFIG_PM_SLEEP |
450 |
+diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c |
451 |
+index 4217f29a85e0..816087b68ec4 100644 |
452 |
+--- a/drivers/atm/iphase.c |
453 |
++++ b/drivers/atm/iphase.c |
454 |
+@@ -1175,7 +1175,7 @@ static int rx_pkt(struct atm_dev *dev) |
455 |
+ if (!(skb = atm_alloc_charge(vcc, len, GFP_ATOMIC))) { |
456 |
+ if (vcc->vci < 32) |
457 |
+ printk("Drop control packets\n"); |
458 |
+- goto out_free_desc; |
459 |
++ goto out_free_desc; |
460 |
+ } |
461 |
+ skb_put(skb,len); |
462 |
+ // pwang_test |
463 |
+diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c |
464 |
+index 2ce3dfd7e6b9..876d0c3eaf58 100644 |
465 |
+--- a/drivers/block/paride/pg.c |
466 |
++++ b/drivers/block/paride/pg.c |
467 |
+@@ -137,7 +137,7 @@ |
468 |
+ |
469 |
+ */ |
470 |
+ |
471 |
+-static bool verbose = 0; |
472 |
++static int verbose; |
473 |
+ static int major = PG_MAJOR; |
474 |
+ static char *name = PG_NAME; |
475 |
+ static int disable = 0; |
476 |
+@@ -168,7 +168,7 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_SLV, D_DLY}; |
477 |
+ |
478 |
+ #include <asm/uaccess.h> |
479 |
+ |
480 |
+-module_param(verbose, bool, 0644); |
481 |
++module_param(verbose, int, 0644); |
482 |
+ module_param(major, int, 0); |
483 |
+ module_param(name, charp, 0); |
484 |
+ module_param_array(drive0, int, NULL, 0); |
485 |
+diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c |
486 |
+index 063b44817e08..ccc17703014e 100644 |
487 |
+--- a/drivers/gpu/drm/i915/i915_debugfs.c |
488 |
++++ b/drivers/gpu/drm/i915/i915_debugfs.c |
489 |
+@@ -141,10 +141,11 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj) |
490 |
+ obj->madv == I915_MADV_DONTNEED ? " purgeable" : ""); |
491 |
+ if (obj->base.name) |
492 |
+ seq_printf(m, " (name: %d)", obj->base.name); |
493 |
+- list_for_each_entry(vma, &obj->vma_list, vma_link) |
494 |
++ list_for_each_entry(vma, &obj->vma_list, vma_link) { |
495 |
+ if (vma->pin_count > 0) |
496 |
+ pin_count++; |
497 |
+- seq_printf(m, " (pinned x %d)", pin_count); |
498 |
++ } |
499 |
++ seq_printf(m, " (pinned x %d)", pin_count); |
500 |
+ if (obj->pin_display) |
501 |
+ seq_printf(m, " (display)"); |
502 |
+ if (obj->fence_reg != I915_FENCE_REG_NONE) |
503 |
+diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c |
504 |
+index 01c7a08a66e1..53d325968e42 100644 |
505 |
+--- a/drivers/hid/hid-input.c |
506 |
++++ b/drivers/hid/hid-input.c |
507 |
+@@ -1122,7 +1122,7 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct |
508 |
+ return; |
509 |
+ |
510 |
+ /* report the usage code as scancode if the key status has changed */ |
511 |
+- if (usage->type == EV_KEY && !!test_bit(usage->code, input->key) != value) |
512 |
++ if (usage->type == EV_KEY && (!!test_bit(usage->code, input->key)) != value) |
513 |
+ input_event(input, EV_MSC, MSC_SCAN, usage->hid); |
514 |
+ |
515 |
+ input_event(input, usage->type, usage->code, value); |
516 |
+diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c |
517 |
+index 4f81b4c9d113..df33e720d664 100644 |
518 |
+--- a/drivers/media/platform/s3c-camif/camif-capture.c |
519 |
++++ b/drivers/media/platform/s3c-camif/camif-capture.c |
520 |
+@@ -115,7 +115,7 @@ static int sensor_set_power(struct camif_dev *camif, int on) |
521 |
+ struct cam_sensor *sensor = &camif->sensor; |
522 |
+ int err = 0; |
523 |
+ |
524 |
+- if (!on == camif->sensor.power_count) |
525 |
++ if (camif->sensor.power_count == !on) |
526 |
+ err = v4l2_subdev_call(sensor->sd, core, s_power, on); |
527 |
+ if (!err) |
528 |
+ sensor->power_count += on ? 1 : -1; |
529 |
+@@ -131,7 +131,7 @@ static int sensor_set_streaming(struct camif_dev *camif, int on) |
530 |
+ struct cam_sensor *sensor = &camif->sensor; |
531 |
+ int err = 0; |
532 |
+ |
533 |
+- if (!on == camif->sensor.stream_count) |
534 |
++ if (camif->sensor.stream_count == !on) |
535 |
+ err = v4l2_subdev_call(sensor->sd, video, s_stream, on); |
536 |
+ if (!err) |
537 |
+ sensor->stream_count += on ? 1 : -1; |
538 |
+diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c |
539 |
+index 1d1c4d35a1a6..1c2cc6fee351 100644 |
540 |
+--- a/drivers/media/v4l2-core/videobuf2-core.c |
541 |
++++ b/drivers/media/v4l2-core/videobuf2-core.c |
542 |
+@@ -3221,7 +3221,6 @@ EXPORT_SYMBOL_GPL(vb2_thread_start); |
543 |
+ int vb2_thread_stop(struct vb2_queue *q) |
544 |
+ { |
545 |
+ struct vb2_threadio_data *threadio = q->threadio; |
546 |
+- struct vb2_fileio_data *fileio = q->fileio; |
547 |
+ int err; |
548 |
+ |
549 |
+ if (threadio == NULL) |
550 |
+diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c |
551 |
+index 3a69b1e56908..3e3aa17ee3bd 100644 |
552 |
+--- a/drivers/mtd/mtd_blkdevs.c |
553 |
++++ b/drivers/mtd/mtd_blkdevs.c |
554 |
+@@ -97,14 +97,13 @@ static int do_blktrans_request(struct mtd_blktrans_ops *tr, |
555 |
+ if (req->cmd_flags & REQ_DISCARD) |
556 |
+ return tr->discard(dev, block, nsect); |
557 |
+ |
558 |
+- switch(rq_data_dir(req)) { |
559 |
+- case READ: |
560 |
++ if (rq_data_dir(req) == READ) { |
561 |
+ for (; nsect > 0; nsect--, block++, buf += tr->blksize) |
562 |
+ if (tr->readsect(dev, block, buf)) |
563 |
+ return -EIO; |
564 |
+ rq_flush_dcache_pages(req); |
565 |
+ return 0; |
566 |
+- case WRITE: |
567 |
++ } else { |
568 |
+ if (!tr->writesect) |
569 |
+ return -EIO; |
570 |
+ |
571 |
+@@ -113,9 +112,6 @@ static int do_blktrans_request(struct mtd_blktrans_ops *tr, |
572 |
+ if (tr->writesect(dev, block, buf)) |
573 |
+ return -EIO; |
574 |
+ return 0; |
575 |
+- default: |
576 |
+- printk(KERN_NOTICE "Unknown request %u\n", rq_data_dir(req)); |
577 |
+- return -EIO; |
578 |
+ } |
579 |
+ } |
580 |
+ |
581 |
+diff --git a/drivers/net/ethernet/dec/tulip/uli526x.c b/drivers/net/ethernet/dec/tulip/uli526x.c |
582 |
+index 4061f9b22812..19063aceb25d 100644 |
583 |
+--- a/drivers/net/ethernet/dec/tulip/uli526x.c |
584 |
++++ b/drivers/net/ethernet/dec/tulip/uli526x.c |
585 |
+@@ -1115,7 +1115,7 @@ static void uli526x_timer(unsigned long data) |
586 |
+ netif_carrier_off(dev); |
587 |
+ } |
588 |
+ } |
589 |
+- db->init=0; |
590 |
++ db->init = 0; |
591 |
+ |
592 |
+ /* Timer active again */ |
593 |
+ db->timer.expires = ULI526X_TIMER_WUT; |
594 |
+diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c |
595 |
+index fdd36794c536..1f65817d4674 100644 |
596 |
+--- a/drivers/net/ethernet/emulex/benet/be_main.c |
597 |
++++ b/drivers/net/ethernet/emulex/benet/be_main.c |
598 |
+@@ -26,7 +26,6 @@ |
599 |
+ #include <net/vxlan.h> |
600 |
+ |
601 |
+ MODULE_VERSION(DRV_VER); |
602 |
+-MODULE_DEVICE_TABLE(pci, be_dev_ids); |
603 |
+ MODULE_DESCRIPTION(DRV_DESC " " DRV_VER); |
604 |
+ MODULE_AUTHOR("Emulex Corporation"); |
605 |
+ MODULE_LICENSE("GPL"); |
606 |
+diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c |
607 |
+index 7067f4b9159c..2a42ae05cb16 100644 |
608 |
+--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c |
609 |
++++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c |
610 |
+@@ -773,7 +773,7 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n, |
611 |
+ { |
612 |
+ struct i40e_tx_desc *txd; |
613 |
+ union i40e_rx_desc *rxd; |
614 |
+- struct i40e_ring ring; |
615 |
++ struct i40e_ring *ring; |
616 |
+ struct i40e_vsi *vsi; |
617 |
+ int i; |
618 |
+ |
619 |
+@@ -792,29 +792,32 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n, |
620 |
+ vsi_seid); |
621 |
+ return; |
622 |
+ } |
623 |
+- if (is_rx_ring) |
624 |
+- ring = *vsi->rx_rings[ring_id]; |
625 |
+- else |
626 |
+- ring = *vsi->tx_rings[ring_id]; |
627 |
++ |
628 |
++ ring = kmemdup(is_rx_ring |
629 |
++ ? vsi->rx_rings[ring_id] : vsi->tx_rings[ring_id], |
630 |
++ sizeof(*ring), GFP_KERNEL); |
631 |
++ if (!ring) |
632 |
++ return; |
633 |
++ |
634 |
+ if (cnt == 2) { |
635 |
+ dev_info(&pf->pdev->dev, "vsi = %02i %s ring = %02i\n", |
636 |
+ vsi_seid, is_rx_ring ? "rx" : "tx", ring_id); |
637 |
+- for (i = 0; i < ring.count; i++) { |
638 |
++ for (i = 0; i < ring->count; i++) { |
639 |
+ if (!is_rx_ring) { |
640 |
+- txd = I40E_TX_DESC(&ring, i); |
641 |
++ txd = I40E_TX_DESC(ring, i); |
642 |
+ dev_info(&pf->pdev->dev, |
643 |
+ " d[%03i] = 0x%016llx 0x%016llx\n", |
644 |
+ i, txd->buffer_addr, |
645 |
+ txd->cmd_type_offset_bsz); |
646 |
+ } else if (sizeof(union i40e_rx_desc) == |
647 |
+ sizeof(union i40e_16byte_rx_desc)) { |
648 |
+- rxd = I40E_RX_DESC(&ring, i); |
649 |
++ rxd = I40E_RX_DESC(ring, i); |
650 |
+ dev_info(&pf->pdev->dev, |
651 |
+ " d[%03i] = 0x%016llx 0x%016llx\n", |
652 |
+ i, rxd->read.pkt_addr, |
653 |
+ rxd->read.hdr_addr); |
654 |
+ } else { |
655 |
+- rxd = I40E_RX_DESC(&ring, i); |
656 |
++ rxd = I40E_RX_DESC(ring, i); |
657 |
+ dev_info(&pf->pdev->dev, |
658 |
+ " d[%03i] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n", |
659 |
+ i, rxd->read.pkt_addr, |
660 |
+@@ -823,26 +826,26 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n, |
661 |
+ } |
662 |
+ } |
663 |
+ } else if (cnt == 3) { |
664 |
+- if (desc_n >= ring.count || desc_n < 0) { |
665 |
++ if (desc_n >= ring->count || desc_n < 0) { |
666 |
+ dev_info(&pf->pdev->dev, |
667 |
+ "descriptor %d not found\n", desc_n); |
668 |
+ return; |
669 |
+ } |
670 |
+ if (!is_rx_ring) { |
671 |
+- txd = I40E_TX_DESC(&ring, desc_n); |
672 |
++ txd = I40E_TX_DESC(ring, desc_n); |
673 |
+ dev_info(&pf->pdev->dev, |
674 |
+ "vsi = %02i tx ring = %02i d[%03i] = 0x%016llx 0x%016llx\n", |
675 |
+ vsi_seid, ring_id, desc_n, |
676 |
+ txd->buffer_addr, txd->cmd_type_offset_bsz); |
677 |
+ } else if (sizeof(union i40e_rx_desc) == |
678 |
+ sizeof(union i40e_16byte_rx_desc)) { |
679 |
+- rxd = I40E_RX_DESC(&ring, desc_n); |
680 |
++ rxd = I40E_RX_DESC(ring, desc_n); |
681 |
+ dev_info(&pf->pdev->dev, |
682 |
+ "vsi = %02i rx ring = %02i d[%03i] = 0x%016llx 0x%016llx\n", |
683 |
+ vsi_seid, ring_id, desc_n, |
684 |
+ rxd->read.pkt_addr, rxd->read.hdr_addr); |
685 |
+ } else { |
686 |
+- rxd = I40E_RX_DESC(&ring, desc_n); |
687 |
++ rxd = I40E_RX_DESC(ring, desc_n); |
688 |
+ dev_info(&pf->pdev->dev, |
689 |
+ "vsi = %02i rx ring = %02i d[%03i] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n", |
690 |
+ vsi_seid, ring_id, desc_n, |
691 |
+@@ -852,6 +855,7 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n, |
692 |
+ } else { |
693 |
+ dev_info(&pf->pdev->dev, "dump desc rx/tx <vsi_seid> <ring_id> [<desc_n>]\n"); |
694 |
+ } |
695 |
++ kfree(ring); |
696 |
+ } |
697 |
+ |
698 |
+ /** |
699 |
+diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c |
700 |
+index 93bdf684babe..ae047ab7a4df 100644 |
701 |
+--- a/drivers/net/wireless/iwlegacy/3945.c |
702 |
++++ b/drivers/net/wireless/iwlegacy/3945.c |
703 |
+@@ -1019,12 +1019,13 @@ il3945_hw_txq_ctx_free(struct il_priv *il) |
704 |
+ int txq_id; |
705 |
+ |
706 |
+ /* Tx queues */ |
707 |
+- if (il->txq) |
708 |
++ if (il->txq) { |
709 |
+ for (txq_id = 0; txq_id < il->hw_params.max_txq_num; txq_id++) |
710 |
+ if (txq_id == IL39_CMD_QUEUE_NUM) |
711 |
+ il_cmd_queue_free(il); |
712 |
+ else |
713 |
+ il_tx_queue_free(il, txq_id); |
714 |
++ } |
715 |
+ |
716 |
+ /* free tx queue structure */ |
717 |
+ il_free_txq_mem(il); |
718 |
+diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c |
719 |
+index 3ed37dc28b3c..3e6c36cd19b9 100644 |
720 |
+--- a/drivers/scsi/be2iscsi/be_main.c |
721 |
++++ b/drivers/scsi/be2iscsi/be_main.c |
722 |
+@@ -48,7 +48,6 @@ static unsigned int be_iopoll_budget = 10; |
723 |
+ static unsigned int be_max_phys_size = 64; |
724 |
+ static unsigned int enable_msix = 1; |
725 |
+ |
726 |
+-MODULE_DEVICE_TABLE(pci, beiscsi_pci_id_table); |
727 |
+ MODULE_DESCRIPTION(DRV_DESC " " BUILD_STR); |
728 |
+ MODULE_VERSION(BUILD_STR); |
729 |
+ MODULE_AUTHOR("Emulex Corporation"); |
730 |
+@@ -3166,7 +3165,7 @@ be_sgl_create_contiguous(void *virtual_address, |
731 |
+ { |
732 |
+ WARN_ON(!virtual_address); |
733 |
+ WARN_ON(!physical_address); |
734 |
+- WARN_ON(!length > 0); |
735 |
++ WARN_ON(!length); |
736 |
+ WARN_ON(!sgl); |
737 |
+ |
738 |
+ sgl->va = virtual_address; |
739 |
+diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c |
740 |
+index 315d6d6dcfc8..4e7104461f09 100644 |
741 |
+--- a/drivers/scsi/bfa/bfa_ioc.c |
742 |
++++ b/drivers/scsi/bfa/bfa_ioc.c |
743 |
+@@ -3665,19 +3665,19 @@ bfa_cb_sfp_state_query(struct bfa_sfp_s *sfp) |
744 |
+ if (sfp->state_query_cbfn) |
745 |
+ sfp->state_query_cbfn(sfp->state_query_cbarg, |
746 |
+ sfp->status); |
747 |
+- sfp->media = NULL; |
748 |
+- } |
749 |
++ sfp->media = NULL; |
750 |
++ } |
751 |
+ |
752 |
+- if (sfp->portspeed) { |
753 |
+- sfp->status = bfa_sfp_speed_valid(sfp, sfp->portspeed); |
754 |
+- if (sfp->state_query_cbfn) |
755 |
+- sfp->state_query_cbfn(sfp->state_query_cbarg, |
756 |
+- sfp->status); |
757 |
+- sfp->portspeed = BFA_PORT_SPEED_UNKNOWN; |
758 |
+- } |
759 |
++ if (sfp->portspeed) { |
760 |
++ sfp->status = bfa_sfp_speed_valid(sfp, sfp->portspeed); |
761 |
++ if (sfp->state_query_cbfn) |
762 |
++ sfp->state_query_cbfn(sfp->state_query_cbarg, |
763 |
++ sfp->status); |
764 |
++ sfp->portspeed = BFA_PORT_SPEED_UNKNOWN; |
765 |
++ } |
766 |
+ |
767 |
+- sfp->state_query_lock = 0; |
768 |
+- sfp->state_query_cbfn = NULL; |
769 |
++ sfp->state_query_lock = 0; |
770 |
++ sfp->state_query_cbfn = NULL; |
771 |
+ } |
772 |
+ |
773 |
+ /* |
774 |
+diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c |
775 |
+index 9f296dfeeb7f..1c965e0325af 100644 |
776 |
+--- a/drivers/scsi/qla2xxx/qla_target.c |
777 |
++++ b/drivers/scsi/qla2xxx/qla_target.c |
778 |
+@@ -3075,11 +3075,10 @@ void qlt_abort_cmd(struct qla_tgt_cmd *cmd) |
779 |
+ { |
780 |
+ struct qla_tgt *tgt = cmd->tgt; |
781 |
+ struct scsi_qla_host *vha = tgt->vha; |
782 |
+- struct se_cmd *se_cmd = &cmd->se_cmd; |
783 |
+ |
784 |
+ ql_dbg(ql_dbg_tgt_mgt, vha, 0xf014, |
785 |
+ "qla_target(%d): terminating exchange for aborted cmd=%p " |
786 |
+- "(se_cmd=%p, tag=%llu)", vha->vp_idx, cmd, &cmd->se_cmd, |
787 |
++ "(se_cmd=%p, tag=%d)", vha->vp_idx, cmd, &cmd->se_cmd, |
788 |
+ cmd->tag); |
789 |
+ |
790 |
+ cmd->state = QLA_TGT_STATE_ABORTED; |
791 |
+diff --git a/drivers/spi/spi-dw-mid.c b/drivers/spi/spi-dw-mid.c |
792 |
+index 1417f96546ce..fc37844ac16e 100644 |
793 |
+--- a/drivers/spi/spi-dw-mid.c |
794 |
++++ b/drivers/spi/spi-dw-mid.c |
795 |
+@@ -111,28 +111,11 @@ static void dw_spi_dma_done(void *arg) |
796 |
+ dw_spi_xfer_done(dws); |
797 |
+ } |
798 |
+ |
799 |
+-static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change) |
800 |
++static struct dma_async_tx_descriptor *dw_spi_dma_prepare_tx(struct dw_spi *dws) |
801 |
+ { |
802 |
+- struct dma_async_tx_descriptor *txdesc, *rxdesc; |
803 |
+- struct dma_slave_config txconf, rxconf; |
804 |
+- u16 dma_ctrl = 0; |
805 |
+- |
806 |
+- /* 1. setup DMA related registers */ |
807 |
+- if (cs_change) { |
808 |
+- spi_enable_chip(dws, 0); |
809 |
+- dw_writew(dws, DW_SPI_DMARDLR, 0xf); |
810 |
+- dw_writew(dws, DW_SPI_DMATDLR, 0x10); |
811 |
+- if (dws->tx_dma) |
812 |
+- dma_ctrl |= SPI_DMA_TDMAE; |
813 |
+- if (dws->rx_dma) |
814 |
+- dma_ctrl |= SPI_DMA_RDMAE; |
815 |
+- dw_writew(dws, DW_SPI_DMACR, dma_ctrl); |
816 |
+- spi_enable_chip(dws, 1); |
817 |
+- } |
818 |
++ struct dma_slave_config txconf; |
819 |
++ struct dma_async_tx_descriptor *txdesc; |
820 |
+ |
821 |
+- dws->dma_chan_done = 0; |
822 |
+- |
823 |
+- /* 2. Prepare the TX dma transfer */ |
824 |
+ txconf.direction = DMA_MEM_TO_DEV; |
825 |
+ txconf.dst_addr = dws->dma_addr; |
826 |
+ txconf.dst_maxburst = LNW_DMA_MSIZE_16; |
827 |
+@@ -157,7 +140,14 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change) |
828 |
+ txdesc->callback = dw_spi_dma_done; |
829 |
+ txdesc->callback_param = dws; |
830 |
+ |
831 |
+- /* 3. Prepare the RX dma transfer */ |
832 |
++ return txdesc; |
833 |
++} |
834 |
++ |
835 |
++static struct dma_async_tx_descriptor *dw_spi_dma_prepare_rx(struct dw_spi *dws) |
836 |
++{ |
837 |
++ struct dma_slave_config rxconf; |
838 |
++ struct dma_async_tx_descriptor *rxdesc; |
839 |
++ |
840 |
+ rxconf.direction = DMA_DEV_TO_MEM; |
841 |
+ rxconf.src_addr = dws->dma_addr; |
842 |
+ rxconf.src_maxburst = LNW_DMA_MSIZE_16; |
843 |
+@@ -182,6 +172,43 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change) |
844 |
+ rxdesc->callback = dw_spi_dma_done; |
845 |
+ rxdesc->callback_param = dws; |
846 |
+ |
847 |
++ return rxdesc; |
848 |
++} |
849 |
++ |
850 |
++static void dw_spi_dma_setup(struct dw_spi *dws) |
851 |
++{ |
852 |
++ u16 dma_ctrl = 0; |
853 |
++ |
854 |
++ spi_enable_chip(dws, 0); |
855 |
++ |
856 |
++ dw_writew(dws, DW_SPI_DMARDLR, 0xf); |
857 |
++ dw_writew(dws, DW_SPI_DMATDLR, 0x10); |
858 |
++ |
859 |
++ if (dws->tx_dma) |
860 |
++ dma_ctrl |= SPI_DMA_TDMAE; |
861 |
++ if (dws->rx_dma) |
862 |
++ dma_ctrl |= SPI_DMA_RDMAE; |
863 |
++ dw_writew(dws, DW_SPI_DMACR, dma_ctrl); |
864 |
++ |
865 |
++ spi_enable_chip(dws, 1); |
866 |
++} |
867 |
++ |
868 |
++static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change) |
869 |
++{ |
870 |
++ struct dma_async_tx_descriptor *txdesc, *rxdesc; |
871 |
++ |
872 |
++ /* 1. setup DMA related registers */ |
873 |
++ if (cs_change) |
874 |
++ dw_spi_dma_setup(dws); |
875 |
++ |
876 |
++ dws->dma_chan_done = 0; |
877 |
++ |
878 |
++ /* 2. Prepare the TX dma transfer */ |
879 |
++ txdesc = dw_spi_dma_prepare_tx(dws); |
880 |
++ |
881 |
++ /* 3. Prepare the RX dma transfer */ |
882 |
++ rxdesc = dw_spi_dma_prepare_rx(dws); |
883 |
++ |
884 |
+ /* rx must be started before tx due to spi instinct */ |
885 |
+ dmaengine_submit(rxdesc); |
886 |
+ dma_async_issue_pending(dws->rxchan); |
887 |
+diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c |
888 |
+index c110a255d4e8..8343a780f63d 100644 |
889 |
+--- a/drivers/staging/iio/adc/ad7192.c |
890 |
++++ b/drivers/staging/iio/adc/ad7192.c |
891 |
+@@ -236,7 +236,7 @@ static int ad7192_setup(struct ad7192_state *st, |
892 |
+ st->mclk = pdata->ext_clk_Hz; |
893 |
+ else |
894 |
+ st->mclk = AD7192_INT_FREQ_MHz; |
895 |
+- break; |
896 |
++ break; |
897 |
+ default: |
898 |
+ ret = -EINVAL; |
899 |
+ goto out; |
900 |
+diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c |
901 |
+index f4ca7b753021..500af356a033 100644 |
902 |
+--- a/drivers/staging/lustre/lustre/llite/llite_lib.c |
903 |
++++ b/drivers/staging/lustre/lustre/llite/llite_lib.c |
904 |
+@@ -1504,7 +1504,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import) |
905 |
+ |
906 |
+ if (attr->ia_valid & (ATTR_SIZE | |
907 |
+ ATTR_ATIME | ATTR_ATIME_SET | |
908 |
+- ATTR_MTIME | ATTR_MTIME_SET)) |
909 |
++ ATTR_MTIME | ATTR_MTIME_SET)) { |
910 |
+ /* For truncate and utimes sending attributes to OSTs, setting |
911 |
+ * mtime/atime to the past will be performed under PW [0:EOF] |
912 |
+ * extent lock (new_size:EOF for truncate). It may seem |
913 |
+@@ -1516,6 +1516,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import) |
914 |
+ rc = ll_setattr_ost(inode, attr); |
915 |
+ if (attr->ia_valid & ATTR_SIZE) |
916 |
+ up_write(&lli->lli_trunc_sem); |
917 |
++ } |
918 |
+ out: |
919 |
+ if (op_data) { |
920 |
+ if (op_data->op_ioepoch) { |
921 |
+diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c b/drivers/staging/rtl8723au/core/rtw_wlan_util.c |
922 |
+index 09c44a55d4a6..34f0de6abac6 100644 |
923 |
+--- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c |
924 |
++++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c |
925 |
+@@ -525,7 +525,7 @@ void WMMOnAssocRsp23a(struct rtw_adapter *padapter) |
926 |
+ else |
927 |
+ aSifsTime = 16; |
928 |
+ |
929 |
+- for (i = 0; i < 4; i++) { |
930 |
++ for (i = 0; i < 4; i++) { |
931 |
+ ACI = (pmlmeinfo->WMM_param.ac_param[i].ACI_AIFSN >> 5) & 0x03; |
932 |
+ ACM = (pmlmeinfo->WMM_param.ac_param[i].ACI_AIFSN >> 4) & 0x01; |
933 |
+ |
934 |
+diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c |
935 |
+index ed27e1687a4e..da289786d597 100644 |
936 |
+--- a/drivers/usb/gadget/udc/udc-xilinx.c |
937 |
++++ b/drivers/usb/gadget/udc/udc-xilinx.c |
938 |
+@@ -2132,8 +2132,8 @@ static int xudc_probe(struct platform_device *pdev) |
939 |
+ |
940 |
+ platform_set_drvdata(pdev, udc); |
941 |
+ |
942 |
+- dev_vdbg(&pdev->dev, "%s at 0x%08X mapped to 0x%08X %s\n", |
943 |
+- driver_name, (u32)res->start, (u32 __force)udc->addr, |
944 |
++ dev_vdbg(&pdev->dev, "%s at 0x%08X mapped to %p %s\n", |
945 |
++ driver_name, (u32)res->start, udc->addr, |
946 |
+ udc->dma_enabled ? "with DMA" : "without DMA"); |
947 |
+ |
948 |
+ return 0; |
949 |
+diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c |
950 |
+index b3b6813ab270..d51f47892386 100644 |
951 |
+--- a/drivers/usb/renesas_usbhs/common.c |
952 |
++++ b/drivers/usb/renesas_usbhs/common.c |
953 |
+@@ -466,7 +466,7 @@ static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device *dev) |
954 |
+ return NULL; |
955 |
+ |
956 |
+ dparam = &info->driver_param; |
957 |
+- dparam->type = of_id ? (u32)of_id->data : 0; |
958 |
++ dparam->type = of_id ? (uintptr_t)of_id->data : 0; |
959 |
+ if (!of_property_read_u32(dev->of_node, "renesas,buswait", &tmp)) |
960 |
+ dparam->buswait_bwait = tmp; |
961 |
+ gpio = of_get_named_gpio_flags(dev->of_node, "renesas,enable-gpio", 0, |
962 |
+diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h |
963 |
+index aac0f9ea952a..d94f4d0145a4 100644 |
964 |
+--- a/include/linux/blkdev.h |
965 |
++++ b/include/linux/blkdev.h |
966 |
+@@ -616,7 +616,7 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q) |
967 |
+ |
968 |
+ #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) |
969 |
+ |
970 |
+-#define rq_data_dir(rq) (((rq)->cmd_flags & 1) != 0) |
971 |
++#define rq_data_dir(rq) ((int)((rq)->cmd_flags & 1)) |
972 |
+ |
973 |
+ /* |
974 |
+ * Driver can handle struct request, if it either has an old style |
975 |
+diff --git a/include/linux/module.h b/include/linux/module.h |
976 |
+index 18edb9660da0..6fc269ce701c 100644 |
977 |
+--- a/include/linux/module.h |
978 |
++++ b/include/linux/module.h |
979 |
+@@ -135,7 +135,7 @@ void trim_init_extable(struct module *m); |
980 |
+ #ifdef MODULE |
981 |
+ /* Creates an alias so file2alias.c can find device table. */ |
982 |
+ #define MODULE_DEVICE_TABLE(type, name) \ |
983 |
+- extern const struct type##_device_id __mod_##type##__##name##_device_table \ |
984 |
++extern const typeof(name) __mod_##type##__##name##_device_table \ |
985 |
+ __attribute__ ((unused, alias(__stringify(name)))) |
986 |
+ #else /* !MODULE */ |
987 |
+ #define MODULE_DEVICE_TABLE(type, name) |
988 |
+diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h |
989 |
+index 3b57c6712495..2ff757f2d3a3 100644 |
990 |
+--- a/include/linux/skbuff.h |
991 |
++++ b/include/linux/skbuff.h |
992 |
+@@ -188,6 +188,7 @@ struct sk_buff; |
993 |
+ #else |
994 |
+ #define MAX_SKB_FRAGS (65536/PAGE_SIZE + 1) |
995 |
+ #endif |
996 |
++extern int sysctl_max_skb_frags; |
997 |
+ |
998 |
+ typedef struct skb_frag_struct skb_frag_t; |
999 |
+ |
1000 |
+diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h |
1001 |
+index d5952bb66752..c1209d5b8531 100644 |
1002 |
+--- a/include/linux/usb/renesas_usbhs.h |
1003 |
++++ b/include/linux/usb/renesas_usbhs.h |
1004 |
+@@ -153,7 +153,7 @@ struct renesas_usbhs_driver_param { |
1005 |
+ */ |
1006 |
+ int pio_dma_border; /* default is 64byte */ |
1007 |
+ |
1008 |
+- u32 type; |
1009 |
++ uintptr_t type; |
1010 |
+ u32 enable_gpio; |
1011 |
+ |
1012 |
+ /* |
1013 |
+diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c |
1014 |
+index 115f149362ba..1fbc1aadb450 100644 |
1015 |
+--- a/net/bluetooth/hci_sock.c |
1016 |
++++ b/net/bluetooth/hci_sock.c |
1017 |
+@@ -46,9 +46,9 @@ struct hci_pinfo { |
1018 |
+ unsigned short channel; |
1019 |
+ }; |
1020 |
+ |
1021 |
+-static inline int hci_test_bit(int nr, void *addr) |
1022 |
++static inline int hci_test_bit(int nr, const void *addr) |
1023 |
+ { |
1024 |
+- return *((__u32 *) addr + (nr >> 5)) & ((__u32) 1 << (nr & 31)); |
1025 |
++ return *((const __u32 *) addr + (nr >> 5)) & ((__u32) 1 << (nr & 31)); |
1026 |
+ } |
1027 |
+ |
1028 |
+ /* Security filter */ |
1029 |
+diff --git a/net/bridge/netfilter/nft_reject_bridge.c b/net/bridge/netfilter/nft_reject_bridge.c |
1030 |
+index 48da2c54a69e..6a10b88f3371 100644 |
1031 |
+--- a/net/bridge/netfilter/nft_reject_bridge.c |
1032 |
++++ b/net/bridge/netfilter/nft_reject_bridge.c |
1033 |
+@@ -375,6 +375,8 @@ static int nft_reject_bridge_dump(struct sk_buff *skb, |
1034 |
+ if (nla_put_u8(skb, NFTA_REJECT_ICMP_CODE, priv->icmp_code)) |
1035 |
+ goto nla_put_failure; |
1036 |
+ break; |
1037 |
++ default: |
1038 |
++ break; |
1039 |
+ } |
1040 |
+ |
1041 |
+ return 0; |
1042 |
+diff --git a/net/caif/cfpkt_skbuff.c b/net/caif/cfpkt_skbuff.c |
1043 |
+index 1be0b521ac49..5add8e75759d 100644 |
1044 |
+--- a/net/caif/cfpkt_skbuff.c |
1045 |
++++ b/net/caif/cfpkt_skbuff.c |
1046 |
+@@ -286,7 +286,7 @@ int cfpkt_setlen(struct cfpkt *pkt, u16 len) |
1047 |
+ else |
1048 |
+ skb_trim(skb, len); |
1049 |
+ |
1050 |
+- return cfpkt_getlen(pkt); |
1051 |
++ return cfpkt_getlen(pkt); |
1052 |
+ } |
1053 |
+ |
1054 |
+ /* Need to expand SKB */ |
1055 |
+diff --git a/net/core/skbuff.c b/net/core/skbuff.c |
1056 |
+index b2921c0d5608..97549212e9e3 100644 |
1057 |
+--- a/net/core/skbuff.c |
1058 |
++++ b/net/core/skbuff.c |
1059 |
+@@ -77,6 +77,8 @@ |
1060 |
+ |
1061 |
+ struct kmem_cache *skbuff_head_cache __read_mostly; |
1062 |
+ static struct kmem_cache *skbuff_fclone_cache __read_mostly; |
1063 |
++int sysctl_max_skb_frags __read_mostly = MAX_SKB_FRAGS; |
1064 |
++EXPORT_SYMBOL(sysctl_max_skb_frags); |
1065 |
+ |
1066 |
+ /** |
1067 |
+ * skb_panic - private function for out-of-line support |
1068 |
+diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c |
1069 |
+index e731c96eac4b..cd386d2fd039 100644 |
1070 |
+--- a/net/core/sysctl_net_core.c |
1071 |
++++ b/net/core/sysctl_net_core.c |
1072 |
+@@ -27,6 +27,7 @@ static int one = 1; |
1073 |
+ static int ushort_max = USHRT_MAX; |
1074 |
+ static int min_sndbuf = SOCK_MIN_SNDBUF; |
1075 |
+ static int min_rcvbuf = SOCK_MIN_RCVBUF; |
1076 |
++static int max_skb_frags = MAX_SKB_FRAGS; |
1077 |
+ |
1078 |
+ #ifdef CONFIG_RPS |
1079 |
+ static int rps_sock_flow_sysctl(struct ctl_table *table, int write, |
1080 |
+@@ -363,6 +364,15 @@ static struct ctl_table net_core_table[] = { |
1081 |
+ .mode = 0644, |
1082 |
+ .proc_handler = proc_dointvec |
1083 |
+ }, |
1084 |
++ { |
1085 |
++ .procname = "max_skb_frags", |
1086 |
++ .data = &sysctl_max_skb_frags, |
1087 |
++ .maxlen = sizeof(int), |
1088 |
++ .mode = 0644, |
1089 |
++ .proc_handler = proc_dointvec_minmax, |
1090 |
++ .extra1 = &one, |
1091 |
++ .extra2 = &max_skb_frags, |
1092 |
++ }, |
1093 |
+ { } |
1094 |
+ }; |
1095 |
+ |
1096 |
+diff --git a/net/ipv4/netfilter/nft_reject_ipv4.c b/net/ipv4/netfilter/nft_reject_ipv4.c |
1097 |
+index ed33299c56d1..95fe37c72b32 100644 |
1098 |
+--- a/net/ipv4/netfilter/nft_reject_ipv4.c |
1099 |
++++ b/net/ipv4/netfilter/nft_reject_ipv4.c |
1100 |
+@@ -32,6 +32,8 @@ void nft_reject_ipv4_eval(const struct nft_expr *expr, |
1101 |
+ case NFT_REJECT_TCP_RST: |
1102 |
+ nf_send_reset(pkt->skb, pkt->ops->hooknum); |
1103 |
+ break; |
1104 |
++ default: |
1105 |
++ break; |
1106 |
+ } |
1107 |
+ |
1108 |
+ data[NFT_REG_VERDICT].verdict = NF_DROP; |
1109 |
+diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c |
1110 |
+index 32b25cc96fff..a21c47289765 100644 |
1111 |
+--- a/net/ipv4/tcp.c |
1112 |
++++ b/net/ipv4/tcp.c |
1113 |
+@@ -939,7 +939,7 @@ new_segment: |
1114 |
+ |
1115 |
+ i = skb_shinfo(skb)->nr_frags; |
1116 |
+ can_coalesce = skb_can_coalesce(skb, i, page, offset); |
1117 |
+- if (!can_coalesce && i >= MAX_SKB_FRAGS) { |
1118 |
++ if (!can_coalesce && i >= sysctl_max_skb_frags) { |
1119 |
+ tcp_mark_push(tp, skb); |
1120 |
+ goto new_segment; |
1121 |
+ } |
1122 |
+@@ -1225,7 +1225,7 @@ new_segment: |
1123 |
+ |
1124 |
+ if (!skb_can_coalesce(skb, i, pfrag->page, |
1125 |
+ pfrag->offset)) { |
1126 |
+- if (i == MAX_SKB_FRAGS || !sg) { |
1127 |
++ if (i == sysctl_max_skb_frags || !sg) { |
1128 |
+ tcp_mark_push(tp, skb); |
1129 |
+ goto new_segment; |
1130 |
+ } |
1131 |
+diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c |
1132 |
+index f291813c7c0c..219b9d24b3b3 100644 |
1133 |
+--- a/net/ipv6/ip6_offload.c |
1134 |
++++ b/net/ipv6/ip6_offload.c |
1135 |
+@@ -305,7 +305,7 @@ static struct packet_offload ipv6_packet_offload __read_mostly = { |
1136 |
+ static const struct net_offload sit_offload = { |
1137 |
+ .callbacks = { |
1138 |
+ .gso_segment = ipv6_gso_segment, |
1139 |
+- .gro_receive = ipv6_gro_receive, |
1140 |
++ .gro_receive = sit_gro_receive, |
1141 |
+ .gro_complete = ipv6_gro_complete, |
1142 |
+ }, |
1143 |
+ }; |
1144 |
+diff --git a/net/ipv6/netfilter/nft_reject_ipv6.c b/net/ipv6/netfilter/nft_reject_ipv6.c |
1145 |
+index 0bc19fa87821..367bd4841a0c 100644 |
1146 |
+--- a/net/ipv6/netfilter/nft_reject_ipv6.c |
1147 |
++++ b/net/ipv6/netfilter/nft_reject_ipv6.c |
1148 |
+@@ -34,6 +34,8 @@ void nft_reject_ipv6_eval(const struct nft_expr *expr, |
1149 |
+ case NFT_REJECT_TCP_RST: |
1150 |
+ nf_send_reset6(net, pkt->skb, pkt->ops->hooknum); |
1151 |
+ break; |
1152 |
++ default: |
1153 |
++ break; |
1154 |
+ } |
1155 |
+ |
1156 |
+ data[NFT_REG_VERDICT].verdict = NF_DROP; |
1157 |
+diff --git a/net/netfilter/nft_compat.c b/net/netfilter/nft_compat.c |
1158 |
+index ff6f35971ea2..ab24224bfa66 100644 |
1159 |
+--- a/net/netfilter/nft_compat.c |
1160 |
++++ b/net/netfilter/nft_compat.c |
1161 |
+@@ -277,11 +277,11 @@ static void nft_match_eval(const struct nft_expr *expr, |
1162 |
+ return; |
1163 |
+ } |
1164 |
+ |
1165 |
+- switch(ret) { |
1166 |
+- case true: |
1167 |
++ switch (ret ? 1 : 0) { |
1168 |
++ case 1: |
1169 |
+ data[NFT_REG_VERDICT].verdict = NFT_CONTINUE; |
1170 |
+ break; |
1171 |
+- case false: |
1172 |
++ case 0: |
1173 |
+ data[NFT_REG_VERDICT].verdict = NFT_BREAK; |
1174 |
+ break; |
1175 |
+ } |
1176 |
+diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c |
1177 |
+index cc5603016242..18d520e0ca0a 100644 |
1178 |
+--- a/net/netfilter/nft_ct.c |
1179 |
++++ b/net/netfilter/nft_ct.c |
1180 |
+@@ -56,6 +56,8 @@ static void nft_ct_get_eval(const struct nft_expr *expr, |
1181 |
+ state = NF_CT_STATE_BIT(ctinfo); |
1182 |
+ dest->data[0] = state; |
1183 |
+ return; |
1184 |
++ default: |
1185 |
++ break; |
1186 |
+ } |
1187 |
+ |
1188 |
+ if (ct == NULL) |
1189 |
+@@ -117,6 +119,8 @@ static void nft_ct_get_eval(const struct nft_expr *expr, |
1190 |
+ return; |
1191 |
+ } |
1192 |
+ #endif |
1193 |
++ default: |
1194 |
++ break; |
1195 |
+ } |
1196 |
+ |
1197 |
+ tuple = &ct->tuplehash[priv->dir].tuple; |
1198 |
+@@ -141,6 +145,8 @@ static void nft_ct_get_eval(const struct nft_expr *expr, |
1199 |
+ case NFT_CT_PROTO_DST: |
1200 |
+ dest->data[0] = (__force __u16)tuple->dst.u.all; |
1201 |
+ return; |
1202 |
++ default: |
1203 |
++ break; |
1204 |
+ } |
1205 |
+ return; |
1206 |
+ err: |
1207 |
+@@ -172,6 +178,8 @@ static void nft_ct_set_eval(const struct nft_expr *expr, |
1208 |
+ } |
1209 |
+ break; |
1210 |
+ #endif |
1211 |
++ default: |
1212 |
++ break; |
1213 |
+ } |
1214 |
+ } |
1215 |
+ |
1216 |
+diff --git a/net/netfilter/nft_reject.c b/net/netfilter/nft_reject.c |
1217 |
+index 57d3e1af5630..0522fc9bfb0a 100644 |
1218 |
+--- a/net/netfilter/nft_reject.c |
1219 |
++++ b/net/netfilter/nft_reject.c |
1220 |
+@@ -63,6 +63,8 @@ int nft_reject_dump(struct sk_buff *skb, const struct nft_expr *expr) |
1221 |
+ if (nla_put_u8(skb, NFTA_REJECT_ICMP_CODE, priv->icmp_code)) |
1222 |
+ goto nla_put_failure; |
1223 |
+ break; |
1224 |
++ default: |
1225 |
++ break; |
1226 |
+ } |
1227 |
+ |
1228 |
+ return 0; |
1229 |
+diff --git a/net/netfilter/nft_reject_inet.c b/net/netfilter/nft_reject_inet.c |
1230 |
+index 7b5f9d58680a..1fb065a77474 100644 |
1231 |
+--- a/net/netfilter/nft_reject_inet.c |
1232 |
++++ b/net/netfilter/nft_reject_inet.c |
1233 |
+@@ -105,6 +105,8 @@ static int nft_reject_inet_dump(struct sk_buff *skb, |
1234 |
+ if (nla_put_u8(skb, NFTA_REJECT_ICMP_CODE, priv->icmp_code)) |
1235 |
+ goto nla_put_failure; |
1236 |
+ break; |
1237 |
++ default: |
1238 |
++ break; |
1239 |
+ } |
1240 |
+ |
1241 |
+ return 0; |
1242 |
+diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c |
1243 |
+index 5988e044c519..259bf54a9df0 100644 |
1244 |
+--- a/sound/pci/oxygen/oxygen_mixer.c |
1245 |
++++ b/sound/pci/oxygen/oxygen_mixer.c |
1246 |
+@@ -88,7 +88,7 @@ static int dac_mute_put(struct snd_kcontrol *ctl, |
1247 |
+ int changed; |
1248 |
+ |
1249 |
+ mutex_lock(&chip->mutex); |
1250 |
+- changed = !value->value.integer.value[0] != chip->dac_mute; |
1251 |
++ changed = (!value->value.integer.value[0]) != chip->dac_mute; |
1252 |
+ if (changed) { |
1253 |
+ chip->dac_mute = !value->value.integer.value[0]; |
1254 |
+ chip->model.update_dac_mute(chip); |