Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-patchset:master commit in: 3.2.50/, 3.10.10/
Date: Mon, 02 Sep 2013 19:48:49
Message-Id: 1378151327.98b1920aad8533f1ac0f456c6926373b18773709.blueness@gentoo
1 commit: 98b1920aad8533f1ac0f456c6926373b18773709
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 2 19:46:29 2013 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 2 19:48:47 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-patchset.git;a=commit;h=98b1920a
7
8 Grsec/PaX: 2.9.1-{3.2.50.3.10.10}-201309011630
9
10 ---
11 3.10.10/0000_README | 2 +-
12 ...20_grsecurity-2.9.1-3.10.10-201309011630.patch} | 1476 +++++++++++++++++++-
13 3.2.50/0000_README | 2 +-
14 ...420_grsecurity-2.9.1-3.2.50-201309011629.patch} | 974 ++++++++++++-
15 4 files changed, 2378 insertions(+), 76 deletions(-)
16
17 diff --git a/3.10.10/0000_README b/3.10.10/0000_README
18 index bd3df03..a09b757 100644
19 --- a/3.10.10/0000_README
20 +++ b/3.10.10/0000_README
21 @@ -2,7 +2,7 @@ README
22 -----------------------------------------------------------------------------
23 Individual Patch Descriptions:
24 -----------------------------------------------------------------------------
25 -Patch: 4420_grsecurity-2.9.1-3.10.10-201308301923.patch
26 +Patch: 4420_grsecurity-2.9.1-3.10.10-201309011630.patch
27 From: http://www.grsecurity.net
28 Desc: hardened-sources base patch from upstream grsecurity
29
30
31 diff --git a/3.10.10/4420_grsecurity-2.9.1-3.10.10-201308301923.patch b/3.10.10/4420_grsecurity-2.9.1-3.10.10-201309011630.patch
32 similarity index 98%
33 rename from 3.10.10/4420_grsecurity-2.9.1-3.10.10-201308301923.patch
34 rename to 3.10.10/4420_grsecurity-2.9.1-3.10.10-201309011630.patch
35 index cd96025..54e5089 100644
36 --- a/3.10.10/4420_grsecurity-2.9.1-3.10.10-201308301923.patch
37 +++ b/3.10.10/4420_grsecurity-2.9.1-3.10.10-201309011630.patch
38 @@ -3271,6 +3271,46 @@ index 33f2ea3..0b91824 100644
39 . = ALIGN(THREAD_SIZE);
40 __data_loc = .;
41 #endif
42 +diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
43 +index ef1703b..46b77f3 100644
44 +--- a/arch/arm/kvm/arm.c
45 ++++ b/arch/arm/kvm/arm.c
46 +@@ -56,7 +56,7 @@ static unsigned long hyp_default_vectors;
47 + static DEFINE_PER_CPU(struct kvm_vcpu *, kvm_arm_running_vcpu);
48 +
49 + /* The VMID used in the VTTBR */
50 +-static atomic64_t kvm_vmid_gen = ATOMIC64_INIT(1);
51 ++static atomic64_unchecked_t kvm_vmid_gen = ATOMIC64_INIT(1);
52 + static u8 kvm_next_vmid;
53 + static DEFINE_SPINLOCK(kvm_vmid_lock);
54 +
55 +@@ -392,7 +392,7 @@ void force_vm_exit(const cpumask_t *mask)
56 + */
57 + static bool need_new_vmid_gen(struct kvm *kvm)
58 + {
59 +- return unlikely(kvm->arch.vmid_gen != atomic64_read(&kvm_vmid_gen));
60 ++ return unlikely(kvm->arch.vmid_gen != atomic64_read_unchecked(&kvm_vmid_gen));
61 + }
62 +
63 + /**
64 +@@ -425,7 +425,7 @@ static void update_vttbr(struct kvm *kvm)
65 +
66 + /* First user of a new VMID generation? */
67 + if (unlikely(kvm_next_vmid == 0)) {
68 +- atomic64_inc(&kvm_vmid_gen);
69 ++ atomic64_inc_unchecked(&kvm_vmid_gen);
70 + kvm_next_vmid = 1;
71 +
72 + /*
73 +@@ -442,7 +442,7 @@ static void update_vttbr(struct kvm *kvm)
74 + kvm_call_hyp(__kvm_flush_vm_context);
75 + }
76 +
77 +- kvm->arch.vmid_gen = atomic64_read(&kvm_vmid_gen);
78 ++ kvm->arch.vmid_gen = atomic64_read_unchecked(&kvm_vmid_gen);
79 + kvm->arch.vmid = kvm_next_vmid;
80 + kvm_next_vmid++;
81 +
82 diff --git a/arch/arm/lib/clear_user.S b/arch/arm/lib/clear_user.S
83 index 14a0d98..7771a7d 100644
84 --- a/arch/arm/lib/clear_user.S
85 @@ -3734,6 +3774,54 @@ index 6f4585b..7b6f52b 100644
86 if (err) \
87 goto fault; \
88 } while (0)
89 +diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c
90 +index eeab06e..2638dc2 100644
91 +--- a/arch/arm/mm/context.c
92 ++++ b/arch/arm/mm/context.c
93 +@@ -42,7 +42,7 @@
94 + #define NUM_USER_ASIDS ASID_FIRST_VERSION
95 +
96 + static DEFINE_RAW_SPINLOCK(cpu_asid_lock);
97 +-static atomic64_t asid_generation = ATOMIC64_INIT(ASID_FIRST_VERSION);
98 ++static atomic64_unchecked_t asid_generation = ATOMIC64_INIT(ASID_FIRST_VERSION);
99 + static DECLARE_BITMAP(asid_map, NUM_USER_ASIDS);
100 +
101 + static DEFINE_PER_CPU(atomic64_t, active_asids);
102 +@@ -188,7 +188,7 @@ static int is_reserved_asid(u64 asid)
103 + static u64 new_context(struct mm_struct *mm, unsigned int cpu)
104 + {
105 + u64 asid = atomic64_read(&mm->context.id);
106 +- u64 generation = atomic64_read(&asid_generation);
107 ++ u64 generation = atomic64_read_unchecked(&asid_generation);
108 +
109 + if (asid != 0 && is_reserved_asid(asid)) {
110 + /*
111 +@@ -206,7 +206,7 @@ static u64 new_context(struct mm_struct *mm, unsigned int cpu)
112 + */
113 + asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, 1);
114 + if (asid == NUM_USER_ASIDS) {
115 +- generation = atomic64_add_return(ASID_FIRST_VERSION,
116 ++ generation = atomic64_add_return_unchecked(ASID_FIRST_VERSION,
117 + &asid_generation);
118 + flush_context(cpu);
119 + asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, 1);
120 +@@ -235,14 +235,14 @@ void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk)
121 + cpu_set_reserved_ttbr0();
122 +
123 + asid = atomic64_read(&mm->context.id);
124 +- if (!((asid ^ atomic64_read(&asid_generation)) >> ASID_BITS)
125 ++ if (!((asid ^ atomic64_read_unchecked(&asid_generation)) >> ASID_BITS)
126 + && atomic64_xchg(&per_cpu(active_asids, cpu), asid))
127 + goto switch_mm_fastpath;
128 +
129 + raw_spin_lock_irqsave(&cpu_asid_lock, flags);
130 + /* Check that our ASID belongs to the current generation. */
131 + asid = atomic64_read(&mm->context.id);
132 +- if ((asid ^ atomic64_read(&asid_generation)) >> ASID_BITS) {
133 ++ if ((asid ^ atomic64_read_unchecked(&asid_generation)) >> ASID_BITS) {
134 + asid = new_context(mm, cpu);
135 + atomic64_set(&mm->context.id, asid);
136 + }
137 diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
138 index 5dbf13f..a2d1876 100644
139 --- a/arch/arm/mm/fault.c
140 @@ -6496,6 +6584,31 @@ index 202e581..689ca79 100644
141 #include <asm/processor.h>
142
143 /*
144 +diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
145 +index d1fea7a..45602ea 100644
146 +--- a/arch/mips/kernel/irq.c
147 ++++ b/arch/mips/kernel/irq.c
148 +@@ -77,17 +77,17 @@ void ack_bad_irq(unsigned int irq)
149 + printk("unexpected IRQ # %d\n", irq);
150 + }
151 +
152 +-atomic_t irq_err_count;
153 ++atomic_unchecked_t irq_err_count;
154 +
155 + int arch_show_interrupts(struct seq_file *p, int prec)
156 + {
157 +- seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
158 ++ seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read_unchecked(&irq_err_count));
159 + return 0;
160 + }
161 +
162 + asmlinkage void spurious_interrupt(void)
163 + {
164 +- atomic_inc(&irq_err_count);
165 ++ atomic_inc_unchecked(&irq_err_count);
166 + }
167 +
168 + void __init init_IRQ(void)
169 diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
170 index c6a041d..b3e7318 100644
171 --- a/arch/mips/kernel/process.c
172 @@ -6595,6 +6708,75 @@ index 74f485d..47d2c38 100644
173 LONG_L t0, TI_FLAGS($28) # syscall tracing enabled?
174 and t0, t1, t0
175 bnez t0, trace_a_syscall
176 +diff --git a/arch/mips/kernel/sync-r4k.c b/arch/mips/kernel/sync-r4k.c
177 +index 1ff43d5..96fec68 100644
178 +--- a/arch/mips/kernel/sync-r4k.c
179 ++++ b/arch/mips/kernel/sync-r4k.c
180 +@@ -21,8 +21,8 @@
181 + #include <asm/mipsregs.h>
182 +
183 + static atomic_t __cpuinitdata count_start_flag = ATOMIC_INIT(0);
184 +-static atomic_t __cpuinitdata count_count_start = ATOMIC_INIT(0);
185 +-static atomic_t __cpuinitdata count_count_stop = ATOMIC_INIT(0);
186 ++static atomic_unchecked_t __cpuinitdata count_count_start = ATOMIC_INIT(0);
187 ++static atomic_unchecked_t __cpuinitdata count_count_stop = ATOMIC_INIT(0);
188 + static atomic_t __cpuinitdata count_reference = ATOMIC_INIT(0);
189 +
190 + #define COUNTON 100
191 +@@ -69,13 +69,13 @@ void __cpuinit synchronise_count_master(int cpu)
192 +
193 + for (i = 0; i < NR_LOOPS; i++) {
194 + /* slaves loop on '!= 2' */
195 +- while (atomic_read(&count_count_start) != 1)
196 ++ while (atomic_read_unchecked(&count_count_start) != 1)
197 + mb();
198 +- atomic_set(&count_count_stop, 0);
199 ++ atomic_set_unchecked(&count_count_stop, 0);
200 + smp_wmb();
201 +
202 + /* this lets the slaves write their count register */
203 +- atomic_inc(&count_count_start);
204 ++ atomic_inc_unchecked(&count_count_start);
205 +
206 + /*
207 + * Everyone initialises count in the last loop:
208 +@@ -86,11 +86,11 @@ void __cpuinit synchronise_count_master(int cpu)
209 + /*
210 + * Wait for all slaves to leave the synchronization point:
211 + */
212 +- while (atomic_read(&count_count_stop) != 1)
213 ++ while (atomic_read_unchecked(&count_count_stop) != 1)
214 + mb();
215 +- atomic_set(&count_count_start, 0);
216 ++ atomic_set_unchecked(&count_count_start, 0);
217 + smp_wmb();
218 +- atomic_inc(&count_count_stop);
219 ++ atomic_inc_unchecked(&count_count_stop);
220 + }
221 + /* Arrange for an interrupt in a short while */
222 + write_c0_compare(read_c0_count() + COUNTON);
223 +@@ -131,8 +131,8 @@ void __cpuinit synchronise_count_slave(int cpu)
224 + initcount = atomic_read(&count_reference);
225 +
226 + for (i = 0; i < NR_LOOPS; i++) {
227 +- atomic_inc(&count_count_start);
228 +- while (atomic_read(&count_count_start) != 2)
229 ++ atomic_inc_unchecked(&count_count_start);
230 ++ while (atomic_read_unchecked(&count_count_start) != 2)
231 + mb();
232 +
233 + /*
234 +@@ -141,8 +141,8 @@ void __cpuinit synchronise_count_slave(int cpu)
235 + if (i == NR_LOOPS-1)
236 + write_c0_count(initcount);
237 +
238 +- atomic_inc(&count_count_stop);
239 +- while (atomic_read(&count_count_stop) != 2)
240 ++ atomic_inc_unchecked(&count_count_stop);
241 ++ while (atomic_read_unchecked(&count_count_stop) != 2)
242 + mb();
243 + }
244 + /* Arrange for an interrupt in a short while */
245 diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
246 index a75ae40..0d0f56a 100644
247 --- a/arch/mips/kernel/traps.c
248 @@ -6768,6 +6950,31 @@ index 7e5fe27..9656513 100644
249 int __virt_addr_valid(const volatile void *kaddr)
250 {
251 return pfn_valid(PFN_DOWN(virt_to_phys(kaddr)));
252 +diff --git a/arch/mips/sgi-ip27/ip27-nmi.c b/arch/mips/sgi-ip27/ip27-nmi.c
253 +index a2358b4..7cead4f 100644
254 +--- a/arch/mips/sgi-ip27/ip27-nmi.c
255 ++++ b/arch/mips/sgi-ip27/ip27-nmi.c
256 +@@ -187,9 +187,9 @@ void
257 + cont_nmi_dump(void)
258 + {
259 + #ifndef REAL_NMI_SIGNAL
260 +- static atomic_t nmied_cpus = ATOMIC_INIT(0);
261 ++ static atomic_unchecked_t nmied_cpus = ATOMIC_INIT(0);
262 +
263 +- atomic_inc(&nmied_cpus);
264 ++ atomic_inc_unchecked(&nmied_cpus);
265 + #endif
266 + /*
267 + * Only allow 1 cpu to proceed
268 +@@ -233,7 +233,7 @@ cont_nmi_dump(void)
269 + udelay(10000);
270 + }
271 + #else
272 +- while (atomic_read(&nmied_cpus) != num_online_cpus());
273 ++ while (atomic_read_unchecked(&nmied_cpus) != num_online_cpus());
274 + #endif
275 +
276 + /*
277 diff --git a/arch/mn10300/proc-mn103e010/include/proc/cache.h b/arch/mn10300/proc-mn103e010/include/proc/cache.h
278 index 967d144..db12197 100644
279 --- a/arch/mn10300/proc-mn103e010/include/proc/cache.h
280 @@ -9535,6 +9742,57 @@ index 7ff45e4..a58f271 100644
281 audit_syscall_exit(regs);
282
283 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
284 +diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
285 +index 77539ed..3ffffe7 100644
286 +--- a/arch/sparc/kernel/smp_64.c
287 ++++ b/arch/sparc/kernel/smp_64.c
288 +@@ -868,8 +868,8 @@ extern unsigned long xcall_flush_dcache_page_cheetah;
289 + extern unsigned long xcall_flush_dcache_page_spitfire;
290 +
291 + #ifdef CONFIG_DEBUG_DCFLUSH
292 +-extern atomic_t dcpage_flushes;
293 +-extern atomic_t dcpage_flushes_xcall;
294 ++extern atomic_unchecked_t dcpage_flushes;
295 ++extern atomic_unchecked_t dcpage_flushes_xcall;
296 + #endif
297 +
298 + static inline void __local_flush_dcache_page(struct page *page)
299 +@@ -893,7 +893,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
300 + return;
301 +
302 + #ifdef CONFIG_DEBUG_DCFLUSH
303 +- atomic_inc(&dcpage_flushes);
304 ++ atomic_inc_unchecked(&dcpage_flushes);
305 + #endif
306 +
307 + this_cpu = get_cpu();
308 +@@ -917,7 +917,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
309 + xcall_deliver(data0, __pa(pg_addr),
310 + (u64) pg_addr, cpumask_of(cpu));
311 + #ifdef CONFIG_DEBUG_DCFLUSH
312 +- atomic_inc(&dcpage_flushes_xcall);
313 ++ atomic_inc_unchecked(&dcpage_flushes_xcall);
314 + #endif
315 + }
316 + }
317 +@@ -936,7 +936,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
318 + preempt_disable();
319 +
320 + #ifdef CONFIG_DEBUG_DCFLUSH
321 +- atomic_inc(&dcpage_flushes);
322 ++ atomic_inc_unchecked(&dcpage_flushes);
323 + #endif
324 + data0 = 0;
325 + pg_addr = page_address(page);
326 +@@ -953,7 +953,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
327 + xcall_deliver(data0, __pa(pg_addr),
328 + (u64) pg_addr, cpu_online_mask);
329 + #ifdef CONFIG_DEBUG_DCFLUSH
330 +- atomic_inc(&dcpage_flushes_xcall);
331 ++ atomic_inc_unchecked(&dcpage_flushes_xcall);
332 + #endif
333 + }
334 + __local_flush_dcache_page(page);
335 diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c
336 index 3a8d184..49498a8 100644
337 --- a/arch/sparc/kernel/sys_sparc_32.c
338 @@ -9808,7 +10066,7 @@ index 6629829..036032d 100644
339 }
340
341 diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
342 -index b3f833a..ac74b2d 100644
343 +index b3f833a..f485f80 100644
344 --- a/arch/sparc/kernel/traps_64.c
345 +++ b/arch/sparc/kernel/traps_64.c
346 @@ -76,7 +76,7 @@ static void dump_tl1_traplog(struct tl1_traplog *p)
347 @@ -9878,6 +10136,55 @@ index b3f833a..ac74b2d 100644
348 }
349
350 struct sun4v_error_entry {
351 +@@ -1830,8 +1841,8 @@ struct sun4v_error_entry {
352 + /*0x38*/u64 reserved_5;
353 + };
354 +
355 +-static atomic_t sun4v_resum_oflow_cnt = ATOMIC_INIT(0);
356 +-static atomic_t sun4v_nonresum_oflow_cnt = ATOMIC_INIT(0);
357 ++static atomic_unchecked_t sun4v_resum_oflow_cnt = ATOMIC_INIT(0);
358 ++static atomic_unchecked_t sun4v_nonresum_oflow_cnt = ATOMIC_INIT(0);
359 +
360 + static const char *sun4v_err_type_to_str(u8 type)
361 + {
362 +@@ -1923,7 +1934,7 @@ static void sun4v_report_real_raddr(const char *pfx, struct pt_regs *regs)
363 + }
364 +
365 + static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,
366 +- int cpu, const char *pfx, atomic_t *ocnt)
367 ++ int cpu, const char *pfx, atomic_unchecked_t *ocnt)
368 + {
369 + u64 *raw_ptr = (u64 *) ent;
370 + u32 attrs;
371 +@@ -1981,8 +1992,8 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,
372 +
373 + show_regs(regs);
374 +
375 +- if ((cnt = atomic_read(ocnt)) != 0) {
376 +- atomic_set(ocnt, 0);
377 ++ if ((cnt = atomic_read_unchecked(ocnt)) != 0) {
378 ++ atomic_set_unchecked(ocnt, 0);
379 + wmb();
380 + printk("%s: Queue overflowed %d times.\n",
381 + pfx, cnt);
382 +@@ -2036,7 +2047,7 @@ void sun4v_resum_error(struct pt_regs *regs, unsigned long offset)
383 + */
384 + void sun4v_resum_overflow(struct pt_regs *regs)
385 + {
386 +- atomic_inc(&sun4v_resum_oflow_cnt);
387 ++ atomic_inc_unchecked(&sun4v_resum_oflow_cnt);
388 + }
389 +
390 + /* We run with %pil set to PIL_NORMAL_MAX and PSTATE_IE enabled in %pstate.
391 +@@ -2089,7 +2100,7 @@ void sun4v_nonresum_overflow(struct pt_regs *regs)
392 + /* XXX Actually even this can make not that much sense. Perhaps
393 + * XXX we should just pull the plug and panic directly from here?
394 + */
395 +- atomic_inc(&sun4v_nonresum_oflow_cnt);
396 ++ atomic_inc_unchecked(&sun4v_nonresum_oflow_cnt);
397 + }
398 +
399 + unsigned long sun4v_err_itlb_vaddr;
400 @@ -2104,9 +2115,9 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl)
401
402 printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n",
403 @@ -11165,6 +11472,44 @@ index d2b5944..d878f3c 100644
404 }
405
406 pte_t *huge_pte_alloc(struct mm_struct *mm,
407 +diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
408 +index 04fd55a..4ede686 100644
409 +--- a/arch/sparc/mm/init_64.c
410 ++++ b/arch/sparc/mm/init_64.c
411 +@@ -188,9 +188,9 @@ unsigned long sparc64_kern_sec_context __read_mostly;
412 + int num_kernel_image_mappings;
413 +
414 + #ifdef CONFIG_DEBUG_DCFLUSH
415 +-atomic_t dcpage_flushes = ATOMIC_INIT(0);
416 ++atomic_unchecked_t dcpage_flushes = ATOMIC_INIT(0);
417 + #ifdef CONFIG_SMP
418 +-atomic_t dcpage_flushes_xcall = ATOMIC_INIT(0);
419 ++atomic_unchecked_t dcpage_flushes_xcall = ATOMIC_INIT(0);
420 + #endif
421 + #endif
422 +
423 +@@ -198,7 +198,7 @@ inline void flush_dcache_page_impl(struct page *page)
424 + {
425 + BUG_ON(tlb_type == hypervisor);
426 + #ifdef CONFIG_DEBUG_DCFLUSH
427 +- atomic_inc(&dcpage_flushes);
428 ++ atomic_inc_unchecked(&dcpage_flushes);
429 + #endif
430 +
431 + #ifdef DCACHE_ALIASING_POSSIBLE
432 +@@ -466,10 +466,10 @@ void mmu_info(struct seq_file *m)
433 +
434 + #ifdef CONFIG_DEBUG_DCFLUSH
435 + seq_printf(m, "DCPageFlushes\t: %d\n",
436 +- atomic_read(&dcpage_flushes));
437 ++ atomic_read_unchecked(&dcpage_flushes));
438 + #ifdef CONFIG_SMP
439 + seq_printf(m, "DCPageFlushesXC\t: %d\n",
440 +- atomic_read(&dcpage_flushes_xcall));
441 ++ atomic_read_unchecked(&dcpage_flushes_xcall));
442 + #endif /* CONFIG_SMP */
443 + #endif /* CONFIG_DEBUG_DCFLUSH */
444 + }
445 diff --git a/arch/tile/include/asm/atomic_64.h b/arch/tile/include/asm/atomic_64.h
446 index f4500c6..889656c 100644
447 --- a/arch/tile/include/asm/atomic_64.h
448 @@ -34359,6 +34704,28 @@ index af00795..2bb8105 100644
449
450 #define XCHAL_ICACHE_SIZE 32768 /* I-cache size in bytes or 0 */
451 #define XCHAL_DCACHE_SIZE 32768 /* D-cache size in bytes or 0 */
452 +diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
453 +index e8918ff..b3ffc51 100644
454 +--- a/block/blk-cgroup.c
455 ++++ b/block/blk-cgroup.c
456 +@@ -825,7 +825,7 @@ static void blkcg_css_free(struct cgroup *cgroup)
457 +
458 + static struct cgroup_subsys_state *blkcg_css_alloc(struct cgroup *cgroup)
459 + {
460 +- static atomic64_t id_seq = ATOMIC64_INIT(0);
461 ++ static atomic64_unchecked_t id_seq = ATOMIC64_INIT(0);
462 + struct blkcg *blkcg;
463 + struct cgroup *parent = cgroup->parent;
464 +
465 +@@ -840,7 +840,7 @@ static struct cgroup_subsys_state *blkcg_css_alloc(struct cgroup *cgroup)
466 +
467 + blkcg->cfq_weight = CFQ_WEIGHT_DEFAULT;
468 + blkcg->cfq_leaf_weight = CFQ_WEIGHT_DEFAULT;
469 +- blkcg->id = atomic64_inc_return(&id_seq); /* root is 0, start from 1 */
470 ++ blkcg->id = atomic64_inc_return_unchecked(&id_seq); /* root is 0, start from 1 */
471 + done:
472 + spin_lock_init(&blkcg->lock);
473 + INIT_RADIX_TREE(&blkcg->blkg_tree, GFP_ATOMIC);
474 diff --git a/block/blk-iopoll.c b/block/blk-iopoll.c
475 index 58916af..eb9dbcf6 100644
476 --- a/block/blk-iopoll.c
477 @@ -34652,6 +35019,28 @@ index 33dc6a0..4b24b47 100644
478 }
479 EXPORT_SYMBOL_GPL(cper_next_record_id);
480
481 +diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
482 +index fcd7d91..6b2f1a3 100644
483 +--- a/drivers/acpi/apei/ghes.c
484 ++++ b/drivers/acpi/apei/ghes.c
485 +@@ -468,7 +468,7 @@ static void __ghes_print_estatus(const char *pfx,
486 + const struct acpi_hest_generic *generic,
487 + const struct acpi_hest_generic_status *estatus)
488 + {
489 +- static atomic_t seqno;
490 ++ static atomic_unchecked_t seqno;
491 + unsigned int curr_seqno;
492 + char pfx_seq[64];
493 +
494 +@@ -479,7 +479,7 @@ static void __ghes_print_estatus(const char *pfx,
495 + else
496 + pfx = KERN_ERR;
497 + }
498 +- curr_seqno = atomic_inc_return(&seqno);
499 ++ curr_seqno = atomic_inc_return_unchecked(&seqno);
500 + snprintf(pfx_seq, sizeof(pfx_seq), "%s{%u}" HW_ERR, pfx, curr_seqno);
501 + printk("%s""Hardware error from APEI Generic Hardware Error Source: %d\n",
502 + pfx_seq, generic->header.source_id);
503 diff --git a/drivers/acpi/bgrt.c b/drivers/acpi/bgrt.c
504 index be60399..778b33e8 100644
505 --- a/drivers/acpi/bgrt.c
506 @@ -34789,9 +35178,18 @@ index 7b9bdd8..37638ca 100644
507 unsigned long timeout_msec)
508 {
509 diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
510 -index adf002a..39bb8f9 100644
511 +index adf002a..06c46a7 100644
512 --- a/drivers/ata/libata-core.c
513 +++ b/drivers/ata/libata-core.c
514 +@@ -98,7 +98,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev);
515 + static void ata_dev_xfermask(struct ata_device *dev);
516 + static unsigned long ata_dev_blacklisted(const struct ata_device *dev);
517 +
518 +-atomic_t ata_print_id = ATOMIC_INIT(0);
519 ++atomic_unchecked_t ata_print_id = ATOMIC_INIT(0);
520 +
521 + struct ata_force_param {
522 + const char *name;
523 @@ -4792,7 +4792,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
524 struct ata_port *ap;
525 unsigned int tag;
526 @@ -34829,6 +35227,41 @@ index adf002a..39bb8f9 100644
527 spin_unlock(&lock);
528 }
529
530 +@@ -6133,7 +6135,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
531 +
532 + /* give ports names and add SCSI hosts */
533 + for (i = 0; i < host->n_ports; i++)
534 +- host->ports[i]->print_id = atomic_inc_return(&ata_print_id);
535 ++ host->ports[i]->print_id = atomic_inc_return_unchecked(&ata_print_id);
536 +
537 +
538 + /* Create associated sysfs transport objects */
539 +diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
540 +index 0101af5..c70c325 100644
541 +--- a/drivers/ata/libata-scsi.c
542 ++++ b/drivers/ata/libata-scsi.c
543 +@@ -4105,7 +4105,7 @@ int ata_sas_port_init(struct ata_port *ap)
544 +
545 + if (rc)
546 + return rc;
547 +- ap->print_id = atomic_inc_return(&ata_print_id);
548 ++ ap->print_id = atomic_inc_return_unchecked(&ata_print_id);
549 + return 0;
550 + }
551 + EXPORT_SYMBOL_GPL(ata_sas_port_init);
552 +diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
553 +index 577d902b..cb4781e 100644
554 +--- a/drivers/ata/libata.h
555 ++++ b/drivers/ata/libata.h
556 +@@ -53,7 +53,7 @@ enum {
557 + ATA_DNXFER_QUIET = (1 << 31),
558 + };
559 +
560 +-extern atomic_t ata_print_id;
561 ++extern atomic_unchecked_t ata_print_id;
562 + extern int atapi_passthru16;
563 + extern int libata_fua;
564 + extern int libata_noacpi;
565 diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
566 index 7638121..357a965 100644
567 --- a/drivers/ata/pata_arasan_cf.c
568 @@ -36357,6 +36790,28 @@ index a5dca6a..bb27967 100644
569 kfree(tconn->current_epoch);
570
571 idr_destroy(&tconn->volumes);
572 +diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
573 +index 9e3f441..4044d47 100644
574 +--- a/drivers/block/drbd/drbd_nl.c
575 ++++ b/drivers/block/drbd/drbd_nl.c
576 +@@ -3339,7 +3339,7 @@ out:
577 +
578 + void drbd_bcast_event(struct drbd_conf *mdev, const struct sib_info *sib)
579 + {
580 +- static atomic_t drbd_genl_seq = ATOMIC_INIT(2); /* two. */
581 ++ static atomic_unchecked_t drbd_genl_seq = ATOMIC_INIT(2); /* two. */
582 + struct sk_buff *msg;
583 + struct drbd_genlmsghdr *d_out;
584 + unsigned seq;
585 +@@ -3352,7 +3352,7 @@ void drbd_bcast_event(struct drbd_conf *mdev, const struct sib_info *sib)
586 + return;
587 + }
588 +
589 +- seq = atomic_inc_return(&drbd_genl_seq);
590 ++ seq = atomic_inc_return_unchecked(&drbd_genl_seq);
591 + msg = genlmsg_new(NLMSG_GOODSIZE, GFP_NOIO);
592 + if (!msg)
593 + goto failed;
594 diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
595 index 4222aff..1f79506 100644
596 --- a/drivers/block/drbd/drbd_receiver.c
597 @@ -37596,6 +38051,28 @@ index 428754a..8bdf9cc 100644
598 .attrs = cpuidle_default_attrs,
599 .name = "cpuidle",
600 };
601 +diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
602 +index ebf130e..e32d8a9 100644
603 +--- a/drivers/crypto/hifn_795x.c
604 ++++ b/drivers/crypto/hifn_795x.c
605 +@@ -51,7 +51,7 @@ module_param_string(hifn_pll_ref, hifn_pll_ref, sizeof(hifn_pll_ref), 0444);
606 + MODULE_PARM_DESC(hifn_pll_ref,
607 + "PLL reference clock (pci[freq] or ext[freq], default ext)");
608 +
609 +-static atomic_t hifn_dev_number;
610 ++static atomic_unchecked_t hifn_dev_number;
611 +
612 + #define ACRYPTO_OP_DECRYPT 0
613 + #define ACRYPTO_OP_ENCRYPT 1
614 +@@ -2577,7 +2577,7 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id)
615 + goto err_out_disable_pci_device;
616 +
617 + snprintf(name, sizeof(name), "hifn%d",
618 +- atomic_inc_return(&hifn_dev_number)-1);
619 ++ atomic_inc_return_unchecked(&hifn_dev_number)-1);
620 +
621 + err = pci_request_regions(pdev, name);
622 + if (err)
623 diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
624 index 3b36797..db0b0c0 100644
625 --- a/drivers/devfreq/devfreq.c
626 @@ -37640,6 +38117,22 @@ index b70709b..1d8d02a 100644
627 .notifier_call = sh_dmae_nmi_handler,
628
629 /* Run before NMI debug handler and KGDB */
630 +diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
631 +index 211021d..201d47f 100644
632 +--- a/drivers/edac/edac_device.c
633 ++++ b/drivers/edac/edac_device.c
634 +@@ -474,9 +474,9 @@ void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
635 + */
636 + int edac_device_alloc_index(void)
637 + {
638 +- static atomic_t device_indexes = ATOMIC_INIT(0);
639 ++ static atomic_unchecked_t device_indexes = ATOMIC_INIT(0);
640 +
641 +- return atomic_inc_return(&device_indexes) - 1;
642 ++ return atomic_inc_return_unchecked(&device_indexes) - 1;
643 + }
644 + EXPORT_SYMBOL_GPL(edac_device_alloc_index);
645 +
646 diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
647 index c4d700a..0b57abd 100644
648 --- a/drivers/edac/edac_mc_sysfs.c
649 @@ -37674,6 +38167,28 @@ index c4d700a..0b57abd 100644
650 err = device_create_file(&mci->dev,
651 &dev_attr_sdram_scrub_rate);
652 if (err) {
653 +diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
654 +index dd370f9..0281629 100644
655 +--- a/drivers/edac/edac_pci.c
656 ++++ b/drivers/edac/edac_pci.c
657 +@@ -29,7 +29,7 @@
658 +
659 + static DEFINE_MUTEX(edac_pci_ctls_mutex);
660 + static LIST_HEAD(edac_pci_list);
661 +-static atomic_t pci_indexes = ATOMIC_INIT(0);
662 ++static atomic_unchecked_t pci_indexes = ATOMIC_INIT(0);
663 +
664 + /*
665 + * edac_pci_alloc_ctl_info
666 +@@ -315,7 +315,7 @@ EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period);
667 + */
668 + int edac_pci_alloc_index(void)
669 + {
670 +- return atomic_inc_return(&pci_indexes) - 1;
671 ++ return atomic_inc_return_unchecked(&pci_indexes) - 1;
672 + }
673 + EXPORT_SYMBOL_GPL(edac_pci_alloc_index);
674 +
675 diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
676 index e8658e4..22746d6 100644
677 --- a/drivers/edac/edac_pci_sysfs.c
678 @@ -37784,9 +38299,21 @@ index 51b7e3a..aa8a3e8 100644
679 void amd_report_gart_errors(bool);
680 void amd_register_ecc_decoder(void (*f)(int, struct mce *));
681 diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
682 -index 57ea7f4..789e3c3 100644
683 +index 57ea7f4..af06b76 100644
684 --- a/drivers/firewire/core-card.c
685 +++ b/drivers/firewire/core-card.c
686 +@@ -528,9 +528,9 @@ void fw_card_initialize(struct fw_card *card,
687 + const struct fw_card_driver *driver,
688 + struct device *device)
689 + {
690 +- static atomic_t index = ATOMIC_INIT(-1);
691 ++ static atomic_unchecked_t index = ATOMIC_INIT(-1);
692 +
693 +- card->index = atomic_inc_return(&index);
694 ++ card->index = atomic_inc_return_unchecked(&index);
695 + card->driver = driver;
696 + card->device = device;
697 + card->current_tlabel = 0;
698 @@ -680,7 +680,7 @@ EXPORT_SYMBOL_GPL(fw_card_release);
699
700 void fw_core_remove_card(struct fw_card *card)
701 @@ -39996,6 +40523,91 @@ index ae49237..380d4c9 100644
702
703 __asm__ __volatile__ ("call *%8" : "=d"(hv_status_hi),
704 "=a"(hv_status_lo) : "d" (control_hi),
705 +diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
706 +index deb5c25..ed2d4fd 100644
707 +--- a/drivers/hv/hv_balloon.c
708 ++++ b/drivers/hv/hv_balloon.c
709 +@@ -464,7 +464,7 @@ MODULE_PARM_DESC(hot_add, "If set attempt memory hot_add");
710 +
711 + module_param(pressure_report_delay, uint, (S_IRUGO | S_IWUSR));
712 + MODULE_PARM_DESC(pressure_report_delay, "Delay in secs in reporting pressure");
713 +-static atomic_t trans_id = ATOMIC_INIT(0);
714 ++static atomic_unchecked_t trans_id = ATOMIC_INIT(0);
715 +
716 + static int dm_ring_size = (5 * PAGE_SIZE);
717 +
718 +@@ -825,7 +825,7 @@ static void hot_add_req(struct work_struct *dummy)
719 + memset(&resp, 0, sizeof(struct dm_hot_add_response));
720 + resp.hdr.type = DM_MEM_HOT_ADD_RESPONSE;
721 + resp.hdr.size = sizeof(struct dm_hot_add_response);
722 +- resp.hdr.trans_id = atomic_inc_return(&trans_id);
723 ++ resp.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
724 +
725 + #ifdef CONFIG_MEMORY_HOTPLUG
726 + pg_start = dm->ha_wrk.ha_page_range.finfo.start_page;
727 +@@ -960,7 +960,7 @@ static void post_status(struct hv_dynmem_device *dm)
728 + memset(&status, 0, sizeof(struct dm_status));
729 + status.hdr.type = DM_STATUS_REPORT;
730 + status.hdr.size = sizeof(struct dm_status);
731 +- status.hdr.trans_id = atomic_inc_return(&trans_id);
732 ++ status.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
733 +
734 + /*
735 + * The host expects the guest to report free memory.
736 +@@ -980,7 +980,7 @@ static void post_status(struct hv_dynmem_device *dm)
737 + * send the status. This can happen if we were interrupted
738 + * after we picked our transaction ID.
739 + */
740 +- if (status.hdr.trans_id != atomic_read(&trans_id))
741 ++ if (status.hdr.trans_id != atomic_read_unchecked(&trans_id))
742 + return;
743 +
744 + vmbus_sendpacket(dm->dev->channel, &status,
745 +@@ -1081,7 +1081,7 @@ static void balloon_up(struct work_struct *dummy)
746 + bl_resp = (struct dm_balloon_response *)send_buffer;
747 + memset(send_buffer, 0, PAGE_SIZE);
748 + bl_resp->hdr.type = DM_BALLOON_RESPONSE;
749 +- bl_resp->hdr.trans_id = atomic_inc_return(&trans_id);
750 ++ bl_resp->hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
751 + bl_resp->hdr.size = sizeof(struct dm_balloon_response);
752 + bl_resp->more_pages = 1;
753 +
754 +@@ -1152,7 +1152,7 @@ static void balloon_down(struct hv_dynmem_device *dm,
755 +
756 + memset(&resp, 0, sizeof(struct dm_unballoon_response));
757 + resp.hdr.type = DM_UNBALLOON_RESPONSE;
758 +- resp.hdr.trans_id = atomic_inc_return(&trans_id);
759 ++ resp.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
760 + resp.hdr.size = sizeof(struct dm_unballoon_response);
761 +
762 + vmbus_sendpacket(dm_device.dev->channel, &resp,
763 +@@ -1215,7 +1215,7 @@ static void version_resp(struct hv_dynmem_device *dm,
764 + memset(&version_req, 0, sizeof(struct dm_version_request));
765 + version_req.hdr.type = DM_VERSION_REQUEST;
766 + version_req.hdr.size = sizeof(struct dm_version_request);
767 +- version_req.hdr.trans_id = atomic_inc_return(&trans_id);
768 ++ version_req.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
769 + version_req.version.version = DYNMEM_PROTOCOL_VERSION_WIN7;
770 + version_req.is_last_attempt = 1;
771 +
772 +@@ -1385,7 +1385,7 @@ static int balloon_probe(struct hv_device *dev,
773 + memset(&version_req, 0, sizeof(struct dm_version_request));
774 + version_req.hdr.type = DM_VERSION_REQUEST;
775 + version_req.hdr.size = sizeof(struct dm_version_request);
776 +- version_req.hdr.trans_id = atomic_inc_return(&trans_id);
777 ++ version_req.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
778 + version_req.version.version = DYNMEM_PROTOCOL_VERSION_WIN8;
779 + version_req.is_last_attempt = 0;
780 +
781 +@@ -1416,7 +1416,7 @@ static int balloon_probe(struct hv_device *dev,
782 + memset(&cap_msg, 0, sizeof(struct dm_capabilities));
783 + cap_msg.hdr.type = DM_CAPABILITIES_REPORT;
784 + cap_msg.hdr.size = sizeof(struct dm_capabilities);
785 +- cap_msg.hdr.trans_id = atomic_inc_return(&trans_id);
786 ++ cap_msg.hdr.trans_id = atomic_inc_return_unchecked(&trans_id);
787 +
788 + cap_msg.caps.cap_bits.balloon = 1;
789 + cap_msg.caps.cap_bits.hot_add = 1;
790 diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
791 index 12f2f9e..679603c 100644
792 --- a/drivers/hv/hyperv_vmbus.h
793 @@ -40597,6 +41209,32 @@ index 1f95bba..9530f87 100644
794 (u64) cmpxchg((u64 *) qp->r_sge.sge.vaddr,
795 sdata, wqe->wr.wr.atomic.swap);
796 goto send_comp;
797 +diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
798 +index 4d599ce..697b17f 100644
799 +--- a/drivers/infiniband/hw/mlx4/mad.c
800 ++++ b/drivers/infiniband/hw/mlx4/mad.c
801 +@@ -98,7 +98,7 @@ __be64 mlx4_ib_gen_node_guid(void)
802 +
803 + __be64 mlx4_ib_get_new_demux_tid(struct mlx4_ib_demux_ctx *ctx)
804 + {
805 +- return cpu_to_be64(atomic_inc_return(&ctx->tid)) |
806 ++ return cpu_to_be64(atomic_inc_return_unchecked(&ctx->tid)) |
807 + cpu_to_be64(0xff00000000000000LL);
808 + }
809 +
810 +diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h
811 +index f61ec26..ebf72cf 100644
812 +--- a/drivers/infiniband/hw/mlx4/mlx4_ib.h
813 ++++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h
814 +@@ -398,7 +398,7 @@ struct mlx4_ib_demux_ctx {
815 + struct list_head mcg_mgid0_list;
816 + struct workqueue_struct *mcg_wq;
817 + struct mlx4_ib_demux_pv_ctx **tun;
818 +- atomic_t tid;
819 ++ atomic_unchecked_t tid;
820 + int flushing; /* flushing the work queue */
821 + };
822 +
823 diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c
824 index 9d3e5c1..d9afe4a 100644
825 --- a/drivers/infiniband/hw/mthca/mthca_cmd.c
826 @@ -41125,6 +41763,28 @@ index fa061d4..4a6957c 100644
827
828 snprintf(led->name, sizeof(led->name), "xpad%ld", led_no);
829 led->xpad = xpad;
830 +diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c
831 +index e204f26..8459f15 100644
832 +--- a/drivers/input/misc/ims-pcu.c
833 ++++ b/drivers/input/misc/ims-pcu.c
834 +@@ -1621,7 +1621,7 @@ static int ims_pcu_identify_type(struct ims_pcu *pcu, u8 *device_id)
835 +
836 + static int ims_pcu_init_application_mode(struct ims_pcu *pcu)
837 + {
838 +- static atomic_t device_no = ATOMIC_INIT(0);
839 ++ static atomic_unchecked_t device_no = ATOMIC_INIT(0);
840 +
841 + const struct ims_pcu_device_info *info;
842 + u8 device_id;
843 +@@ -1653,7 +1653,7 @@ static int ims_pcu_init_application_mode(struct ims_pcu *pcu)
844 + }
845 +
846 + /* Device appears to be operable, complete initialization */
847 +- pcu->device_no = atomic_inc_return(&device_no) - 1;
848 ++ pcu->device_no = atomic_inc_return_unchecked(&device_no) - 1;
849 +
850 + error = ims_pcu_setup_backlight(pcu);
851 + if (error)
852 diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
853 index 2f0b39d..7370f13 100644
854 --- a/drivers/input/mouse/psmouse.h
855 @@ -41173,6 +41833,28 @@ index 25fc597..558bf3b3 100644
856 serio->dev.bus = &serio_bus;
857 serio->dev.release = serio_release_port;
858 serio->dev.groups = serio_device_attr_groups;
859 +diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
860 +index 59df2e7..8f1cafb 100644
861 +--- a/drivers/input/serio/serio_raw.c
862 ++++ b/drivers/input/serio/serio_raw.c
863 +@@ -293,7 +293,7 @@ static irqreturn_t serio_raw_interrupt(struct serio *serio, unsigned char data,
864 +
865 + static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
866 + {
867 +- static atomic_t serio_raw_no = ATOMIC_INIT(0);
868 ++ static atomic_unchecked_t serio_raw_no = ATOMIC_INIT(0);
869 + struct serio_raw *serio_raw;
870 + int err;
871 +
872 +@@ -304,7 +304,7 @@ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
873 + }
874 +
875 + snprintf(serio_raw->name, sizeof(serio_raw->name),
876 +- "serio_raw%ld", (long)atomic_inc_return(&serio_raw_no) - 1);
877 ++ "serio_raw%ld", (long)atomic_inc_return_unchecked(&serio_raw_no) - 1);
878 + kref_init(&serio_raw->kref);
879 + INIT_LIST_HEAD(&serio_raw->client_list);
880 + init_waitqueue_head(&serio_raw->wait);
881 diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
882 index d8f98b1..f62a640 100644
883 --- a/drivers/iommu/iommu.c
884 @@ -42190,6 +42872,19 @@ index c7a9be1..683f6f8 100644
885
886 module_param_array(video_nr, int, NULL, 0444);
887 module_param_array(vbi_nr, int, NULL, 0444);
888 +diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c
889 +index 07b8460..e6d7265 100644
890 +--- a/drivers/media/pci/ivtv/ivtv-driver.c
891 ++++ b/drivers/media/pci/ivtv/ivtv-driver.c
892 +@@ -84,7 +84,7 @@ static struct pci_device_id ivtv_pci_tbl[] = {
893 + MODULE_DEVICE_TABLE(pci,ivtv_pci_tbl);
894 +
895 + /* ivtv instance counter */
896 +-static atomic_t ivtv_instance = ATOMIC_INIT(0);
897 ++static atomic_unchecked_t ivtv_instance = ATOMIC_INIT(0);
898 +
899 + /* Parameter declarations */
900 + static int cardtype[IVTV_MAX_CARDS];
901 diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c
902 index d338b19..aae4f9e 100644
903 --- a/drivers/media/platform/omap/omap_vout.c
904 @@ -42400,6 +43095,80 @@ index 545c04c..a14bded 100644
905 i = -EFAULT;
906 unlock:
907 mutex_unlock(&dev->lock);
908 +diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c
909 +index bd4d3a7..ffc0b9d 100644
910 +--- a/drivers/media/radio/radio-maxiradio.c
911 ++++ b/drivers/media/radio/radio-maxiradio.c
912 +@@ -61,7 +61,7 @@ MODULE_PARM_DESC(radio_nr, "Radio device number");
913 + /* TEA5757 pin mappings */
914 + static const int clk = 1, data = 2, wren = 4, mo_st = 8, power = 16;
915 +
916 +-static atomic_t maxiradio_instance = ATOMIC_INIT(0);
917 ++static atomic_unchecked_t maxiradio_instance = ATOMIC_INIT(0);
918 +
919 + #define PCI_VENDOR_ID_GUILLEMOT 0x5046
920 + #define PCI_DEVICE_ID_GUILLEMOT_MAXIRADIO 0x1001
921 +diff --git a/drivers/media/radio/radio-shark.c b/drivers/media/radio/radio-shark.c
922 +index 8fa18ab..caee70f 100644
923 +--- a/drivers/media/radio/radio-shark.c
924 ++++ b/drivers/media/radio/radio-shark.c
925 +@@ -79,7 +79,7 @@ struct shark_device {
926 + u32 last_val;
927 + };
928 +
929 +-static atomic_t shark_instance = ATOMIC_INIT(0);
930 ++static atomic_unchecked_t shark_instance = ATOMIC_INIT(0);
931 +
932 + static void shark_write_val(struct snd_tea575x *tea, u32 val)
933 + {
934 +diff --git a/drivers/media/radio/radio-shark2.c b/drivers/media/radio/radio-shark2.c
935 +index 9fb6697..f167415 100644
936 +--- a/drivers/media/radio/radio-shark2.c
937 ++++ b/drivers/media/radio/radio-shark2.c
938 +@@ -74,7 +74,7 @@ struct shark_device {
939 + u8 *transfer_buffer;
940 + };
941 +
942 +-static atomic_t shark_instance = ATOMIC_INIT(0);
943 ++static atomic_unchecked_t shark_instance = ATOMIC_INIT(0);
944 +
945 + static int shark_write_reg(struct radio_tea5777 *tea, u64 reg)
946 + {
947 +diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c
948 +index 9dc8baf..796d52f 100644
949 +--- a/drivers/media/radio/radio-si476x.c
950 ++++ b/drivers/media/radio/radio-si476x.c
951 +@@ -1456,7 +1456,7 @@ static int si476x_radio_probe(struct platform_device *pdev)
952 + struct si476x_radio *radio;
953 + struct v4l2_ctrl *ctrl;
954 +
955 +- static atomic_t instance = ATOMIC_INIT(0);
956 ++ static atomic_unchecked_t instance = ATOMIC_INIT(0);
957 +
958 + radio = devm_kzalloc(&pdev->dev, sizeof(*radio), GFP_KERNEL);
959 + if (!radio)
960 +diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
961 +index 1cf382a..c22998c 100644
962 +--- a/drivers/media/rc/rc-main.c
963 ++++ b/drivers/media/rc/rc-main.c
964 +@@ -1030,7 +1030,7 @@ EXPORT_SYMBOL_GPL(rc_free_device);
965 + int rc_register_device(struct rc_dev *dev)
966 + {
967 + static bool raw_init = false; /* raw decoders loaded? */
968 +- static atomic_t devno = ATOMIC_INIT(0);
969 ++ static atomic_unchecked_t devno = ATOMIC_INIT(0);
970 + struct rc_map *rc_map;
971 + const char *path;
972 + int rc;
973 +@@ -1061,7 +1061,7 @@ int rc_register_device(struct rc_dev *dev)
974 + */
975 + mutex_lock(&dev->lock);
976 +
977 +- dev->devno = (unsigned long)(atomic_inc_return(&devno) - 1);
978 ++ dev->devno = (unsigned long)(atomic_inc_return_unchecked(&devno) - 1);
979 + dev_set_name(&dev->dev, "rc%ld", dev->devno);
980 + dev_set_drvdata(&dev->dev, dev);
981 + rc = device_add(&dev->dev);
982 diff --git a/drivers/media/usb/dvb-usb/cxusb.c b/drivers/media/usb/dvb-usb/cxusb.c
983 index 3940bb0..fb3952a 100644
984 --- a/drivers/media/usb/dvb-usb/cxusb.c
985 @@ -42457,6 +43226,22 @@ index f129551..ecf6514 100644
986 return -EFAULT;
987 return 0;
988 }
989 +diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c
990 +index 8ed5da2..47fee46 100644
991 +--- a/drivers/media/v4l2-core/v4l2-device.c
992 ++++ b/drivers/media/v4l2-core/v4l2-device.c
993 +@@ -74,9 +74,9 @@ int v4l2_device_put(struct v4l2_device *v4l2_dev)
994 + EXPORT_SYMBOL_GPL(v4l2_device_put);
995 +
996 + int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
997 +- atomic_t *instance)
998 ++ atomic_unchecked_t *instance)
999 + {
1000 +- int num = atomic_inc_return(instance) - 1;
1001 ++ int num = atomic_inc_return_unchecked(instance) - 1;
1002 + int len = strlen(basename);
1003 +
1004 + if (basename[len - 1] >= '0' && basename[len - 1] <= '9')
1005 diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
1006 index 7658586..1079260 100644
1007 --- a/drivers/media/v4l2-core/v4l2-ioctl.c
1008 @@ -43992,6 +44777,28 @@ index cba1d46..f703766 100644
1009 result =
1010 hso_start_serial_device(serial_table[i], GFP_NOIO);
1011 hso_kick_transmit(dev2ser(serial_table[i]));
1012 +diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
1013 +index a79e9d3..78cd4fa 100644
1014 +--- a/drivers/net/usb/sierra_net.c
1015 ++++ b/drivers/net/usb/sierra_net.c
1016 +@@ -52,7 +52,7 @@ static const char driver_name[] = "sierra_net";
1017 + /* atomic counter partially included in MAC address to make sure 2 devices
1018 + * do not end up with the same MAC - concept breaks in case of > 255 ifaces
1019 + */
1020 +-static atomic_t iface_counter = ATOMIC_INIT(0);
1021 ++static atomic_unchecked_t iface_counter = ATOMIC_INIT(0);
1022 +
1023 + /*
1024 + * SYNC Timer Delay definition used to set the expiry time
1025 +@@ -698,7 +698,7 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
1026 + dev->net->netdev_ops = &sierra_net_device_ops;
1027 +
1028 + /* change MAC addr to include, ifacenum, and to be unique */
1029 +- dev->net->dev_addr[ETH_ALEN-2] = atomic_inc_return(&iface_counter);
1030 ++ dev->net->dev_addr[ETH_ALEN-2] = atomic_inc_return_unchecked(&iface_counter);
1031 + dev->net->dev_addr[ETH_ALEN-1] = ifacenum;
1032 +
1033 + /* we will have to manufacture ethernet headers, prepare template */
1034 diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
1035 index 57325f3..36b181f 100644
1036 --- a/drivers/net/vxlan.c
1037 @@ -44914,15 +45721,22 @@ index 7d72c5e..edce02c 100644
1038 int retval = -ENOMEM;
1039
1040 diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
1041 -index 5127f3f..cc115f7 100644
1042 +index 5127f3f..b225573 100644
1043 --- a/drivers/pci/hotplug/pciehp_hpc.c
1044 +++ b/drivers/pci/hotplug/pciehp_hpc.c
1045 -@@ -780,7 +780,7 @@ static int pcie_init_slot(struct controller *ctrl)
1046 +@@ -773,14 +773,12 @@ static void pcie_shutdown_notification(struct controller *ctrl)
1047 + static int pcie_init_slot(struct controller *ctrl)
1048 + {
1049 + struct slot *slot;
1050 +- char name[32];
1051 +
1052 + slot = kzalloc(sizeof(*slot), GFP_KERNEL);
1053 + if (!slot)
1054 return -ENOMEM;
1055
1056 - snprintf(name, sizeof(name), "pciehp-%u", PSN(ctrl));
1057 +- snprintf(name, sizeof(name), "pciehp-%u", PSN(ctrl));
1058 - slot->wq = alloc_workqueue(name, 0, 0);
1059 -+ slot->wq = alloc_workqueue("%s", 0, 0, name);
1060 ++ slot->wq = alloc_workqueue("pciehp-%u", 0, 0, PSN(ctrl));
1061 if (!slot->wq)
1062 goto abort;
1063
1064 @@ -45392,6 +46206,28 @@ index 29178f7..c65f324 100644
1065 for (i = 0; i < ARRAY_SIZE(power_supply_attrs); i++)
1066 __power_supply_attrs[i] = &power_supply_attrs[i].attr;
1067 }
1068 +diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
1069 +index 815d6df..811633a 100644
1070 +--- a/drivers/regulator/core.c
1071 ++++ b/drivers/regulator/core.c
1072 +@@ -3529,7 +3529,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
1073 + {
1074 + const struct regulation_constraints *constraints = NULL;
1075 + const struct regulator_init_data *init_data;
1076 +- static atomic_t regulator_no = ATOMIC_INIT(0);
1077 ++ static atomic_unchecked_t regulator_no = ATOMIC_INIT(0);
1078 + struct regulator_dev *rdev;
1079 + struct device *dev;
1080 + int ret, i;
1081 +@@ -3599,7 +3599,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
1082 + rdev->dev.of_node = config->of_node;
1083 + rdev->dev.parent = dev;
1084 + dev_set_name(&rdev->dev, "regulator.%d",
1085 +- atomic_inc_return(&regulator_no) - 1);
1086 ++ atomic_inc_return_unchecked(&regulator_no) - 1);
1087 + ret = device_register(&rdev->dev);
1088 + if (ret != 0) {
1089 + put_device(&rdev->dev);
1090 diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c
1091 index d428ef9..fdc0357 100644
1092 --- a/drivers/regulator/max8660.c
1093 @@ -45546,6 +46382,50 @@ index 23a90e7..9cf04ee 100644
1094
1095 /*
1096 * Queue element to wait for room in request queue. FIFO order is
1097 +diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
1098 +index 8c05ae01..b2cf224 100644
1099 +--- a/drivers/scsi/fcoe/fcoe_sysfs.c
1100 ++++ b/drivers/scsi/fcoe/fcoe_sysfs.c
1101 +@@ -33,8 +33,8 @@
1102 + */
1103 + #include "libfcoe.h"
1104 +
1105 +-static atomic_t ctlr_num;
1106 +-static atomic_t fcf_num;
1107 ++static atomic_unchecked_t ctlr_num;
1108 ++static atomic_unchecked_t fcf_num;
1109 +
1110 + /*
1111 + * fcoe_fcf_dev_loss_tmo: the default number of seconds that fcoe sysfs
1112 +@@ -681,7 +681,7 @@ struct fcoe_ctlr_device *fcoe_ctlr_device_add(struct device *parent,
1113 + if (!ctlr)
1114 + goto out;
1115 +
1116 +- ctlr->id = atomic_inc_return(&ctlr_num) - 1;
1117 ++ ctlr->id = atomic_inc_return_unchecked(&ctlr_num) - 1;
1118 + ctlr->f = f;
1119 + ctlr->mode = FIP_CONN_TYPE_FABRIC;
1120 + INIT_LIST_HEAD(&ctlr->fcfs);
1121 +@@ -898,7 +898,7 @@ struct fcoe_fcf_device *fcoe_fcf_device_add(struct fcoe_ctlr_device *ctlr,
1122 + fcf->dev.parent = &ctlr->dev;
1123 + fcf->dev.bus = &fcoe_bus_type;
1124 + fcf->dev.type = &fcoe_fcf_device_type;
1125 +- fcf->id = atomic_inc_return(&fcf_num) - 1;
1126 ++ fcf->id = atomic_inc_return_unchecked(&fcf_num) - 1;
1127 + fcf->state = FCOE_FCF_STATE_UNKNOWN;
1128 +
1129 + fcf->dev_loss_tmo = ctlr->fcf_dev_loss_tmo;
1130 +@@ -934,8 +934,8 @@ int __init fcoe_sysfs_setup(void)
1131 + {
1132 + int error;
1133 +
1134 +- atomic_set(&ctlr_num, 0);
1135 +- atomic_set(&fcf_num, 0);
1136 ++ atomic_set_unchecked(&ctlr_num, 0);
1137 ++ atomic_set_unchecked(&fcf_num, 0);
1138 +
1139 + error = bus_register(&fcoe_bus_type);
1140 + if (error)
1141 diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
1142 index df0c3c7..b00e1d0 100644
1143 --- a/drivers/scsi/hosts.c
1144 @@ -46470,6 +47350,37 @@ index 32b7bb1..2f1c4bd 100644
1145
1146 static u8 *buf;
1147
1148 +diff --git a/drivers/staging/android/timed_output.c b/drivers/staging/android/timed_output.c
1149 +index ec9e2ae..cd15d67 100644
1150 +--- a/drivers/staging/android/timed_output.c
1151 ++++ b/drivers/staging/android/timed_output.c
1152 +@@ -25,7 +25,7 @@
1153 + #include "timed_output.h"
1154 +
1155 + static struct class *timed_output_class;
1156 +-static atomic_t device_count;
1157 ++static atomic_unchecked_t device_count;
1158 +
1159 + static ssize_t enable_show(struct device *dev, struct device_attribute *attr,
1160 + char *buf)
1161 +@@ -59,7 +59,7 @@ static int create_timed_output_class(void)
1162 + timed_output_class = class_create(THIS_MODULE, "timed_output");
1163 + if (IS_ERR(timed_output_class))
1164 + return PTR_ERR(timed_output_class);
1165 +- atomic_set(&device_count, 0);
1166 ++ atomic_set_unchecked(&device_count, 0);
1167 + }
1168 +
1169 + return 0;
1170 +@@ -76,7 +76,7 @@ int timed_output_dev_register(struct timed_output_dev *tdev)
1171 + if (ret < 0)
1172 + return ret;
1173 +
1174 +- tdev->index = atomic_inc_return(&device_count);
1175 ++ tdev->index = atomic_inc_return_unchecked(&device_count);
1176 + tdev->dev = device_create(timed_output_class, NULL,
1177 + MKDEV(0, tdev->index), NULL, tdev->name);
1178 + if (IS_ERR(tdev->dev))
1179 diff --git a/drivers/staging/media/solo6x10/solo6x10-core.c b/drivers/staging/media/solo6x10/solo6x10-core.c
1180 index 3675020..e80d92c 100644
1181 --- a/drivers/staging/media/solo6x10/solo6x10-core.c
1182 @@ -46483,6 +47394,32 @@ index 3675020..e80d92c 100644
1183 struct device *dev = &solo_dev->dev;
1184 const char *driver;
1185 int i;
1186 +diff --git a/drivers/staging/media/solo6x10/solo6x10-p2m.c b/drivers/staging/media/solo6x10/solo6x10-p2m.c
1187 +index 3335941..2b26186 100644
1188 +--- a/drivers/staging/media/solo6x10/solo6x10-p2m.c
1189 ++++ b/drivers/staging/media/solo6x10/solo6x10-p2m.c
1190 +@@ -77,7 +77,7 @@ int solo_p2m_dma_desc(struct solo_dev *solo_dev,
1191 +
1192 + /* Get next ID. According to Softlogic, 6110 has problems on !=0 P2M */
1193 + if (solo_dev->type != SOLO_DEV_6110 && multi_p2m) {
1194 +- p2m_id = atomic_inc_return(&solo_dev->p2m_count) % SOLO_NR_P2M;
1195 ++ p2m_id = atomic_inc_return_unchecked(&solo_dev->p2m_count) % SOLO_NR_P2M;
1196 + if (p2m_id < 0)
1197 + p2m_id = -p2m_id;
1198 + }
1199 +diff --git a/drivers/staging/media/solo6x10/solo6x10.h b/drivers/staging/media/solo6x10/solo6x10.h
1200 +index 6f91d2e..3f011d2 100644
1201 +--- a/drivers/staging/media/solo6x10/solo6x10.h
1202 ++++ b/drivers/staging/media/solo6x10/solo6x10.h
1203 +@@ -238,7 +238,7 @@ struct solo_dev {
1204 +
1205 + /* P2M DMA Engine */
1206 + struct solo_p2m_dev p2m_dev[SOLO_NR_P2M];
1207 +- atomic_t p2m_count;
1208 ++ atomic_unchecked_t p2m_count;
1209 + int p2m_jiffies;
1210 + unsigned int p2m_timeouts;
1211 +
1212 diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
1213 index 34afc16..ffe44dd 100644
1214 --- a/drivers/staging/octeon/ethernet-rx.c
1215 @@ -46700,6 +47637,28 @@ index d128ce2..fc1f9a1 100644
1216 extern void tmem_register_hostops(struct tmem_hostops *m);
1217
1218 /* core tmem accessor functions */
1219 +diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c
1220 +index d3536f5..a0c2ce9 100644
1221 +--- a/drivers/target/sbp/sbp_target.c
1222 ++++ b/drivers/target/sbp/sbp_target.c
1223 +@@ -62,7 +62,7 @@ static const u32 sbp_unit_directory_template[] = {
1224 +
1225 + #define SESSION_MAINTENANCE_INTERVAL HZ
1226 +
1227 +-static atomic_t login_id = ATOMIC_INIT(0);
1228 ++static atomic_unchecked_t login_id = ATOMIC_INIT(0);
1229 +
1230 + static void session_maintenance_work(struct work_struct *);
1231 + static int sbp_run_transaction(struct fw_card *, int, int, int, int,
1232 +@@ -444,7 +444,7 @@ static void sbp_management_request_login(
1233 + login->lun = se_lun;
1234 + login->status_fifo_addr = sbp2_pointer_to_addr(&req->orb.status_fifo);
1235 + login->exclusive = LOGIN_ORB_EXCLUSIVE(be32_to_cpu(req->orb.misc));
1236 +- login->login_id = atomic_inc_return(&login_id);
1237 ++ login->login_id = atomic_inc_return_unchecked(&login_id);
1238 +
1239 + login->tgt_agt = sbp_target_agent_register(login);
1240 + if (IS_ERR(login->tgt_agt)) {
1241 diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
1242 index 4630481..c26782a 100644
1243 --- a/drivers/target/target_core_device.c
1244 @@ -46907,6 +47866,95 @@ index 81e939e..95ead10 100644
1245 return 0;
1246
1247 return HVCS_BUFF_LEN - hvcsd->chars_in_buffer;
1248 +diff --git a/drivers/tty/hvc/hvsi.c b/drivers/tty/hvc/hvsi.c
1249 +index 4190199..48f2920 100644
1250 +--- a/drivers/tty/hvc/hvsi.c
1251 ++++ b/drivers/tty/hvc/hvsi.c
1252 +@@ -85,7 +85,7 @@ struct hvsi_struct {
1253 + int n_outbuf;
1254 + uint32_t vtermno;
1255 + uint32_t virq;
1256 +- atomic_t seqno; /* HVSI packet sequence number */
1257 ++ atomic_unchecked_t seqno; /* HVSI packet sequence number */
1258 + uint16_t mctrl;
1259 + uint8_t state; /* HVSI protocol state */
1260 + uint8_t flags;
1261 +@@ -295,7 +295,7 @@ static int hvsi_version_respond(struct hvsi_struct *hp, uint16_t query_seqno)
1262 +
1263 + packet.hdr.type = VS_QUERY_RESPONSE_PACKET_HEADER;
1264 + packet.hdr.len = sizeof(struct hvsi_query_response);
1265 +- packet.hdr.seqno = atomic_inc_return(&hp->seqno);
1266 ++ packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
1267 + packet.verb = VSV_SEND_VERSION_NUMBER;
1268 + packet.u.version = HVSI_VERSION;
1269 + packet.query_seqno = query_seqno+1;
1270 +@@ -555,7 +555,7 @@ static int hvsi_query(struct hvsi_struct *hp, uint16_t verb)
1271 +
1272 + packet.hdr.type = VS_QUERY_PACKET_HEADER;
1273 + packet.hdr.len = sizeof(struct hvsi_query);
1274 +- packet.hdr.seqno = atomic_inc_return(&hp->seqno);
1275 ++ packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
1276 + packet.verb = verb;
1277 +
1278 + pr_debug("%s: sending %i bytes\n", __func__, packet.hdr.len);
1279 +@@ -597,7 +597,7 @@ static int hvsi_set_mctrl(struct hvsi_struct *hp, uint16_t mctrl)
1280 + int wrote;
1281 +
1282 + packet.hdr.type = VS_CONTROL_PACKET_HEADER,
1283 +- packet.hdr.seqno = atomic_inc_return(&hp->seqno);
1284 ++ packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
1285 + packet.hdr.len = sizeof(struct hvsi_control);
1286 + packet.verb = VSV_SET_MODEM_CTL;
1287 + packet.mask = HVSI_TSDTR;
1288 +@@ -680,7 +680,7 @@ static int hvsi_put_chars(struct hvsi_struct *hp, const char *buf, int count)
1289 + BUG_ON(count > HVSI_MAX_OUTGOING_DATA);
1290 +
1291 + packet.hdr.type = VS_DATA_PACKET_HEADER;
1292 +- packet.hdr.seqno = atomic_inc_return(&hp->seqno);
1293 ++ packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
1294 + packet.hdr.len = count + sizeof(struct hvsi_header);
1295 + memcpy(&packet.data, buf, count);
1296 +
1297 +@@ -697,7 +697,7 @@ static void hvsi_close_protocol(struct hvsi_struct *hp)
1298 + struct hvsi_control packet __ALIGNED__;
1299 +
1300 + packet.hdr.type = VS_CONTROL_PACKET_HEADER;
1301 +- packet.hdr.seqno = atomic_inc_return(&hp->seqno);
1302 ++ packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
1303 + packet.hdr.len = 6;
1304 + packet.verb = VSV_CLOSE_PROTOCOL;
1305 +
1306 +diff --git a/drivers/tty/hvc/hvsi_lib.c b/drivers/tty/hvc/hvsi_lib.c
1307 +index 3396eb9..6d3d540 100644
1308 +--- a/drivers/tty/hvc/hvsi_lib.c
1309 ++++ b/drivers/tty/hvc/hvsi_lib.c
1310 +@@ -9,7 +9,7 @@
1311 +
1312 + static int hvsi_send_packet(struct hvsi_priv *pv, struct hvsi_header *packet)
1313 + {
1314 +- packet->seqno = atomic_inc_return(&pv->seqno);
1315 ++ packet->seqno = atomic_inc_return_unchecked(&pv->seqno);
1316 +
1317 + /* Assumes that always succeeds, works in practice */
1318 + return pv->put_chars(pv->termno, (char *)packet, packet->len);
1319 +@@ -21,7 +21,7 @@ static void hvsi_start_handshake(struct hvsi_priv *pv)
1320 +
1321 + /* Reset state */
1322 + pv->established = 0;
1323 +- atomic_set(&pv->seqno, 0);
1324 ++ atomic_set_unchecked(&pv->seqno, 0);
1325 +
1326 + pr_devel("HVSI@%x: Handshaking started\n", pv->termno);
1327 +
1328 +@@ -265,7 +265,7 @@ int hvsilib_read_mctrl(struct hvsi_priv *pv)
1329 + pv->mctrl_update = 0;
1330 + q.hdr.type = VS_QUERY_PACKET_HEADER;
1331 + q.hdr.len = sizeof(struct hvsi_query);
1332 +- q.hdr.seqno = atomic_inc_return(&pv->seqno);
1333 ++ q.hdr.seqno = atomic_inc_return_unchecked(&pv->seqno);
1334 + q.verb = VSV_SEND_MODEM_CTL_STATUS;
1335 + rc = hvsi_send_packet(pv, &q.hdr);
1336 + if (rc <= 0) {
1337 diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c
1338 index 8fd72ff..34a0bed 100644
1339 --- a/drivers/tty/ipwireless/tty.c
1340 @@ -47119,6 +48167,37 @@ index 354564e..fe50d9a 100644
1341 atomic_dec(&rp_num_ports_open);
1342 clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]);
1343 spin_unlock_irqrestore(&info->port.lock, flags);
1344 +diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c
1345 +index e2520ab..034e20b 100644
1346 +--- a/drivers/tty/serial/ioc4_serial.c
1347 ++++ b/drivers/tty/serial/ioc4_serial.c
1348 +@@ -437,7 +437,7 @@ struct ioc4_soft {
1349 + } is_intr_info[MAX_IOC4_INTR_ENTS];
1350 +
1351 + /* Number of entries active in the above array */
1352 +- atomic_t is_num_intrs;
1353 ++ atomic_unchecked_t is_num_intrs;
1354 + } is_intr_type[IOC4_NUM_INTR_TYPES];
1355 +
1356 + /* is_ir_lock must be held while
1357 +@@ -974,7 +974,7 @@ intr_connect(struct ioc4_soft *soft, int type,
1358 + BUG_ON(!((type == IOC4_SIO_INTR_TYPE)
1359 + || (type == IOC4_OTHER_INTR_TYPE)));
1360 +
1361 +- i = atomic_inc_return(&soft-> is_intr_type[type].is_num_intrs) - 1;
1362 ++ i = atomic_inc_return_unchecked(&soft-> is_intr_type[type].is_num_intrs) - 1;
1363 + BUG_ON(!(i < MAX_IOC4_INTR_ENTS || (printk("i %d\n", i), 0)));
1364 +
1365 + /* Save off the lower level interrupt handler */
1366 +@@ -1001,7 +1001,7 @@ static irqreturn_t ioc4_intr(int irq, void *arg)
1367 +
1368 + soft = arg;
1369 + for (intr_type = 0; intr_type < IOC4_NUM_INTR_TYPES; intr_type++) {
1370 +- num_intrs = (int)atomic_read(
1371 ++ num_intrs = (int)atomic_read_unchecked(
1372 + &soft->is_intr_type[intr_type].is_num_intrs);
1373 +
1374 + this_mir = this_ir = pending_intrs(soft, intr_type);
1375 diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
1376 index 1002054..dd644a8 100644
1377 --- a/drivers/tty/serial/kgdboc.c
1378 @@ -47225,6 +48304,28 @@ index 1002054..dd644a8 100644
1379 #ifdef CONFIG_KGDB_SERIAL_CONSOLE
1380 /* This is only available if kgdboc is a built in for early debugging */
1381 static int __init kgdboc_early_init(char *opt)
1382 +diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
1383 +index b11e997..6d25a3b 100644
1384 +--- a/drivers/tty/serial/msm_serial.c
1385 ++++ b/drivers/tty/serial/msm_serial.c
1386 +@@ -857,7 +857,7 @@ static struct uart_driver msm_uart_driver = {
1387 + .cons = MSM_CONSOLE,
1388 + };
1389 +
1390 +-static atomic_t msm_uart_next_id = ATOMIC_INIT(0);
1391 ++static atomic_unchecked_t msm_uart_next_id = ATOMIC_INIT(0);
1392 +
1393 + static int __init msm_serial_probe(struct platform_device *pdev)
1394 + {
1395 +@@ -867,7 +867,7 @@ static int __init msm_serial_probe(struct platform_device *pdev)
1396 + int irq;
1397 +
1398 + if (pdev->id == -1)
1399 +- pdev->id = atomic_inc_return(&msm_uart_next_id) - 1;
1400 ++ pdev->id = atomic_inc_return_unchecked(&msm_uart_next_id) - 1;
1401 +
1402 + if (unlikely(pdev->id < 0 || pdev->id >= UART_NR))
1403 + return -ENXIO;
1404 diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
1405 index 0c8a9fa..234a95f 100644
1406 --- a/drivers/tty/serial/samsung.c
1407 @@ -48334,6 +49435,28 @@ index b369292..9f3ba40 100644
1408 gs_buf_free(&port->port_write_buf);
1409 gs_free_requests(gser->out, &port->read_pool, NULL);
1410 gs_free_requests(gser->out, &port->read_queue, NULL);
1411 +diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
1412 +index ba6a5d6..f88f7f3 100644
1413 +--- a/drivers/usb/misc/appledisplay.c
1414 ++++ b/drivers/usb/misc/appledisplay.c
1415 +@@ -83,7 +83,7 @@ struct appledisplay {
1416 + spinlock_t lock;
1417 + };
1418 +
1419 +-static atomic_t count_displays = ATOMIC_INIT(0);
1420 ++static atomic_unchecked_t count_displays = ATOMIC_INIT(0);
1421 + static struct workqueue_struct *wq;
1422 +
1423 + static void appledisplay_complete(struct urb *urb)
1424 +@@ -281,7 +281,7 @@ static int appledisplay_probe(struct usb_interface *iface,
1425 +
1426 + /* Register backlight device */
1427 + snprintf(bl_name, sizeof(bl_name), "appledisplay%d",
1428 +- atomic_inc_return(&count_displays) - 1);
1429 ++ atomic_inc_return_unchecked(&count_displays) - 1);
1430 + memset(&props, 0, sizeof(struct backlight_properties));
1431 + props.type = BACKLIGHT_RAW;
1432 + props.max_brightness = 0xff;
1433 diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
1434 index 5f3bcd3..bfca43f 100644
1435 --- a/drivers/usb/serial/console.c
1436 @@ -48613,6 +49736,28 @@ index 098bfc6..796841d 100644
1437 return -EINVAL;
1438 if (!registered_fb[con2fb.framebuffer])
1439 request_module("fb%d", con2fb.framebuffer);
1440 +diff --git a/drivers/video/hyperv_fb.c b/drivers/video/hyperv_fb.c
1441 +index d4d2c5f..ebbd113 100644
1442 +--- a/drivers/video/hyperv_fb.c
1443 ++++ b/drivers/video/hyperv_fb.c
1444 +@@ -233,7 +233,7 @@ static uint screen_fb_size;
1445 + static inline int synthvid_send(struct hv_device *hdev,
1446 + struct synthvid_msg *msg)
1447 + {
1448 +- static atomic64_t request_id = ATOMIC64_INIT(0);
1449 ++ static atomic64_unchecked_t request_id = ATOMIC64_INIT(0);
1450 + int ret;
1451 +
1452 + msg->pipe_hdr.type = PIPE_MSG_DATA;
1453 +@@ -241,7 +241,7 @@ static inline int synthvid_send(struct hv_device *hdev,
1454 +
1455 + ret = vmbus_sendpacket(hdev->channel, msg,
1456 + msg->vid_hdr.size + sizeof(struct pipe_msg_hdr),
1457 +- atomic64_inc_return(&request_id),
1458 ++ atomic64_inc_return_unchecked(&request_id),
1459 + VM_PKT_DATA_INBAND, 0);
1460 +
1461 + if (ret)
1462 diff --git a/drivers/video/i810/i810_accel.c b/drivers/video/i810/i810_accel.c
1463 index 7672d2e..b56437f 100644
1464 --- a/drivers/video/i810/i810_accel.c
1465 @@ -51880,6 +53025,28 @@ index 370b24c..ff0be7b 100644
1466 ---help---
1467 A.out (Assembler.OUTput) is a set of formats for libraries and
1468 executables used in the earliest versions of UNIX. Linux used
1469 +diff --git a/fs/afs/inode.c b/fs/afs/inode.c
1470 +index 789bc25..fafaeea 100644
1471 +--- a/fs/afs/inode.c
1472 ++++ b/fs/afs/inode.c
1473 +@@ -141,7 +141,7 @@ struct inode *afs_iget_autocell(struct inode *dir, const char *dev_name,
1474 + struct afs_vnode *vnode;
1475 + struct super_block *sb;
1476 + struct inode *inode;
1477 +- static atomic_t afs_autocell_ino;
1478 ++ static atomic_unchecked_t afs_autocell_ino;
1479 +
1480 + _enter("{%x:%u},%*.*s,",
1481 + AFS_FS_I(dir)->fid.vid, AFS_FS_I(dir)->fid.vnode,
1482 +@@ -154,7 +154,7 @@ struct inode *afs_iget_autocell(struct inode *dir, const char *dev_name,
1483 + data.fid.unique = 0;
1484 + data.fid.vnode = 0;
1485 +
1486 +- inode = iget5_locked(sb, atomic_inc_return(&afs_autocell_ino),
1487 ++ inode = iget5_locked(sb, atomic_inc_return_unchecked(&afs_autocell_ino),
1488 + afs_iget5_autocell_test, afs_iget5_set,
1489 + &data);
1490 + if (!inode) {
1491 diff --git a/fs/aio.c b/fs/aio.c
1492 index 2bbcacf..8614116 100644
1493 --- a/fs/aio.c
1494 @@ -53153,6 +54320,59 @@ index 7fb054b..ad36c67 100644
1495 parent_start = 0;
1496
1497 WARN_ON(trans->transid != btrfs_header_generation(parent));
1498 +diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
1499 +index f26f38c..3d0f149 100644
1500 +--- a/fs/btrfs/delayed-inode.c
1501 ++++ b/fs/btrfs/delayed-inode.c
1502 +@@ -458,7 +458,7 @@ static int __btrfs_add_delayed_deletion_item(struct btrfs_delayed_node *node,
1503 +
1504 + static void finish_one_item(struct btrfs_delayed_root *delayed_root)
1505 + {
1506 +- int seq = atomic_inc_return(&delayed_root->items_seq);
1507 ++ int seq = atomic_inc_return_unchecked(&delayed_root->items_seq);
1508 + if ((atomic_dec_return(&delayed_root->items) <
1509 + BTRFS_DELAYED_BACKGROUND || seq % BTRFS_DELAYED_BATCH == 0) &&
1510 + waitqueue_active(&delayed_root->wait))
1511 +@@ -1391,7 +1391,7 @@ void btrfs_assert_delayed_root_empty(struct btrfs_root *root)
1512 + static int refs_newer(struct btrfs_delayed_root *delayed_root,
1513 + int seq, int count)
1514 + {
1515 +- int val = atomic_read(&delayed_root->items_seq);
1516 ++ int val = atomic_read_unchecked(&delayed_root->items_seq);
1517 +
1518 + if (val < seq || val >= seq + count)
1519 + return 1;
1520 +@@ -1408,7 +1408,7 @@ void btrfs_balance_delayed_items(struct btrfs_root *root)
1521 + if (atomic_read(&delayed_root->items) < BTRFS_DELAYED_BACKGROUND)
1522 + return;
1523 +
1524 +- seq = atomic_read(&delayed_root->items_seq);
1525 ++ seq = atomic_read_unchecked(&delayed_root->items_seq);
1526 +
1527 + if (atomic_read(&delayed_root->items) >= BTRFS_DELAYED_WRITEBACK) {
1528 + int ret;
1529 +diff --git a/fs/btrfs/delayed-inode.h b/fs/btrfs/delayed-inode.h
1530 +index 1d5c5f7..0ba0afc 100644
1531 +--- a/fs/btrfs/delayed-inode.h
1532 ++++ b/fs/btrfs/delayed-inode.h
1533 +@@ -43,7 +43,7 @@ struct btrfs_delayed_root {
1534 + */
1535 + struct list_head prepare_list;
1536 + atomic_t items; /* for delayed items */
1537 +- atomic_t items_seq; /* for delayed items */
1538 ++ atomic_unchecked_t items_seq; /* for delayed items */
1539 + int nodes; /* for delayed nodes */
1540 + wait_queue_head_t wait;
1541 + };
1542 +@@ -87,7 +87,7 @@ static inline void btrfs_init_delayed_root(
1543 + struct btrfs_delayed_root *delayed_root)
1544 + {
1545 + atomic_set(&delayed_root->items, 0);
1546 +- atomic_set(&delayed_root->items_seq, 0);
1547 ++ atomic_set_unchecked(&delayed_root->items_seq, 0);
1548 + delayed_root->nodes = 0;
1549 + spin_lock_init(&delayed_root->lock);
1550 + init_waitqueue_head(&delayed_root->wait);
1551 diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
1552 index 0f81d67..0ad55fe 100644
1553 --- a/fs/btrfs/ioctl.c
1554 @@ -55499,9 +56719,18 @@ index d8ac61d..79a36f0 100644
1555 .seq = SEQCNT_ZERO,
1556 .umask = 0022,
1557 diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
1558 -index e2cba1f..17a25bb 100644
1559 +index e2cba1f..20319c5 100644
1560 --- a/fs/fscache/cookie.c
1561 +++ b/fs/fscache/cookie.c
1562 +@@ -19,7 +19,7 @@
1563 +
1564 + struct kmem_cache *fscache_cookie_jar;
1565 +
1566 +-static atomic_t fscache_object_debug_id = ATOMIC_INIT(0);
1567 ++static atomic_unchecked_t fscache_object_debug_id = ATOMIC_INIT(0);
1568 +
1569 + static int fscache_acquire_non_index_cookie(struct fscache_cookie *cookie);
1570 + static int fscache_alloc_object(struct fscache_cache *cache,
1571 @@ -68,11 +68,11 @@ struct fscache_cookie *__fscache_acquire_cookie(
1572 parent ? (char *) parent->def->name : "<no-parent>",
1573 def->name, netfs_data);
1574 @@ -55567,7 +56796,7 @@ index e2cba1f..17a25bb 100644
1575 _leave(" = -ENOMEDIUM [no cache]");
1576 return -ENOMEDIUM;
1577 }
1578 -@@ -255,12 +255,12 @@ static int fscache_alloc_object(struct fscache_cache *cache,
1579 +@@ -255,14 +255,14 @@ static int fscache_alloc_object(struct fscache_cache *cache,
1580 object = cache->ops->alloc_object(cache, cookie);
1581 fscache_stat_d(&fscache_n_cop_alloc_object);
1582 if (IS_ERR(object)) {
1583 @@ -55580,8 +56809,11 @@ index e2cba1f..17a25bb 100644
1584 - fscache_stat(&fscache_n_object_alloc);
1585 + fscache_stat_unchecked(&fscache_n_object_alloc);
1586
1587 - object->debug_id = atomic_inc_return(&fscache_object_debug_id);
1588 +- object->debug_id = atomic_inc_return(&fscache_object_debug_id);
1589 ++ object->debug_id = atomic_inc_return_unchecked(&fscache_object_debug_id);
1590
1591 + _debug("ALLOC OBJ%x: %s {%lx}",
1592 + object->debug_id, cookie->def->name, object->events);
1593 @@ -376,7 +376,7 @@ void __fscache_invalidate(struct fscache_cookie *cookie)
1594
1595 _enter("{%s}", cookie->def->name);
1596 @@ -57704,7 +58936,7 @@ index 9ed9361..2b72db1 100644
1597 out:
1598 return len;
1599 diff --git a/fs/namespace.c b/fs/namespace.c
1600 -index a45ba4f..e7dc489 100644
1601 +index a45ba4f..44cfe66 100644
1602 --- a/fs/namespace.c
1603 +++ b/fs/namespace.c
1604 @@ -1265,6 +1265,9 @@ static int do_umount(struct mount *mnt, int flags)
1605 @@ -57772,6 +59004,24 @@ index a45ba4f..e7dc489 100644
1606 return retval;
1607 }
1608
1609 +@@ -2344,7 +2363,7 @@ static void free_mnt_ns(struct mnt_namespace *ns)
1610 + * number incrementing at 10Ghz will take 12,427 years to wrap which
1611 + * is effectively never, so we can ignore the possibility.
1612 + */
1613 +-static atomic64_t mnt_ns_seq = ATOMIC64_INIT(1);
1614 ++static atomic64_unchecked_t mnt_ns_seq = ATOMIC64_INIT(1);
1615 +
1616 + static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
1617 + {
1618 +@@ -2359,7 +2378,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
1619 + kfree(new_ns);
1620 + return ERR_PTR(ret);
1621 + }
1622 +- new_ns->seq = atomic64_add_return(1, &mnt_ns_seq);
1623 ++ new_ns->seq = atomic64_inc_return_unchecked(&mnt_ns_seq);
1624 + atomic_set(&new_ns->count, 1);
1625 + new_ns->root = NULL;
1626 + INIT_LIST_HEAD(&new_ns->list);
1627 @@ -2500,8 +2519,8 @@ struct dentry *mount_subtree(struct vfsmount *mnt, const char *name)
1628 }
1629 EXPORT_SYMBOL(mount_subtree);
1630 @@ -77556,6 +78806,19 @@ index 95d1c91..6798cca 100644
1631
1632 /*
1633 * Newer version of video_device, handled by videodev2.c
1634 +diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
1635 +index c9b1593..a572459 100644
1636 +--- a/include/media/v4l2-device.h
1637 ++++ b/include/media/v4l2-device.h
1638 +@@ -95,7 +95,7 @@ int __must_check v4l2_device_register(struct device *dev, struct v4l2_device *v4
1639 + this function returns 0. If the name ends with a digit (e.g. cx18),
1640 + then the name will be set to cx18-0 since cx180 looks really odd. */
1641 + int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
1642 +- atomic_t *instance);
1643 ++ atomic_unchecked_t *instance);
1644 +
1645 + /* Set v4l2_dev->dev to NULL. Call when the USB parent disconnects.
1646 + Since the parent disappears this ensures that v4l2_dev doesn't have an
1647 diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
1648 index adcbb20..62c2559 100644
1649 --- a/include/net/9p/transport.h
1650 @@ -77658,7 +78921,7 @@ index de2c785..0588a6b 100644
1651 /** inet_connection_sock - INET connection oriented sock
1652 *
1653 diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
1654 -index 53f464d..ba76aaa 100644
1655 +index 53f464d..0bd0b49 100644
1656 --- a/include/net/inetpeer.h
1657 +++ b/include/net/inetpeer.h
1658 @@ -47,8 +47,8 @@ struct inet_peer {
1659 @@ -77672,20 +78935,28 @@ index 53f464d..ba76aaa 100644
1660 };
1661 struct rcu_head rcu;
1662 struct inet_peer *gc_next;
1663 -@@ -182,11 +182,11 @@ static inline int inet_getid(struct inet_peer *p, int more)
1664 +@@ -178,16 +178,13 @@ static inline void inet_peer_refcheck(const struct inet_peer *p)
1665 + /* can be called with or without local BH being disabled */
1666 + static inline int inet_getid(struct inet_peer *p, int more)
1667 + {
1668 +- int old, new;
1669 ++ int id;
1670 more++;
1671 inet_peer_refcheck(p);
1672 - do {
1673 +- do {
1674 - old = atomic_read(&p->ip_id_count);
1675 -+ old = atomic_read_unchecked(&p->ip_id_count);
1676 - new = old + more;
1677 - if (!new)
1678 - new = 1;
1679 +- new = old + more;
1680 +- if (!new)
1681 +- new = 1;
1682 - } while (atomic_cmpxchg(&p->ip_id_count, old, new) != old);
1683 -+ } while (atomic_cmpxchg_unchecked(&p->ip_id_count, old, new) != old);
1684 - return new;
1685 +- return new;
1686 ++ id = atomic_add_return_unchecked(more, &p->ip_id_count);
1687 ++ if (!id)
1688 ++ id = atomic_inc_return_unchecked(&p->ip_id_count);
1689 ++ return id;
1690 }
1691
1692 + #endif /* _NET_INETPEER_H */
1693 diff --git a/include/net/ip.h b/include/net/ip.h
1694 index a68f838..74518ab 100644
1695 --- a/include/net/ip.h
1696 @@ -85008,6 +86279,26 @@ index 51b4448..7be601f 100644
1697
1698 /*
1699 * Normal trace_printk() and friends allocates special buffers
1700 +diff --git a/kernel/trace/trace_clock.c b/kernel/trace/trace_clock.c
1701 +index 26dc348..8708ca7 100644
1702 +--- a/kernel/trace/trace_clock.c
1703 ++++ b/kernel/trace/trace_clock.c
1704 +@@ -123,7 +123,7 @@ u64 notrace trace_clock_global(void)
1705 + return now;
1706 + }
1707 +
1708 +-static atomic64_t trace_counter;
1709 ++static atomic64_unchecked_t trace_counter;
1710 +
1711 + /*
1712 + * trace_clock_counter(): simply an atomic counter.
1713 +@@ -132,5 +132,5 @@ static atomic64_t trace_counter;
1714 + */
1715 + u64 notrace trace_clock_counter(void)
1716 + {
1717 +- return atomic64_add_return(1, &trace_counter);
1718 ++ return atomic64_inc_return_unchecked(&trace_counter);
1719 + }
1720 diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
1721 index 3d18aad..d1be0eb 100644
1722 --- a/kernel/trace/trace_events.c
1723 @@ -91483,6 +92774,28 @@ index 3ee690e..00d581b 100644
1724 register_netdevice_notifier(&notifier);
1725
1726 if (__rtnl_register(PF_CAN, RTM_GETROUTE, NULL, cgw_dump_jobs, NULL)) {
1727 +diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
1728 +index eb0a46a..5f3bae8 100644
1729 +--- a/net/ceph/messenger.c
1730 ++++ b/net/ceph/messenger.c
1731 +@@ -186,7 +186,7 @@ static void con_fault(struct ceph_connection *con);
1732 + #define MAX_ADDR_STR_LEN 64 /* 54 is enough */
1733 +
1734 + static char addr_str[ADDR_STR_COUNT][MAX_ADDR_STR_LEN];
1735 +-static atomic_t addr_str_seq = ATOMIC_INIT(0);
1736 ++static atomic_unchecked_t addr_str_seq = ATOMIC_INIT(0);
1737 +
1738 + static struct page *zero_page; /* used in certain error cases */
1739 +
1740 +@@ -197,7 +197,7 @@ const char *ceph_pr_addr(const struct sockaddr_storage *ss)
1741 + struct sockaddr_in *in4 = (struct sockaddr_in *) ss;
1742 + struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) ss;
1743 +
1744 +- i = atomic_inc_return(&addr_str_seq) & ADDR_STR_COUNT_MASK;
1745 ++ i = atomic_inc_return_unchecked(&addr_str_seq) & ADDR_STR_COUNT_MASK;
1746 + s = addr_str[i];
1747 +
1748 + switch (ss->ss_family) {
1749 diff --git a/net/compat.c b/net/compat.c
1750 index f0a1ba6..0541331 100644
1751 --- a/net/compat.c
1752 @@ -91918,6 +93231,28 @@ index f9765203..9feaef8 100644
1753 mutex_unlock(&net_mutex);
1754 return error;
1755 }
1756 +diff --git a/net/core/netpoll.c b/net/core/netpoll.c
1757 +index cec074b..a53a938 100644
1758 +--- a/net/core/netpoll.c
1759 ++++ b/net/core/netpoll.c
1760 +@@ -428,7 +428,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
1761 + struct udphdr *udph;
1762 + struct iphdr *iph;
1763 + struct ethhdr *eth;
1764 +- static atomic_t ip_ident;
1765 ++ static atomic_unchecked_t ip_ident;
1766 + struct ipv6hdr *ip6h;
1767 +
1768 + udp_len = len + sizeof(*udph);
1769 +@@ -499,7 +499,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
1770 + put_unaligned(0x45, (unsigned char *)iph);
1771 + iph->tos = 0;
1772 + put_unaligned(htons(ip_len), &(iph->tot_len));
1773 +- iph->id = htons(atomic_inc_return(&ip_ident));
1774 ++ iph->id = htons(atomic_inc_return_unchecked(&ip_ident));
1775 + iph->frag_off = 0;
1776 + iph->ttl = 64;
1777 + iph->protocol = IPPROTO_UDP;
1778 diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
1779 index a08bd2b..c59bd7c 100644
1780 --- a/net/core/rtnetlink.c
1781 @@ -93731,6 +95066,39 @@ index dffdc1a..ccc6678 100644
1782 err_alloc:
1783 return -ENOMEM;
1784 }
1785 +diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c
1786 +index c2e73e6..12cca6f 100644
1787 +--- a/net/ipv6/output_core.c
1788 ++++ b/net/ipv6/output_core.c
1789 +@@ -8,8 +8,8 @@
1790 +
1791 + void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
1792 + {
1793 +- static atomic_t ipv6_fragmentation_id;
1794 +- int old, new;
1795 ++ static atomic_unchecked_t ipv6_fragmentation_id;
1796 ++ int id;
1797 +
1798 + #if IS_ENABLED(CONFIG_IPV6)
1799 + if (rt && !(rt->dst.flags & DST_NOPEER)) {
1800 +@@ -25,13 +25,10 @@ void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
1801 + }
1802 + }
1803 + #endif
1804 +- do {
1805 +- old = atomic_read(&ipv6_fragmentation_id);
1806 +- new = old + 1;
1807 +- if (!new)
1808 +- new = 1;
1809 +- } while (atomic_cmpxchg(&ipv6_fragmentation_id, old, new) != old);
1810 +- fhdr->identification = htonl(new);
1811 ++ id = atomic_inc_return_unchecked(&ipv6_fragmentation_id);
1812 ++ if (!id)
1813 ++ id = atomic_inc_return_unchecked(&ipv6_fragmentation_id);
1814 ++ fhdr->identification = htonl(id);
1815 + }
1816 + EXPORT_SYMBOL(ipv6_select_ident);
1817 +
1818 diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
1819 index eedff8c..7d7e24a 100644
1820 --- a/net/ipv6/raw.c
1821 @@ -96281,6 +97649,28 @@ index 4ca1526..df83e47 100644
1822
1823 set_fs(KERNEL_DS);
1824 if (level == SOL_SOCKET)
1825 +diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
1826 +index 29b4ba9..f648ae7 100644
1827 +--- a/net/sunrpc/auth_gss/svcauth_gss.c
1828 ++++ b/net/sunrpc/auth_gss/svcauth_gss.c
1829 +@@ -1144,7 +1144,7 @@ static int gss_proxy_save_rsc(struct cache_detail *cd,
1830 + uint64_t *handle)
1831 + {
1832 + struct rsc rsci, *rscp = NULL;
1833 +- static atomic64_t ctxhctr;
1834 ++ static atomic64_unchecked_t ctxhctr = ATOMIC64_INIT(0);
1835 + long long ctxh;
1836 + struct gss_api_mech *gm = NULL;
1837 + time_t expiry;
1838 +@@ -1155,7 +1155,7 @@ static int gss_proxy_save_rsc(struct cache_detail *cd,
1839 + status = -ENOMEM;
1840 + /* the handle needs to be just a unique id,
1841 + * use a static counter */
1842 +- ctxh = atomic64_inc_return(&ctxhctr);
1843 ++ ctxh = atomic64_inc_return_unchecked(&ctxhctr);
1844 +
1845 + /* make a copy for the caller */
1846 + *handle = ctxh;
1847 diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
1848 index 426f8fc..1ef9c32 100644
1849 --- a/net/sunrpc/clnt.c
1850 @@ -96853,7 +98243,7 @@ index ea970b8..c68edb9f 100644
1851 }
1852
1853 diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
1854 -index 78f66fa..9286768 100644
1855 +index 78f66fa..b93d547 100644
1856 --- a/net/xfrm/xfrm_state.c
1857 +++ b/net/xfrm/xfrm_state.c
1858 @@ -177,12 +177,14 @@ int xfrm_register_type(const struct xfrm_type *type, unsigned short family)
1859 @@ -96947,6 +98337,19 @@ index 78f66fa..9286768 100644
1860 module_put(mode->afinfo->owner);
1861 err = 0;
1862 }
1863 +@@ -1486,10 +1493,10 @@ EXPORT_SYMBOL(xfrm_find_acq_byseq);
1864 + u32 xfrm_get_acqseq(void)
1865 + {
1866 + u32 res;
1867 +- static atomic_t acqseq;
1868 ++ static atomic_unchecked_t acqseq;
1869 +
1870 + do {
1871 +- res = atomic_inc_return(&acqseq);
1872 ++ res = atomic_inc_return_unchecked(&acqseq);
1873 + } while (!res);
1874 +
1875 + return res;
1876 diff --git a/net/xfrm/xfrm_sysctl.c b/net/xfrm/xfrm_sysctl.c
1877 index 05a6e3d..6716ec9 100644
1878 --- a/net/xfrm/xfrm_sysctl.c
1879 @@ -98954,6 +100357,37 @@ index a3dce87..9ca1435 100644
1880 }
1881
1882 /* Save user chosen LSM */
1883 +diff --git a/security/selinux/avc.c b/security/selinux/avc.c
1884 +index dad36a6..7e5ffbf 100644
1885 +--- a/security/selinux/avc.c
1886 ++++ b/security/selinux/avc.c
1887 +@@ -59,7 +59,7 @@ struct avc_node {
1888 + struct avc_cache {
1889 + struct hlist_head slots[AVC_CACHE_SLOTS]; /* head for avc_node->list */
1890 + spinlock_t slots_lock[AVC_CACHE_SLOTS]; /* lock for writes */
1891 +- atomic_t lru_hint; /* LRU hint for reclaim scan */
1892 ++ atomic_unchecked_t lru_hint; /* LRU hint for reclaim scan */
1893 + atomic_t active_nodes;
1894 + u32 latest_notif; /* latest revocation notification */
1895 + };
1896 +@@ -167,7 +167,7 @@ void __init avc_init(void)
1897 + spin_lock_init(&avc_cache.slots_lock[i]);
1898 + }
1899 + atomic_set(&avc_cache.active_nodes, 0);
1900 +- atomic_set(&avc_cache.lru_hint, 0);
1901 ++ atomic_set_unchecked(&avc_cache.lru_hint, 0);
1902 +
1903 + avc_node_cachep = kmem_cache_create("avc_node", sizeof(struct avc_node),
1904 + 0, SLAB_PANIC, NULL);
1905 +@@ -242,7 +242,7 @@ static inline int avc_reclaim_node(void)
1906 + spinlock_t *lock;
1907 +
1908 + for (try = 0, ecx = 0; try < AVC_CACHE_SLOTS; try++) {
1909 +- hvalue = atomic_inc_return(&avc_cache.lru_hint) & (AVC_CACHE_SLOTS - 1);
1910 ++ hvalue = atomic_inc_return_unchecked(&avc_cache.lru_hint) & (AVC_CACHE_SLOTS - 1);
1911 + head = &avc_cache.slots[hvalue];
1912 + lock = &avc_cache.slots_lock[hvalue];
1913 +
1914 diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
1915 index 5c6f2cd..b4f945c 100644
1916 --- a/security/selinux/hooks.c
1917
1918 diff --git a/3.2.50/0000_README b/3.2.50/0000_README
1919 index 8d5d81f..b584719 100644
1920 --- a/3.2.50/0000_README
1921 +++ b/3.2.50/0000_README
1922 @@ -118,7 +118,7 @@ Patch: 1049_linux-3.2.50.patch
1923 From: http://www.kernel.org
1924 Desc: Linux 3.2.50
1925
1926 -Patch: 4420_grsecurity-2.9.1-3.2.50-201308282053.patch
1927 +Patch: 4420_grsecurity-2.9.1-3.2.50-201309011629.patch
1928 From: http://www.grsecurity.net
1929 Desc: hardened-sources base patch from upstream grsecurity
1930
1931
1932 diff --git a/3.2.50/4420_grsecurity-2.9.1-3.2.50-201308282053.patch b/3.2.50/4420_grsecurity-2.9.1-3.2.50-201309011629.patch
1933 similarity index 99%
1934 rename from 3.2.50/4420_grsecurity-2.9.1-3.2.50-201308282053.patch
1935 rename to 3.2.50/4420_grsecurity-2.9.1-3.2.50-201309011629.patch
1936 index 581a30c..eab80ae 100644
1937 --- a/3.2.50/4420_grsecurity-2.9.1-3.2.50-201308282053.patch
1938 +++ b/3.2.50/4420_grsecurity-2.9.1-3.2.50-201309011629.patch
1939 @@ -6732,6 +6732,57 @@ index 96ee50a..68ce124 100644
1940 #ifdef CONFIG_AUDITSYSCALL
1941 if (unlikely(current->audit_context)) {
1942 unsigned long tstate = regs->tstate;
1943 +diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
1944 +index e21d3c0d..8f453c1 100644
1945 +--- a/arch/sparc/kernel/smp_64.c
1946 ++++ b/arch/sparc/kernel/smp_64.c
1947 +@@ -871,8 +871,8 @@ extern unsigned long xcall_flush_dcache_page_cheetah;
1948 + extern unsigned long xcall_flush_dcache_page_spitfire;
1949 +
1950 + #ifdef CONFIG_DEBUG_DCFLUSH
1951 +-extern atomic_t dcpage_flushes;
1952 +-extern atomic_t dcpage_flushes_xcall;
1953 ++extern atomic_unchecked_t dcpage_flushes;
1954 ++extern atomic_unchecked_t dcpage_flushes_xcall;
1955 + #endif
1956 +
1957 + static inline void __local_flush_dcache_page(struct page *page)
1958 +@@ -896,7 +896,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
1959 + return;
1960 +
1961 + #ifdef CONFIG_DEBUG_DCFLUSH
1962 +- atomic_inc(&dcpage_flushes);
1963 ++ atomic_inc_unchecked(&dcpage_flushes);
1964 + #endif
1965 +
1966 + this_cpu = get_cpu();
1967 +@@ -920,7 +920,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
1968 + xcall_deliver(data0, __pa(pg_addr),
1969 + (u64) pg_addr, cpumask_of(cpu));
1970 + #ifdef CONFIG_DEBUG_DCFLUSH
1971 +- atomic_inc(&dcpage_flushes_xcall);
1972 ++ atomic_inc_unchecked(&dcpage_flushes_xcall);
1973 + #endif
1974 + }
1975 + }
1976 +@@ -939,7 +939,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
1977 + preempt_disable();
1978 +
1979 + #ifdef CONFIG_DEBUG_DCFLUSH
1980 +- atomic_inc(&dcpage_flushes);
1981 ++ atomic_inc_unchecked(&dcpage_flushes);
1982 + #endif
1983 + data0 = 0;
1984 + pg_addr = page_address(page);
1985 +@@ -956,7 +956,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
1986 + xcall_deliver(data0, __pa(pg_addr),
1987 + (u64) pg_addr, cpu_online_mask);
1988 + #ifdef CONFIG_DEBUG_DCFLUSH
1989 +- atomic_inc(&dcpage_flushes_xcall);
1990 ++ atomic_inc_unchecked(&dcpage_flushes_xcall);
1991 + #endif
1992 + }
1993 + __local_flush_dcache_page(page);
1994 diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c
1995 index 42b282f..408977c 100644
1996 --- a/arch/sparc/kernel/sys_sparc_32.c
1997 @@ -7044,7 +7095,7 @@ index 591f20c..0f1b925 100644
1998 }
1999
2000 diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
2001 -index 0cbdaa4..438e4c9 100644
2002 +index 0cbdaa4..f37a97c 100644
2003 --- a/arch/sparc/kernel/traps_64.c
2004 +++ b/arch/sparc/kernel/traps_64.c
2005 @@ -75,7 +75,7 @@ static void dump_tl1_traplog(struct tl1_traplog *p)
2006 @@ -7114,6 +7165,55 @@ index 0cbdaa4..438e4c9 100644
2007 }
2008
2009 struct sun4v_error_entry {
2010 +@@ -1786,8 +1797,8 @@ struct sun4v_error_entry {
2011 + u16 err_pad;
2012 + };
2013 +
2014 +-static atomic_t sun4v_resum_oflow_cnt = ATOMIC_INIT(0);
2015 +-static atomic_t sun4v_nonresum_oflow_cnt = ATOMIC_INIT(0);
2016 ++static atomic_unchecked_t sun4v_resum_oflow_cnt = ATOMIC_INIT(0);
2017 ++static atomic_unchecked_t sun4v_nonresum_oflow_cnt = ATOMIC_INIT(0);
2018 +
2019 + static const char *sun4v_err_type_to_str(u32 type)
2020 + {
2021 +@@ -1807,7 +1818,7 @@ static const char *sun4v_err_type_to_str(u32 type)
2022 + }
2023 + }
2024 +
2025 +-static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent, int cpu, const char *pfx, atomic_t *ocnt)
2026 ++static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent, int cpu, const char *pfx, atomic_unchecked_t *ocnt)
2027 + {
2028 + int cnt;
2029 +
2030 +@@ -1842,8 +1853,8 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,
2031 +
2032 + show_regs(regs);
2033 +
2034 +- if ((cnt = atomic_read(ocnt)) != 0) {
2035 +- atomic_set(ocnt, 0);
2036 ++ if ((cnt = atomic_read_unchecked(ocnt)) != 0) {
2037 ++ atomic_set_unchecked(ocnt, 0);
2038 + wmb();
2039 + printk("%s: Queue overflowed %d times.\n",
2040 + pfx, cnt);
2041 +@@ -1895,7 +1906,7 @@ void sun4v_resum_error(struct pt_regs *regs, unsigned long offset)
2042 + */
2043 + void sun4v_resum_overflow(struct pt_regs *regs)
2044 + {
2045 +- atomic_inc(&sun4v_resum_oflow_cnt);
2046 ++ atomic_inc_unchecked(&sun4v_resum_oflow_cnt);
2047 + }
2048 +
2049 + /* We run with %pil set to PIL_NORMAL_MAX and PSTATE_IE enabled in %pstate.
2050 +@@ -1948,7 +1959,7 @@ void sun4v_nonresum_overflow(struct pt_regs *regs)
2051 + /* XXX Actually even this can make not that much sense. Perhaps
2052 + * XXX we should just pull the plug and panic directly from here?
2053 + */
2054 +- atomic_inc(&sun4v_nonresum_oflow_cnt);
2055 ++ atomic_inc_unchecked(&sun4v_nonresum_oflow_cnt);
2056 + }
2057 +
2058 + unsigned long sun4v_err_itlb_vaddr;
2059 @@ -1963,9 +1974,9 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl)
2060
2061 printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n",
2062 @@ -8574,6 +8674,44 @@ index 7b00de6..78239f4 100644
2063 protection_map[12] = PAGE_READONLY;
2064 protection_map[13] = PAGE_READONLY;
2065 protection_map[14] = PAGE_SHARED;
2066 +diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
2067 +index b4989f9..530099e 100644
2068 +--- a/arch/sparc/mm/init_64.c
2069 ++++ b/arch/sparc/mm/init_64.c
2070 +@@ -170,9 +170,9 @@ unsigned long sparc64_kern_sec_context __read_mostly;
2071 + int num_kernel_image_mappings;
2072 +
2073 + #ifdef CONFIG_DEBUG_DCFLUSH
2074 +-atomic_t dcpage_flushes = ATOMIC_INIT(0);
2075 ++atomic_unchecked_t dcpage_flushes = ATOMIC_INIT(0);
2076 + #ifdef CONFIG_SMP
2077 +-atomic_t dcpage_flushes_xcall = ATOMIC_INIT(0);
2078 ++atomic_unchecked_t dcpage_flushes_xcall = ATOMIC_INIT(0);
2079 + #endif
2080 + #endif
2081 +
2082 +@@ -180,7 +180,7 @@ inline void flush_dcache_page_impl(struct page *page)
2083 + {
2084 + BUG_ON(tlb_type == hypervisor);
2085 + #ifdef CONFIG_DEBUG_DCFLUSH
2086 +- atomic_inc(&dcpage_flushes);
2087 ++ atomic_inc_unchecked(&dcpage_flushes);
2088 + #endif
2089 +
2090 + #ifdef DCACHE_ALIASING_POSSIBLE
2091 +@@ -417,10 +417,10 @@ void mmu_info(struct seq_file *m)
2092 +
2093 + #ifdef CONFIG_DEBUG_DCFLUSH
2094 + seq_printf(m, "DCPageFlushes\t: %d\n",
2095 +- atomic_read(&dcpage_flushes));
2096 ++ atomic_read_unchecked(&dcpage_flushes));
2097 + #ifdef CONFIG_SMP
2098 + seq_printf(m, "DCPageFlushesXC\t: %d\n",
2099 +- atomic_read(&dcpage_flushes_xcall));
2100 ++ atomic_read_unchecked(&dcpage_flushes_xcall));
2101 + #endif /* CONFIG_SMP */
2102 + #endif /* CONFIG_DEBUG_DCFLUSH */
2103 + }
2104 diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
2105 index cbef74e..c38fead 100644
2106 --- a/arch/sparc/mm/srmmu.c
2107 @@ -14361,7 +14499,7 @@ index 566e803..86f1302 100644
2108 }
2109
2110 diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h
2111 -index 1c66d30..f2fbd07 100644
2112 +index 1c66d30..6c7b4d8 100644
2113 --- a/arch/x86/include/asm/uaccess_64.h
2114 +++ b/arch/x86/include/asm/uaccess_64.h
2115 @@ -10,6 +10,9 @@
2116 @@ -14688,8 +14826,9 @@ index 1c66d30..f2fbd07 100644
2117 +__must_check unsigned long clear_user(void __user *mem, unsigned long len) __size_overflow(2);
2118 +__must_check unsigned long __clear_user(void __user *mem, unsigned long len) __size_overflow(2);
2119
2120 - static __must_check __always_inline int
2121 +-static __must_check __always_inline int
2122 -__copy_from_user_inatomic(void *dst, const void __user *src, unsigned size)
2123 ++static __must_check __always_inline unsigned long
2124 +__copy_from_user_inatomic(void *dst, const void __user *src, unsigned long size)
2125 {
2126 - return copy_user_generic(dst, (__force const void *)src, size);
2127 @@ -33281,6 +33420,28 @@ index 1e756e1..6f7ead5 100644
2128 .attrs = cpuclass_default_attrs,
2129 .name = "cpuidle",
2130 };
2131 +diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
2132 +index fe765f4..0bc6d6a 100644
2133 +--- a/drivers/crypto/hifn_795x.c
2134 ++++ b/drivers/crypto/hifn_795x.c
2135 +@@ -51,7 +51,7 @@ module_param_string(hifn_pll_ref, hifn_pll_ref, sizeof(hifn_pll_ref), 0444);
2136 + MODULE_PARM_DESC(hifn_pll_ref,
2137 + "PLL reference clock (pci[freq] or ext[freq], default ext)");
2138 +
2139 +-static atomic_t hifn_dev_number;
2140 ++static atomic_unchecked_t hifn_dev_number;
2141 +
2142 + #define ACRYPTO_OP_DECRYPT 0
2143 + #define ACRYPTO_OP_ENCRYPT 1
2144 +@@ -2576,7 +2576,7 @@ static int __devinit hifn_probe(struct pci_dev *pdev, const struct pci_device_id
2145 + goto err_out_disable_pci_device;
2146 +
2147 + snprintf(name, sizeof(name), "hifn%d",
2148 +- atomic_inc_return(&hifn_dev_number)-1);
2149 ++ atomic_inc_return_unchecked(&hifn_dev_number)-1);
2150 +
2151 + err = pci_request_regions(pdev, name);
2152 + if (err)
2153 diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
2154 index 59d24e9..0d20240 100644
2155 --- a/drivers/devfreq/devfreq.c
2156 @@ -33372,6 +33533,44 @@ index 6ffb6d2..383d8d7 100644
2157 {
2158 PCI_VEND_DEV(INTEL, 7205_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2159 E7205},
2160 +diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
2161 +index c3f6743..e2c52b0 100644
2162 +--- a/drivers/edac/edac_device.c
2163 ++++ b/drivers/edac/edac_device.c
2164 +@@ -483,9 +483,9 @@ void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
2165 + */
2166 + int edac_device_alloc_index(void)
2167 + {
2168 +- static atomic_t device_indexes = ATOMIC_INIT(0);
2169 ++ static atomic_unchecked_t device_indexes = ATOMIC_INIT(0);
2170 +
2171 +- return atomic_inc_return(&device_indexes) - 1;
2172 ++ return atomic_inc_return_unchecked(&device_indexes) - 1;
2173 + }
2174 + EXPORT_SYMBOL_GPL(edac_device_alloc_index);
2175 +
2176 +diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c
2177 +index 2b378207..99ba0bd 100644
2178 +--- a/drivers/edac/edac_pci.c
2179 ++++ b/drivers/edac/edac_pci.c
2180 +@@ -30,7 +30,7 @@
2181 +
2182 + static DEFINE_MUTEX(edac_pci_ctls_mutex);
2183 + static LIST_HEAD(edac_pci_list);
2184 +-static atomic_t pci_indexes = ATOMIC_INIT(0);
2185 ++static atomic_unchecked_t pci_indexes = ATOMIC_INIT(0);
2186 +
2187 + /*
2188 + * edac_pci_alloc_ctl_info
2189 +@@ -316,7 +316,7 @@ EXPORT_SYMBOL_GPL(edac_pci_reset_delay_period);
2190 + */
2191 + int edac_pci_alloc_index(void)
2192 + {
2193 +- return atomic_inc_return(&pci_indexes) - 1;
2194 ++ return atomic_inc_return_unchecked(&pci_indexes) - 1;
2195 + }
2196 + EXPORT_SYMBOL_GPL(edac_pci_alloc_index);
2197 +
2198 diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
2199 index 8cc8676..90b70b9 100644
2200 --- a/drivers/edac/edac_pci_sysfs.c
2201 @@ -33664,9 +33863,21 @@ index b6f47de..c5acf3a 100644
2202 PCI_VEND_DEV(INTEL, X38_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2203 X38},
2204 diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
2205 -index 85661b0..c784559a 100644
2206 +index 85661b0..cdd4560 100644
2207 --- a/drivers/firewire/core-card.c
2208 +++ b/drivers/firewire/core-card.c
2209 +@@ -512,9 +512,9 @@ void fw_card_initialize(struct fw_card *card,
2210 + const struct fw_card_driver *driver,
2211 + struct device *device)
2212 + {
2213 +- static atomic_t index = ATOMIC_INIT(-1);
2214 ++ static atomic_unchecked_t index = ATOMIC_INIT(-1);
2215 +
2216 +- card->index = atomic_inc_return(&index);
2217 ++ card->index = atomic_inc_return_unchecked(&index);
2218 + card->driver = driver;
2219 + card->device = device;
2220 + card->current_tlabel = 0;
2221 @@ -657,7 +657,7 @@ void fw_card_release(struct kref *kref)
2222
2223 void fw_core_remove_card(struct fw_card *card)
2224 @@ -37699,6 +37910,28 @@ index ba70058..571d25d 100644
2225 serio->dev.bus = &serio_bus;
2226 serio->dev.release = serio_release_port;
2227 serio->dev.groups = serio_device_attr_groups;
2228 +diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
2229 +index 4d4cd14..d6fdd87 100644
2230 +--- a/drivers/input/serio/serio_raw.c
2231 ++++ b/drivers/input/serio/serio_raw.c
2232 +@@ -280,7 +280,7 @@ static irqreturn_t serio_raw_interrupt(struct serio *serio, unsigned char data,
2233 +
2234 + static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
2235 + {
2236 +- static atomic_t serio_raw_no = ATOMIC_INIT(0);
2237 ++ static atomic_unchecked_t serio_raw_no = ATOMIC_INIT(0);
2238 + struct serio_raw *serio_raw;
2239 + int err;
2240 +
2241 +@@ -291,7 +291,7 @@ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)
2242 + }
2243 +
2244 + snprintf(serio_raw->name, sizeof(serio_raw->name),
2245 +- "serio_raw%ld", (long)atomic_inc_return(&serio_raw_no) - 1);
2246 ++ "serio_raw%ld", (long)atomic_inc_return_unchecked(&serio_raw_no) - 1);
2247 + kref_init(&serio_raw->kref);
2248 + INIT_LIST_HEAD(&serio_raw->client_list);
2249 + init_waitqueue_head(&serio_raw->wait);
2250 diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
2251 index e44933d..9ba484a 100644
2252 --- a/drivers/isdn/capi/capi.c
2253 @@ -37896,6 +38129,19 @@ index ee0a549..a7c9798 100644
2254 dev_warn(cs->dev, "%s: device not opened\n", __func__);
2255 goto out;
2256 }
2257 +diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c
2258 +index 5e3300d..dc7d752 100644
2259 +--- a/drivers/isdn/gigaset/usb-gigaset.c
2260 ++++ b/drivers/isdn/gigaset/usb-gigaset.c
2261 +@@ -546,7 +546,7 @@ static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6])
2262 + gigaset_dbg_buffer(DEBUG_USBREQ, "brkchars", 6, buf);
2263 + memcpy(cs->hw.usb->bchars, buf, 6);
2264 + return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x19, 0x41,
2265 +- 0, 0, &buf, 6, 2000);
2266 ++ 0, 0, buf, 6, 2000);
2267 + }
2268 +
2269 + static int gigaset_freebcshw(struct bc_state *bcs)
2270 diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c
2271 index 2a57da59..e7a12ed 100644
2272 --- a/drivers/isdn/hardware/avm/b1.c
2273 @@ -37918,6 +38164,19 @@ index 2a57da59..e7a12ed 100644
2274 return -EFAULT;
2275 } else {
2276 memcpy(buf, dp, left);
2277 +diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
2278 +index 6ddb795e..bd2e875 100644
2279 +--- a/drivers/isdn/i4l/isdn_common.c
2280 ++++ b/drivers/isdn/i4l/isdn_common.c
2281 +@@ -1656,6 +1656,8 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
2282 + } else
2283 + return -EINVAL;
2284 + case IIOCDBGVAR:
2285 ++ if (!capable(CAP_SYS_RAWIO))
2286 ++ return -EPERM;
2287 + if (arg) {
2288 + if (copy_to_user(argp, &dev, sizeof(ulong)))
2289 + return -EFAULT;
2290 diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
2291 index 2339d73..802ab87a 100644
2292 --- a/drivers/isdn/i4l/isdn_net.c
2293 @@ -38791,6 +39050,28 @@ index 16a089f..1661b11 100644
2294 return -EFAULT;
2295 return i;
2296 }
2297 +diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
2298 +index a47ba33..deafb02 100644
2299 +--- a/drivers/media/rc/rc-main.c
2300 ++++ b/drivers/media/rc/rc-main.c
2301 +@@ -1031,7 +1031,7 @@ EXPORT_SYMBOL_GPL(rc_free_device);
2302 +
2303 + int rc_register_device(struct rc_dev *dev)
2304 + {
2305 +- static atomic_t devno = ATOMIC_INIT(0);
2306 ++ static atomic_unchecked_t devno = ATOMIC_INIT(0);
2307 + struct rc_map *rc_map;
2308 + const char *path;
2309 + int rc;
2310 +@@ -1063,7 +1063,7 @@ int rc_register_device(struct rc_dev *dev)
2311 + */
2312 + mutex_lock(&dev->lock);
2313 +
2314 +- dev->devno = (unsigned long)(atomic_inc_return(&devno) - 1);
2315 ++ dev->devno = (unsigned long)(atomic_inc_return_unchecked(&devno) - 1);
2316 + dev_set_name(&dev->dev, "rc%ld", dev->devno);
2317 + dev_set_drvdata(&dev->dev, dev);
2318 + rc = device_add(&dev->dev);
2319 diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c
2320 index 61287fc..8b08712 100644
2321 --- a/drivers/media/rc/redrat3.c
2322 @@ -38834,6 +39115,19 @@ index 921c56d..7e6c4b2 100644
2323
2324 module_param_array(video_nr, int, NULL, 0444);
2325 module_param_array(vbi_nr, int, NULL, 0444);
2326 +diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
2327 +index 41108a9a..8ad2437 100644
2328 +--- a/drivers/media/video/ivtv/ivtv-driver.c
2329 ++++ b/drivers/media/video/ivtv/ivtv-driver.c
2330 +@@ -80,7 +80,7 @@ static struct pci_device_id ivtv_pci_tbl[] __devinitdata = {
2331 + MODULE_DEVICE_TABLE(pci,ivtv_pci_tbl);
2332 +
2333 + /* ivtv instance counter */
2334 +-static atomic_t ivtv_instance = ATOMIC_INIT(0);
2335 ++static atomic_unchecked_t ivtv_instance = ATOMIC_INIT(0);
2336 +
2337 + /* Parameter declarations */
2338 + static int cardtype[IVTV_MAX_CARDS];
2339 diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c
2340 index d345215..b607565 100644
2341 --- a/drivers/media/video/omap/omap_vout.c
2342 @@ -38940,6 +39234,22 @@ index c68531b..82a9ea0 100644
2343 enum v4l2_memory memory)
2344 {
2345 if (copy_in_user(up32, up, 2 * sizeof(__u32)) ||
2346 +diff --git a/drivers/media/video/v4l2-device.c b/drivers/media/video/v4l2-device.c
2347 +index 8b0777f..e29f31e 100644
2348 +--- a/drivers/media/video/v4l2-device.c
2349 ++++ b/drivers/media/video/v4l2-device.c
2350 +@@ -74,9 +74,9 @@ int v4l2_device_put(struct v4l2_device *v4l2_dev)
2351 + EXPORT_SYMBOL_GPL(v4l2_device_put);
2352 +
2353 + int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
2354 +- atomic_t *instance)
2355 ++ atomic_unchecked_t *instance)
2356 + {
2357 +- int num = atomic_inc_return(instance) - 1;
2358 ++ int num = atomic_inc_return_unchecked(instance) - 1;
2359 + int len = strlen(basename);
2360 +
2361 + if (basename[len - 1] >= '0' && basename[len - 1] <= '9')
2362 diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
2363 index 639abee..e2336f4 100644
2364 --- a/drivers/media/video/v4l2-ioctl.c
2365 @@ -40794,6 +41104,28 @@ index 304fe78..db112fa 100644
2366 result =
2367 hso_start_serial_device(serial_table[i], GFP_NOIO);
2368 hso_kick_transmit(dev2ser(serial_table[i]));
2369 +diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
2370 +index e773250..9ee61ab 100644
2371 +--- a/drivers/net/usb/sierra_net.c
2372 ++++ b/drivers/net/usb/sierra_net.c
2373 +@@ -52,7 +52,7 @@ static const char driver_name[] = "sierra_net";
2374 + /* atomic counter partially included in MAC address to make sure 2 devices
2375 + * do not end up with the same MAC - concept breaks in case of > 255 ifaces
2376 + */
2377 +-static atomic_t iface_counter = ATOMIC_INIT(0);
2378 ++static atomic_unchecked_t iface_counter = ATOMIC_INIT(0);
2379 +
2380 + /*
2381 + * SYNC Timer Delay definition used to set the expiry time
2382 +@@ -738,7 +738,7 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
2383 + dev->net->netdev_ops = &sierra_net_device_ops;
2384 +
2385 + /* change MAC addr to include, ifacenum, and to be unique */
2386 +- dev->net->dev_addr[ETH_ALEN-2] = atomic_inc_return(&iface_counter);
2387 ++ dev->net->dev_addr[ETH_ALEN-2] = atomic_inc_return_unchecked(&iface_counter);
2388 + dev->net->dev_addr[ETH_ALEN-1] = ifacenum;
2389 +
2390 + /* we will have to manufacture ethernet headers, prepare template */
2391 diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
2392 index dc53a8f..2b66cc1 100644
2393 --- a/drivers/net/usb/usbnet.c
2394 @@ -42048,6 +42380,19 @@ index 8e6c4fa..a7539b3 100644
2395
2396 /*
2397 * Polling driver
2398 +diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
2399 +index a134c26..d024437 100644
2400 +--- a/drivers/platform/x86/wmi.c
2401 ++++ b/drivers/platform/x86/wmi.c
2402 +@@ -743,7 +743,7 @@ static int wmi_create_device(const struct guid_block *gblock,
2403 + wblock->dev.class = &wmi_class;
2404 +
2405 + wmi_gtoa(gblock->guid, guid_string);
2406 +- dev_set_name(&wblock->dev, guid_string);
2407 ++ dev_set_name(&wblock->dev, "%s", guid_string);
2408 +
2409 + dev_set_drvdata(&wblock->dev, wblock);
2410 +
2411 diff --git a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
2412 index b859d16..5cc6b1a 100644
2413 --- a/drivers/pnp/pnpbios/bioscalls.c
2414 @@ -42198,6 +42543,28 @@ index e15d4c9..83cd617 100644
2415 for (i = 0; i < ARRAY_SIZE(power_supply_attrs); i++)
2416 __power_supply_attrs[i] = &power_supply_attrs[i].attr;
2417 }
2418 +diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
2419 +index 6ec610c..078eaf3 100644
2420 +--- a/drivers/regulator/core.c
2421 ++++ b/drivers/regulator/core.c
2422 +@@ -2639,7 +2639,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
2423 + struct device *dev, const struct regulator_init_data *init_data,
2424 + void *driver_data)
2425 + {
2426 +- static atomic_t regulator_no = ATOMIC_INIT(0);
2427 ++ static atomic_unchecked_t regulator_no = ATOMIC_INIT(0);
2428 + struct regulator_dev *rdev;
2429 + int ret, i;
2430 +
2431 +@@ -2698,7 +2698,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
2432 + rdev->dev.class = &regulator_class;
2433 + rdev->dev.parent = dev;
2434 + dev_set_name(&rdev->dev, "regulator.%d",
2435 +- atomic_inc_return(&regulator_no) - 1);
2436 ++ atomic_inc_return_unchecked(&regulator_no) - 1);
2437 + ret = device_register(&rdev->dev);
2438 + if (ret != 0) {
2439 + put_device(&rdev->dev);
2440 diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c
2441 index 33f5d9a..d957d3f 100644
2442 --- a/drivers/regulator/max8660.c
2443 @@ -43187,6 +43554,19 @@ index 21a045e..ec89e03 100644
2444 dev_set_name(&rport->dev, "port-%d:%d", shost->host_no, id);
2445
2446 transport_setup_device(&rport->dev);
2447 +diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
2448 +index 17603da..332e23a 100644
2449 +--- a/drivers/scsi/sd.c
2450 ++++ b/drivers/scsi/sd.c
2451 +@@ -2637,7 +2637,7 @@ static int sd_probe(struct device *dev)
2452 + device_initialize(&sdkp->dev);
2453 + sdkp->dev.parent = dev;
2454 + sdkp->dev.class = &sd_disk_class;
2455 +- dev_set_name(&sdkp->dev, dev_name(dev));
2456 ++ dev_set_name(&sdkp->dev, "%s", dev_name(dev));
2457 +
2458 + if (device_add(&sdkp->dev))
2459 + goto out_free_index;
2460 diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
2461 index 441a1c5..07cece7 100644
2462 --- a/drivers/scsi/sg.c
2463 @@ -43868,6 +44248,104 @@ index b9040be..e3f5aab 100644
2464 return 0;
2465
2466 return HVCS_BUFF_LEN - hvcsd->chars_in_buffer;
2467 +diff --git a/drivers/tty/hvc/hvsi.c b/drivers/tty/hvc/hvsi.c
2468 +index cdfa3e0..37fa165 100644
2469 +--- a/drivers/tty/hvc/hvsi.c
2470 ++++ b/drivers/tty/hvc/hvsi.c
2471 +@@ -86,7 +86,7 @@ struct hvsi_struct {
2472 + int n_outbuf;
2473 + uint32_t vtermno;
2474 + uint32_t virq;
2475 +- atomic_t seqno; /* HVSI packet sequence number */
2476 ++ atomic_unchecked_t seqno; /* HVSI packet sequence number */
2477 + uint16_t mctrl;
2478 + uint8_t state; /* HVSI protocol state */
2479 + uint8_t flags;
2480 +@@ -297,7 +297,7 @@ static int hvsi_version_respond(struct hvsi_struct *hp, uint16_t query_seqno)
2481 +
2482 + packet.hdr.type = VS_QUERY_RESPONSE_PACKET_HEADER;
2483 + packet.hdr.len = sizeof(struct hvsi_query_response);
2484 +- packet.hdr.seqno = atomic_inc_return(&hp->seqno);
2485 ++ packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
2486 + packet.verb = VSV_SEND_VERSION_NUMBER;
2487 + packet.u.version = HVSI_VERSION;
2488 + packet.query_seqno = query_seqno+1;
2489 +@@ -581,7 +581,7 @@ static int hvsi_query(struct hvsi_struct *hp, uint16_t verb)
2490 +
2491 + packet.hdr.type = VS_QUERY_PACKET_HEADER;
2492 + packet.hdr.len = sizeof(struct hvsi_query);
2493 +- packet.hdr.seqno = atomic_inc_return(&hp->seqno);
2494 ++ packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
2495 + packet.verb = verb;
2496 +
2497 + pr_debug("%s: sending %i bytes\n", __func__, packet.hdr.len);
2498 +@@ -623,7 +623,7 @@ static int hvsi_set_mctrl(struct hvsi_struct *hp, uint16_t mctrl)
2499 + int wrote;
2500 +
2501 + packet.hdr.type = VS_CONTROL_PACKET_HEADER,
2502 +- packet.hdr.seqno = atomic_inc_return(&hp->seqno);
2503 ++ packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
2504 + packet.hdr.len = sizeof(struct hvsi_control);
2505 + packet.verb = VSV_SET_MODEM_CTL;
2506 + packet.mask = HVSI_TSDTR;
2507 +@@ -706,7 +706,7 @@ static int hvsi_put_chars(struct hvsi_struct *hp, const char *buf, int count)
2508 + BUG_ON(count > HVSI_MAX_OUTGOING_DATA);
2509 +
2510 + packet.hdr.type = VS_DATA_PACKET_HEADER;
2511 +- packet.hdr.seqno = atomic_inc_return(&hp->seqno);
2512 ++ packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
2513 + packet.hdr.len = count + sizeof(struct hvsi_header);
2514 + memcpy(&packet.data, buf, count);
2515 +
2516 +@@ -723,7 +723,7 @@ static void hvsi_close_protocol(struct hvsi_struct *hp)
2517 + struct hvsi_control packet __ALIGNED__;
2518 +
2519 + packet.hdr.type = VS_CONTROL_PACKET_HEADER;
2520 +- packet.hdr.seqno = atomic_inc_return(&hp->seqno);
2521 ++ packet.hdr.seqno = atomic_inc_return_unchecked(&hp->seqno);
2522 + packet.hdr.len = 6;
2523 + packet.verb = VSV_CLOSE_PROTOCOL;
2524 +
2525 +@@ -755,7 +755,7 @@ static int hvsi_open(struct tty_struct *tty, struct file *filp)
2526 + spin_lock_irqsave(&hp->lock, flags);
2527 + hp->tty = tty;
2528 + hp->count++;
2529 +- atomic_set(&hp->seqno, 0);
2530 ++ atomic_set_unchecked(&hp->seqno, 0);
2531 + h_vio_signal(hp->vtermno, VIO_IRQ_ENABLE);
2532 + spin_unlock_irqrestore(&hp->lock, flags);
2533 +
2534 +diff --git a/drivers/tty/hvc/hvsi_lib.c b/drivers/tty/hvc/hvsi_lib.c
2535 +index 6f4dd83..84c3f91 100644
2536 +--- a/drivers/tty/hvc/hvsi_lib.c
2537 ++++ b/drivers/tty/hvc/hvsi_lib.c
2538 +@@ -9,7 +9,7 @@
2539 +
2540 + static int hvsi_send_packet(struct hvsi_priv *pv, struct hvsi_header *packet)
2541 + {
2542 +- packet->seqno = atomic_inc_return(&pv->seqno);
2543 ++ packet->seqno = atomic_inc_return_unchecked(&pv->seqno);
2544 +
2545 + /* Assumes that always succeeds, works in practice */
2546 + return pv->put_chars(pv->termno, (char *)packet, packet->len);
2547 +@@ -21,7 +21,7 @@ static void hvsi_start_handshake(struct hvsi_priv *pv)
2548 +
2549 + /* Reset state */
2550 + pv->established = 0;
2551 +- atomic_set(&pv->seqno, 0);
2552 ++ atomic_set_unchecked(&pv->seqno, 0);
2553 +
2554 + pr_devel("HVSI@%x: Handshaking started\n", pv->termno);
2555 +
2556 +@@ -265,7 +265,7 @@ int hvsilib_read_mctrl(struct hvsi_priv *pv)
2557 + pv->mctrl_update = 0;
2558 + q.hdr.type = VS_QUERY_PACKET_HEADER;
2559 + q.hdr.len = sizeof(struct hvsi_query);
2560 +- q.hdr.seqno = atomic_inc_return(&pv->seqno);
2561 ++ q.hdr.seqno = atomic_inc_return_unchecked(&pv->seqno);
2562 + q.verb = VSV_SEND_MODEM_CTL_STATUS;
2563 + rc = hvsi_send_packet(pv, &q.hdr);
2564 + if (rc <= 0) {
2565 diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c
2566 index ef92869..f4ebd88 100644
2567 --- a/drivers/tty/ipwireless/tty.c
2568 @@ -44036,6 +44514,37 @@ index 4735928..e80860a 100644
2569
2570 cdev_init(&ptmx_cdev, &ptmx_fops);
2571 if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) ||
2572 +diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c
2573 +index 6b36c15..335a4a2 100644
2574 +--- a/drivers/tty/serial/ioc4_serial.c
2575 ++++ b/drivers/tty/serial/ioc4_serial.c
2576 +@@ -438,7 +438,7 @@ struct ioc4_soft {
2577 + } is_intr_info[MAX_IOC4_INTR_ENTS];
2578 +
2579 + /* Number of entries active in the above array */
2580 +- atomic_t is_num_intrs;
2581 ++ atomic_unchecked_t is_num_intrs;
2582 + } is_intr_type[IOC4_NUM_INTR_TYPES];
2583 +
2584 + /* is_ir_lock must be held while
2585 +@@ -975,7 +975,7 @@ intr_connect(struct ioc4_soft *soft, int type,
2586 + BUG_ON(!((type == IOC4_SIO_INTR_TYPE)
2587 + || (type == IOC4_OTHER_INTR_TYPE)));
2588 +
2589 +- i = atomic_inc(&soft-> is_intr_type[type].is_num_intrs) - 1;
2590 ++ i = atomic_inc_return_unchecked(&soft-> is_intr_type[type].is_num_intrs) - 1;
2591 + BUG_ON(!(i < MAX_IOC4_INTR_ENTS || (printk("i %d\n", i), 0)));
2592 +
2593 + /* Save off the lower level interrupt handler */
2594 +@@ -1002,7 +1002,7 @@ static irqreturn_t ioc4_intr(int irq, void *arg)
2595 +
2596 + soft = arg;
2597 + for (intr_type = 0; intr_type < IOC4_NUM_INTR_TYPES; intr_type++) {
2598 +- num_intrs = (int)atomic_read(
2599 ++ num_intrs = (int)atomic_read_unchecked(
2600 + &soft->is_intr_type[intr_type].is_num_intrs);
2601 +
2602 + this_mir = this_ir = pending_intrs(soft, intr_type);
2603 diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
2604 index 2b42a01..32a2ed3 100644
2605 --- a/drivers/tty/serial/kgdboc.c
2606 @@ -44138,6 +44647,28 @@ index 2b42a01..32a2ed3 100644
2607 #ifdef CONFIG_KGDB_SERIAL_CONSOLE
2608 /* This is only available if kgdboc is a built in for early debugging */
2609 static int __init kgdboc_early_init(char *opt)
2610 +diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
2611 +index 8131e2c..b48928a 100644
2612 +--- a/drivers/tty/serial/msm_serial.c
2613 ++++ b/drivers/tty/serial/msm_serial.c
2614 +@@ -857,7 +857,7 @@ static struct uart_driver msm_uart_driver = {
2615 + .cons = MSM_CONSOLE,
2616 + };
2617 +
2618 +-static atomic_t msm_uart_next_id = ATOMIC_INIT(0);
2619 ++static atomic_unchecked_t msm_uart_next_id = ATOMIC_INIT(0);
2620 +
2621 + static int __init msm_serial_probe(struct platform_device *pdev)
2622 + {
2623 +@@ -867,7 +867,7 @@ static int __init msm_serial_probe(struct platform_device *pdev)
2624 + int irq;
2625 +
2626 + if (pdev->id == -1)
2627 +- pdev->id = atomic_inc_return(&msm_uart_next_id) - 1;
2628 ++ pdev->id = atomic_inc_return_unchecked(&msm_uart_next_id) - 1;
2629 +
2630 + if (unlikely(pdev->id < 0 || pdev->id >= UART_NR))
2631 + return -ENXIO;
2632 diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
2633 index b31f1c3..1b6b8c4 100644
2634 --- a/drivers/tty/serial/samsung.c
2635 @@ -44698,6 +45229,28 @@ index 7138540..2370195 100644
2636
2637 /*----------------------------------------------------------------------*/
2638
2639 +diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
2640 +index 9f7003e..b1db1b6 100644
2641 +--- a/drivers/usb/misc/appledisplay.c
2642 ++++ b/drivers/usb/misc/appledisplay.c
2643 +@@ -83,7 +83,7 @@ struct appledisplay {
2644 + spinlock_t lock;
2645 + };
2646 +
2647 +-static atomic_t count_displays = ATOMIC_INIT(0);
2648 ++static atomic_unchecked_t count_displays = ATOMIC_INIT(0);
2649 + static struct workqueue_struct *wq;
2650 +
2651 + static void appledisplay_complete(struct urb *urb)
2652 +@@ -281,7 +281,7 @@ static int appledisplay_probe(struct usb_interface *iface,
2653 +
2654 + /* Register backlight device */
2655 + snprintf(bl_name, sizeof(bl_name), "appledisplay%d",
2656 +- atomic_inc_return(&count_displays) - 1);
2657 ++ atomic_inc_return_unchecked(&count_displays) - 1);
2658 + memset(&props, 0, sizeof(struct backlight_properties));
2659 + props.type = BACKLIGHT_RAW;
2660 + props.max_brightness = 0xff;
2661 diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c
2662 index e39b188..1fffda8 100644
2663 --- a/drivers/usb/storage/realtek_cr.c
2664 @@ -48354,6 +48907,28 @@ index b31507d..5b42a3b 100644
2665
2666 static int __init init_affs_fs(void)
2667 {
2668 +diff --git a/fs/afs/inode.c b/fs/afs/inode.c
2669 +index d890ae3..5733a4b 100644
2670 +--- a/fs/afs/inode.c
2671 ++++ b/fs/afs/inode.c
2672 +@@ -141,7 +141,7 @@ struct inode *afs_iget_autocell(struct inode *dir, const char *dev_name,
2673 + struct afs_vnode *vnode;
2674 + struct super_block *sb;
2675 + struct inode *inode;
2676 +- static atomic_t afs_autocell_ino;
2677 ++ static atomic_unchecked_t afs_autocell_ino;
2678 +
2679 + _enter("{%x:%u},%*.*s,",
2680 + AFS_FS_I(dir)->fid.vid, AFS_FS_I(dir)->fid.vnode,
2681 +@@ -154,7 +154,7 @@ struct inode *afs_iget_autocell(struct inode *dir, const char *dev_name,
2682 + data.fid.unique = 0;
2683 + data.fid.vnode = 0;
2684 +
2685 +- inode = iget5_locked(sb, atomic_inc_return(&afs_autocell_ino),
2686 ++ inode = iget5_locked(sb, atomic_inc_return_unchecked(&afs_autocell_ino),
2687 + afs_iget5_autocell_test, afs_iget5_set,
2688 + &data);
2689 + if (!inode) {
2690 diff --git a/fs/afs/super.c b/fs/afs/super.c
2691 index 356dcf0..c0046cd 100644
2692 --- a/fs/afs/super.c
2693 @@ -52432,9 +53007,18 @@ index 78b519c..0386555 100644
2694
2695 task_unlock(current);
2696 diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
2697 -index 9905350..02eaec4 100644
2698 +index 9905350..97ff49a 100644
2699 --- a/fs/fscache/cookie.c
2700 +++ b/fs/fscache/cookie.c
2701 +@@ -19,7 +19,7 @@
2702 +
2703 + struct kmem_cache *fscache_cookie_jar;
2704 +
2705 +-static atomic_t fscache_object_debug_id = ATOMIC_INIT(0);
2706 ++static atomic_unchecked_t fscache_object_debug_id = ATOMIC_INIT(0);
2707 +
2708 + static int fscache_acquire_non_index_cookie(struct fscache_cookie *cookie);
2709 + static int fscache_alloc_object(struct fscache_cache *cache,
2710 @@ -68,11 +68,11 @@ struct fscache_cookie *__fscache_acquire_cookie(
2711 parent ? (char *) parent->def->name : "<no-parent>",
2712 def->name, netfs_data);
2713 @@ -52500,7 +53084,7 @@ index 9905350..02eaec4 100644
2714 _leave(" = -ENOMEDIUM [no cache]");
2715 return -ENOMEDIUM;
2716 }
2717 -@@ -256,12 +256,12 @@ static int fscache_alloc_object(struct fscache_cache *cache,
2718 +@@ -256,14 +256,14 @@ static int fscache_alloc_object(struct fscache_cache *cache,
2719 object = cache->ops->alloc_object(cache, cookie);
2720 fscache_stat_d(&fscache_n_cop_alloc_object);
2721 if (IS_ERR(object)) {
2722 @@ -52513,8 +53097,11 @@ index 9905350..02eaec4 100644
2723 - fscache_stat(&fscache_n_object_alloc);
2724 + fscache_stat_unchecked(&fscache_n_object_alloc);
2725
2726 - object->debug_id = atomic_inc_return(&fscache_object_debug_id);
2727 +- object->debug_id = atomic_inc_return(&fscache_object_debug_id);
2728 ++ object->debug_id = atomic_inc_return_unchecked(&fscache_object_debug_id);
2729
2730 + _debug("ALLOC OBJ%x: %s {%lx}",
2731 + object->debug_id, cookie->def->name, object->events);
2732 @@ -377,10 +377,10 @@ void __fscache_update_cookie(struct fscache_cookie *cookie)
2733 struct fscache_object *object;
2734 struct hlist_node *_p;
2735 @@ -55319,9 +55906,18 @@ index 99e3610..02c1068 100644
2736 "inode 0x%lx or driver bug.", vdir->i_ino);
2737 goto err_out;
2738 diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
2739 -index c587e2d..3641eaa 100644
2740 +index c587e2d..5189f0f 100644
2741 --- a/fs/ntfs/file.c
2742 +++ b/fs/ntfs/file.c
2743 +@@ -1281,7 +1281,7 @@ static inline size_t ntfs_copy_from_user(struct page **pages,
2744 + char *addr;
2745 + size_t total = 0;
2746 + unsigned len;
2747 +- int left;
2748 ++ unsigned left;
2749 +
2750 + do {
2751 + len = PAGE_CACHE_SIZE - ofs;
2752 @@ -2229,6 +2229,6 @@ const struct inode_operations ntfs_file_inode_ops = {
2753 #endif /* NTFS_RW */
2754 };
2755 @@ -55332,9 +55928,36 @@ index c587e2d..3641eaa 100644
2756 -const struct inode_operations ntfs_empty_inode_ops = {};
2757 +const struct inode_operations ntfs_empty_inode_ops __read_only;
2758 diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
2759 -index b52706d..68a038f 100644
2760 +index b52706d..b9a9f9d 100644
2761 --- a/fs/ntfs/super.c
2762 +++ b/fs/ntfs/super.c
2763 +@@ -661,7 +661,7 @@ static struct buffer_head *read_ntfs_boot_sector(struct super_block *sb,
2764 + if (!silent)
2765 + ntfs_error(sb, "Primary boot sector is invalid.");
2766 + } else if (!silent)
2767 +- ntfs_error(sb, read_err_str, "primary");
2768 ++ ntfs_error(sb, read_err_str, "%s", "primary");
2769 + if (!(NTFS_SB(sb)->on_errors & ON_ERRORS_RECOVER)) {
2770 + if (bh_primary)
2771 + brelse(bh_primary);
2772 +@@ -677,7 +677,7 @@ static struct buffer_head *read_ntfs_boot_sector(struct super_block *sb,
2773 + goto hotfix_primary_boot_sector;
2774 + brelse(bh_backup);
2775 + } else if (!silent)
2776 +- ntfs_error(sb, read_err_str, "backup");
2777 ++ ntfs_error(sb, read_err_str, "%s", "backup");
2778 + /* Try to read NT3.51- backup boot sector. */
2779 + if ((bh_backup = sb_bread(sb, nr_blocks >> 1))) {
2780 + if (is_boot_sector_ntfs(sb, (NTFS_BOOT_SECTOR*)
2781 +@@ -688,7 +688,7 @@ static struct buffer_head *read_ntfs_boot_sector(struct super_block *sb,
2782 + "sector.");
2783 + brelse(bh_backup);
2784 + } else if (!silent)
2785 +- ntfs_error(sb, read_err_str, "backup");
2786 ++ ntfs_error(sb, read_err_str, "%s", "backup");
2787 + /* We failed. Cleanup and return. */
2788 + if (bh_primary)
2789 + brelse(bh_primary);
2790 @@ -3072,6 +3072,7 @@ static struct file_system_type ntfs_fs_type = {
2791 .kill_sb = kill_block_super,
2792 .fs_flags = FS_REQUIRES_DEV,
2793 @@ -75071,6 +75694,19 @@ index c7c40f1..5c31482 100644
2794 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
2795 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
2796 unsigned int (*poll) (struct file *, struct poll_table_struct *);
2797 +diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
2798 +index d61febf..f0094f6 100644
2799 +--- a/include/media/v4l2-device.h
2800 ++++ b/include/media/v4l2-device.h
2801 +@@ -95,7 +95,7 @@ int __must_check v4l2_device_register(struct device *dev, struct v4l2_device *v4
2802 + this function returns 0. If the name ends with a digit (e.g. cx18),
2803 + then the name will be set to cx18-0 since cx180 looks really odd. */
2804 + int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
2805 +- atomic_t *instance);
2806 ++ atomic_unchecked_t *instance);
2807 +
2808 + /* Set v4l2_dev->dev to NULL. Call when the USB parent disconnects.
2809 + Since the parent disappears this ensures that v4l2_dev doesn't have an
2810 diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
2811 index 4d1c74a..8e58054 100644
2812 --- a/include/media/v4l2-ioctl.h
2813 @@ -75172,7 +75808,7 @@ index ca2755f..85ec88c 100644
2814 /** inet_connection_sock - INET connection oriented sock
2815 *
2816 diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
2817 -index e9ff3fc..9d3e5c7 100644
2818 +index e9ff3fc..c19998a 100644
2819 --- a/include/net/inetpeer.h
2820 +++ b/include/net/inetpeer.h
2821 @@ -48,8 +48,8 @@ struct inet_peer {
2822 @@ -75186,20 +75822,28 @@ index e9ff3fc..9d3e5c7 100644
2823 __u32 tcp_ts;
2824 __u32 tcp_ts_stamp;
2825 };
2826 -@@ -113,11 +113,11 @@ static inline int inet_getid(struct inet_peer *p, int more)
2827 +@@ -109,16 +109,13 @@ static inline void inet_peer_refcheck(const struct inet_peer *p)
2828 + /* can be called with or without local BH being disabled */
2829 + static inline int inet_getid(struct inet_peer *p, int more)
2830 + {
2831 +- int old, new;
2832 ++ int id;
2833 more++;
2834 inet_peer_refcheck(p);
2835 - do {
2836 +- do {
2837 - old = atomic_read(&p->ip_id_count);
2838 -+ old = atomic_read_unchecked(&p->ip_id_count);
2839 - new = old + more;
2840 - if (!new)
2841 - new = 1;
2842 +- new = old + more;
2843 +- if (!new)
2844 +- new = 1;
2845 - } while (atomic_cmpxchg(&p->ip_id_count, old, new) != old);
2846 -+ } while (atomic_cmpxchg_unchecked(&p->ip_id_count, old, new) != old);
2847 - return new;
2848 +- return new;
2849 ++ id = atomic_add_return_unchecked(more, &p->ip_id_count);
2850 ++ if (!id)
2851 ++ id = atomic_inc_return_unchecked(&p->ip_id_count);
2852 ++ return id;
2853 }
2854
2855 + #endif /* _NET_INETPEER_H */
2856 diff --git a/include/net/ip.h b/include/net/ip.h
2857 index eca0ef7..88118cb 100644
2858 --- a/include/net/ip.h
2859 @@ -77361,6 +78005,19 @@ index 8be9b746..cb7b792 100644
2860 &parent_event->child_total_time_running);
2861
2862 /*
2863 +diff --git a/kernel/events/internal.h b/kernel/events/internal.h
2864 +index a2101bb..f2e0354 100644
2865 +--- a/kernel/events/internal.h
2866 ++++ b/kernel/events/internal.h
2867 +@@ -78,7 +78,7 @@ static unsigned long perf_data_size(struct ring_buffer *rb)
2868 +
2869 + static inline void
2870 + __output_copy(struct perf_output_handle *handle,
2871 +- const void *buf, unsigned int len)
2872 ++ const void *buf, unsigned long len)
2873 + {
2874 + do {
2875 + unsigned long size = min_t(unsigned long, handle->size, len);
2876 diff --git a/kernel/exit.c b/kernel/exit.c
2877 index 234e152..0ae0243 100644
2878 --- a/kernel/exit.c
2879 @@ -77796,7 +78453,7 @@ index ce0c182..16fd1e0 100644
2880 else
2881 new_fs = fs;
2882 diff --git a/kernel/futex.c b/kernel/futex.c
2883 -index 1d0538e..58e6a1a 100644
2884 +index 1d0538e..04de80f 100644
2885 --- a/kernel/futex.c
2886 +++ b/kernel/futex.c
2887 @@ -54,6 +54,7 @@
2888 @@ -77819,6 +78476,15 @@ index 1d0538e..58e6a1a 100644
2889 /*
2890 * The futex address must be "naturally" aligned.
2891 */
2892 +@@ -438,7 +444,7 @@ static int cmpxchg_futex_value_locked(u32 *curval, u32 __user *uaddr,
2893 +
2894 + static int get_futex_value_locked(u32 *dest, u32 __user *from)
2895 + {
2896 +- int ret;
2897 ++ unsigned long ret;
2898 +
2899 + pagefault_disable();
2900 + ret = __copy_from_user_inatomic(dest, from, sizeof(u32));
2901 @@ -2744,6 +2750,7 @@ static int __init futex_init(void)
2902 {
2903 u32 curval;
2904 @@ -82139,6 +82805,26 @@ index c3c3f6b..7d8dbdc 100644
2905
2906 #undef FTRACE_ENTRY
2907 #define FTRACE_ENTRY(call, struct_name, id, tstruct, print) \
2908 +diff --git a/kernel/trace/trace_clock.c b/kernel/trace/trace_clock.c
2909 +index 3947835..8c0488b 100644
2910 +--- a/kernel/trace/trace_clock.c
2911 ++++ b/kernel/trace/trace_clock.c
2912 +@@ -114,7 +114,7 @@ u64 notrace trace_clock_global(void)
2913 + return now;
2914 + }
2915 +
2916 +-static atomic64_t trace_counter;
2917 ++static atomic64_unchecked_t trace_counter;
2918 +
2919 + /*
2920 + * trace_clock_counter(): simply an atomic counter.
2921 +@@ -123,5 +123,5 @@ static atomic64_t trace_counter;
2922 + */
2923 + u64 notrace trace_clock_counter(void)
2924 + {
2925 +- return atomic64_add_return(1, &trace_counter);
2926 ++ return atomic64_add_return_unchecked(1, &trace_counter);
2927 + }
2928 diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
2929 index c212a7f..a2560bc 100644
2930 --- a/kernel/trace/trace_events.c
2931 @@ -83090,7 +83776,7 @@ index 2b49dd2..0527d62 100644
2932 bdi_destroy(bdi);
2933 return err;
2934 diff --git a/mm/filemap.c b/mm/filemap.c
2935 -index 556858c..ec09758 100644
2936 +index 556858c..71a567d 100644
2937 --- a/mm/filemap.c
2938 +++ b/mm/filemap.c
2939 @@ -1773,7 +1773,7 @@ int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
2940 @@ -83102,6 +83788,42 @@ index 556858c..ec09758 100644
2941 file_accessed(file);
2942 vma->vm_ops = &generic_file_vm_ops;
2943 vma->vm_flags |= VM_CAN_NONLINEAR;
2944 +@@ -2021,7 +2021,7 @@ static size_t __iovec_copy_from_user_inatomic(char *vaddr,
2945 +
2946 + while (bytes) {
2947 + char __user *buf = iov->iov_base + base;
2948 +- int copy = min(bytes, iov->iov_len - base);
2949 ++ size_t copy = min(bytes, iov->iov_len - base);
2950 +
2951 + base = 0;
2952 + left = __copy_from_user_inatomic(vaddr, buf, copy);
2953 +@@ -2050,7 +2050,7 @@ size_t iov_iter_copy_from_user_atomic(struct page *page,
2954 + BUG_ON(!in_atomic());
2955 + kaddr = kmap_atomic(page, KM_USER0);
2956 + if (likely(i->nr_segs == 1)) {
2957 +- int left;
2958 ++ size_t left;
2959 + char __user *buf = i->iov->iov_base + i->iov_offset;
2960 + left = __copy_from_user_inatomic(kaddr + offset, buf, bytes);
2961 + copied = bytes - left;
2962 +@@ -2078,7 +2078,7 @@ size_t iov_iter_copy_from_user(struct page *page,
2963 +
2964 + kaddr = kmap(page);
2965 + if (likely(i->nr_segs == 1)) {
2966 +- int left;
2967 ++ size_t left;
2968 + char __user *buf = i->iov->iov_base + i->iov_offset;
2969 + left = __copy_from_user(kaddr + offset, buf, bytes);
2970 + copied = bytes - left;
2971 +@@ -2108,7 +2108,7 @@ void iov_iter_advance(struct iov_iter *i, size_t bytes)
2972 + * zero-length segments (without overruning the iovec).
2973 + */
2974 + while (bytes || unlikely(i->count && !iov->iov_len)) {
2975 +- int copy;
2976 ++ size_t copy;
2977 +
2978 + copy = min(bytes, iov->iov_len - base);
2979 + BUG_ON(!i->count || i->count < copy);
2980 @@ -2179,6 +2179,7 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i
2981 *pos = i_size_read(inode);
2982
2983 @@ -89687,6 +90409,19 @@ index 39a2d29..f39c0fe 100644
2984 ---help---
2985 Econet is a fairly old and slow networking protocol mainly used by
2986 Acorn computers to access file and print servers. It uses native
2987 +diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
2988 +index 19d6aef..4f610f4 100644
2989 +--- a/net/ieee802154/6lowpan.c
2990 ++++ b/net/ieee802154/6lowpan.c
2991 +@@ -329,7 +329,7 @@ static int lowpan_header_create(struct sk_buff *skb,
2992 + hc06_ptr += 3;
2993 + } else {
2994 + /* compress nothing */
2995 +- memcpy(hc06_ptr, &hdr, 4);
2996 ++ memcpy(hc06_ptr, hdr, 4);
2997 + /* replace the top byte with new ECN | DSCP format */
2998 + *hc06_ptr = tmp;
2999 + hc06_ptr += 4;
3000 diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
3001 index 5d228de..91bdee5 100644
3002 --- a/net/ipv4/af_inet.c
3003 @@ -91119,6 +91854,39 @@ index 1567fb1..29af910 100644
3004 __sk_dst_reset(sk);
3005 dst = NULL;
3006 }
3007 +diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
3008 +index db60043..33181b7 100644
3009 +--- a/net/ipv6/ip6_output.c
3010 ++++ b/net/ipv6/ip6_output.c
3011 +@@ -600,8 +600,8 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)
3012 +
3013 + void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
3014 + {
3015 +- static atomic_t ipv6_fragmentation_id;
3016 +- int old, new;
3017 ++ static atomic_unchecked_t ipv6_fragmentation_id;
3018 ++ int id;
3019 +
3020 + if (rt && !(rt->dst.flags & DST_NOPEER)) {
3021 + struct inet_peer *peer;
3022 +@@ -614,13 +614,10 @@ void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
3023 + return;
3024 + }
3025 + }
3026 +- do {
3027 +- old = atomic_read(&ipv6_fragmentation_id);
3028 +- new = old + 1;
3029 +- if (!new)
3030 +- new = 1;
3031 +- } while (atomic_cmpxchg(&ipv6_fragmentation_id, old, new) != old);
3032 +- fhdr->identification = htonl(new);
3033 ++ id = atomic_inc_return_unchecked(&ipv6_fragmentation_id);
3034 ++ if (!id)
3035 ++ id = atomic_inc_return_unchecked(&ipv6_fragmentation_id);
3036 ++ fhdr->identification = htonl(id);
3037 + }
3038 +
3039 + int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
3040 diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
3041 index b204df8..8f274f4 100644
3042 --- a/net/ipv6/ipv6_sockglue.c
3043 @@ -91182,9 +91950,18 @@ index 94874b0..a47969c 100644
3044
3045 case IP6T_SO_GET_ENTRIES:
3046 diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
3047 -index 6e6c2c4..942cebf 100644
3048 +index 6e6c2c4..c97891e 100644
3049 --- a/net/ipv6/raw.c
3050 +++ b/net/ipv6/raw.c
3051 +@@ -109,7 +109,7 @@ found:
3052 + */
3053 + static int icmpv6_filter(const struct sock *sk, const struct sk_buff *skb)
3054 + {
3055 +- struct icmp6hdr *_hdr;
3056 ++ struct icmp6hdr _hdr;
3057 + const struct icmp6hdr *hdr;
3058 +
3059 + hdr = skb_header_pointer(skb, skb_transport_offset(skb),
3060 @@ -376,7 +376,7 @@ static inline int rawv6_rcv_skb(struct sock *sk, struct sk_buff *skb)
3061 {
3062 if ((raw6_sk(sk)->checksum || rcu_access_pointer(sk->sk_filter)) &&
3063 @@ -92244,7 +93021,7 @@ index 14af632..9914188 100644
3064 table = kmemdup(event_sysctl_table, sizeof(event_sysctl_table),
3065 GFP_KERNEL);
3066 diff --git a/net/netfilter/nf_conntrack_proto_dccp.c b/net/netfilter/nf_conntrack_proto_dccp.c
3067 -index 2e664a6..4264602 100644
3068 +index 2e664a6..c854e4a 100644
3069 --- a/net/netfilter/nf_conntrack_proto_dccp.c
3070 +++ b/net/netfilter/nf_conntrack_proto_dccp.c
3071 @@ -391,7 +391,7 @@ struct dccp_net {
3072 @@ -92256,6 +93033,15 @@ index 2e664a6..4264602 100644
3073 #endif
3074 };
3075
3076 +@@ -431,7 +431,7 @@ static bool dccp_new(struct nf_conn *ct, const struct sk_buff *skb,
3077 + const char *msg;
3078 + u_int8_t state;
3079 +
3080 +- dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
3081 ++ dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &_dh);
3082 + BUG_ON(dh == NULL);
3083 +
3084 + state = dccp_state_table[CT_DCCP_ROLE_CLIENT][dh->dccph_type][CT_DCCP_NONE];
3085 @@ -459,7 +459,7 @@ static bool dccp_new(struct nf_conn *ct, const struct sk_buff *skb,
3086
3087 out_invalid:
3088 @@ -92265,6 +93051,24 @@ index 2e664a6..4264602 100644
3089 return false;
3090 }
3091
3092 +@@ -483,7 +483,7 @@ static int dccp_packet(struct nf_conn *ct, const struct sk_buff *skb,
3093 + u_int8_t type, old_state, new_state;
3094 + enum ct_dccp_roles role;
3095 +
3096 +- dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
3097 ++ dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &_dh);
3098 + BUG_ON(dh == NULL);
3099 + type = dh->dccph_type;
3100 +
3101 +@@ -575,7 +575,7 @@ static int dccp_error(struct net *net, struct nf_conn *tmpl,
3102 + unsigned int cscov;
3103 + const char *msg;
3104 +
3105 +- dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
3106 ++ dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &_dh);
3107 + if (dh == NULL) {
3108 + msg = "nf_ct_dccp: short packet ";
3109 + goto out_invalid;
3110 @@ -612,7 +612,7 @@ static int dccp_error(struct net *net, struct nf_conn *tmpl,
3111
3112 out_invalid:
3113 @@ -94907,7 +95711,7 @@ index 113d20e..16d8f04 100644
3114 }
3115
3116 diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
3117 -index 9414b9c..8b3547c 100644
3118 +index 9414b9c..2477932 100644
3119 --- a/net/xfrm/xfrm_state.c
3120 +++ b/net/xfrm/xfrm_state.c
3121 @@ -194,11 +194,13 @@ int xfrm_register_type(const struct xfrm_type *type, unsigned short family)
3122 @@ -94998,6 +95802,19 @@ index 9414b9c..8b3547c 100644
3123 module_put(mode->afinfo->owner);
3124 err = 0;
3125 }
3126 +@@ -1497,10 +1504,10 @@ EXPORT_SYMBOL(xfrm_find_acq_byseq);
3127 + u32 xfrm_get_acqseq(void)
3128 + {
3129 + u32 res;
3130 +- static atomic_t acqseq;
3131 ++ static atomic_unchecked_t acqseq;
3132 +
3133 + do {
3134 +- res = atomic_inc_return(&acqseq);
3135 ++ res = atomic_inc_return_unchecked(&acqseq);
3136 + } while (!res);
3137 +
3138 + return res;
3139 @@ -1985,8 +1992,10 @@ int __xfrm_init_state(struct xfrm_state *x, bool init_replay)
3140 goto error;
3141
3142 @@ -97745,6 +98562,37 @@ index e2f684a..8eed291 100644
3143 int security_real_capable(struct task_struct *tsk, struct user_namespace *ns,
3144 int cap)
3145 {
3146 +diff --git a/security/selinux/avc.c b/security/selinux/avc.c
3147 +index dca1c22..4fa4591 100644
3148 +--- a/security/selinux/avc.c
3149 ++++ b/security/selinux/avc.c
3150 +@@ -59,7 +59,7 @@ struct avc_node {
3151 + struct avc_cache {
3152 + struct hlist_head slots[AVC_CACHE_SLOTS]; /* head for avc_node->list */
3153 + spinlock_t slots_lock[AVC_CACHE_SLOTS]; /* lock for writes */
3154 +- atomic_t lru_hint; /* LRU hint for reclaim scan */
3155 ++ atomic_unchecked_t lru_hint; /* LRU hint for reclaim scan */
3156 + atomic_t active_nodes;
3157 + u32 latest_notif; /* latest revocation notification */
3158 + };
3159 +@@ -173,7 +173,7 @@ void __init avc_init(void)
3160 + spin_lock_init(&avc_cache.slots_lock[i]);
3161 + }
3162 + atomic_set(&avc_cache.active_nodes, 0);
3163 +- atomic_set(&avc_cache.lru_hint, 0);
3164 ++ atomic_set_unchecked(&avc_cache.lru_hint, 0);
3165 +
3166 + avc_node_cachep = kmem_cache_create("avc_node", sizeof(struct avc_node),
3167 + 0, SLAB_PANIC, NULL);
3168 +@@ -251,7 +251,7 @@ static inline int avc_reclaim_node(void)
3169 + spinlock_t *lock;
3170 +
3171 + for (try = 0, ecx = 0; try < AVC_CACHE_SLOTS; try++) {
3172 +- hvalue = atomic_inc_return(&avc_cache.lru_hint) & (AVC_CACHE_SLOTS - 1);
3173 ++ hvalue = atomic_inc_return_unchecked(&avc_cache.lru_hint) & (AVC_CACHE_SLOTS - 1);
3174 + head = &avc_cache.slots[hvalue];
3175 + lock = &avc_cache.slots_lock[hvalue];
3176 +
3177 diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
3178 index 1126c10..effb32b 100644
3179 --- a/security/selinux/hooks.c
3180 @@ -98246,6 +99094,27 @@ index 09d4648..cf234c7 100644
3181
3182 list_add(&s->list, &cs4297a_devs);
3183
3184 +diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
3185 +index faabaa5..9888f8b 100644
3186 +--- a/sound/pci/hda/hda_codec.c
3187 ++++ b/sound/pci/hda/hda_codec.c
3188 +@@ -850,14 +850,10 @@ find_codec_preset(struct hda_codec *codec)
3189 + mutex_unlock(&preset_mutex);
3190 +
3191 + if (mod_requested < HDA_MODREQ_MAX_COUNT) {
3192 +- char name[32];
3193 + if (!mod_requested)
3194 +- snprintf(name, sizeof(name), "snd-hda-codec-id:%08x",
3195 +- codec->vendor_id);
3196 ++ request_module("snd-hda-codec-id:%08x", codec->vendor_id);
3197 + else
3198 +- snprintf(name, sizeof(name), "snd-hda-codec-id:%04x*",
3199 +- (codec->vendor_id >> 16) & 0xffff);
3200 +- request_module(name);
3201 ++ request_module("snd-hda-codec-id:%04x*", (codec->vendor_id >> 16) & 0xffff);
3202 + mod_requested++;
3203 + goto again;
3204 + }
3205 diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
3206 index 03ee4e3..be86b46 100644
3207 --- a/sound/pci/ymfpci/ymfpci_main.c
3208 @@ -99601,10 +100470,10 @@ index 0000000..568b360
3209 +}
3210 diff --git a/tools/gcc/kernexec_plugin.c b/tools/gcc/kernexec_plugin.c
3211 new file mode 100644
3212 -index 0000000..0408e06
3213 +index 0000000..257529f
3214 --- /dev/null
3215 +++ b/tools/gcc/kernexec_plugin.c
3216 -@@ -0,0 +1,465 @@
3217 +@@ -0,0 +1,471 @@
3218 +/*
3219 + * Copyright 2011-2013 by the PaX Team <pageexec@××××××××.hu>
3220 + * Licensed under the GPL v2
3221 @@ -99656,7 +100525,7 @@ index 0000000..0408e06
3222 +int plugin_is_GPL_compatible;
3223 +
3224 +static struct plugin_info kernexec_plugin_info = {
3225 -+ .version = "201302112000",
3226 ++ .version = "201308230150",
3227 + .help = "method=[bts|or]\tinstrumentation method\n"
3228 +};
3229 +
3230 @@ -99807,7 +100676,7 @@ index 0000000..0408e06
3231 +static void kernexec_instrument_fptr_bts(gimple_stmt_iterator *gsi)
3232 +{
3233 + gimple assign_intptr, assign_new_fptr, call_stmt;
3234 -+ tree intptr, old_fptr, new_fptr, kernexec_mask;
3235 ++ tree intptr, orptr, old_fptr, new_fptr, kernexec_mask;
3236 +
3237 + call_stmt = gsi_stmt(*gsi);
3238 + old_fptr = gimple_call_fn(call_stmt);
3239 @@ -99816,16 +100685,20 @@ index 0000000..0408e06
3240 + intptr = create_tmp_var(long_unsigned_type_node, "kernexec_bts");
3241 +#if BUILDING_GCC_VERSION <= 4007
3242 + add_referenced_var(intptr);
3243 -+ mark_sym_for_renaming(intptr);
3244 +#endif
3245 ++ intptr = make_ssa_name(intptr, NULL);
3246 + assign_intptr = gimple_build_assign(intptr, fold_convert(long_unsigned_type_node, old_fptr));
3247 ++ SSA_NAME_DEF_STMT(intptr) = assign_intptr;
3248 + gsi_insert_before(gsi, assign_intptr, GSI_SAME_STMT);
3249 + update_stmt(assign_intptr);
3250 +
3251 + // apply logical or to temporary unsigned long and bitmask
3252 + kernexec_mask = build_int_cstu(long_long_unsigned_type_node, 0x8000000000000000LL);
3253 +// kernexec_mask = build_int_cstu(long_long_unsigned_type_node, 0xffffffff80000000LL);
3254 -+ assign_intptr = gimple_build_assign(intptr, fold_build2(BIT_IOR_EXPR, long_long_unsigned_type_node, intptr, kernexec_mask));
3255 ++ orptr = fold_build2(BIT_IOR_EXPR, long_long_unsigned_type_node, intptr, kernexec_mask);
3256 ++ intptr = make_ssa_name(SSA_NAME_VAR(intptr), NULL);
3257 ++ assign_intptr = gimple_build_assign(intptr, orptr);
3258 ++ SSA_NAME_DEF_STMT(intptr) = assign_intptr;
3259 + gsi_insert_before(gsi, assign_intptr, GSI_SAME_STMT);
3260 + update_stmt(assign_intptr);
3261 +
3262 @@ -99833,9 +100706,10 @@ index 0000000..0408e06
3263 + new_fptr = create_tmp_var(TREE_TYPE(old_fptr), "kernexec_fptr");
3264 +#if BUILDING_GCC_VERSION <= 4007
3265 + add_referenced_var(new_fptr);
3266 -+ mark_sym_for_renaming(new_fptr);
3267 +#endif
3268 ++ new_fptr = make_ssa_name(new_fptr, NULL);
3269 + assign_new_fptr = gimple_build_assign(new_fptr, fold_convert(TREE_TYPE(old_fptr), intptr));
3270 ++ SSA_NAME_DEF_STMT(new_fptr) = assign_new_fptr;
3271 + gsi_insert_before(gsi, assign_new_fptr, GSI_SAME_STMT);
3272 + update_stmt(assign_new_fptr);
3273 +
3274 @@ -99863,8 +100737,8 @@ index 0000000..0408e06
3275 + new_fptr = create_tmp_var(TREE_TYPE(old_fptr), "kernexec_or");
3276 +#if BUILDING_GCC_VERSION <= 4007
3277 + add_referenced_var(new_fptr);
3278 -+ mark_sym_for_renaming(new_fptr);
3279 +#endif
3280 ++ new_fptr = make_ssa_name(new_fptr, NULL);
3281 +
3282 + // build asm volatile("orq %%r10, %0\n\t" : "=r"(new_fptr) : "0"(old_fptr));
3283 + input = build_tree_list(NULL_TREE, build_string(2, "0"));
3284 @@ -99879,6 +100753,7 @@ index 0000000..0408e06
3285 + vec_safe_push(outputs, output);
3286 +#endif
3287 + asm_or_stmt = gimple_build_asm_vec("orq %%r10, %0\n\t", inputs, outputs, NULL, NULL);
3288 ++ SSA_NAME_DEF_STMT(new_fptr) = asm_or_stmt;
3289 + gimple_asm_set_volatile(asm_or_stmt, true);
3290 + gsi_insert_before(gsi, asm_or_stmt, GSI_SAME_STMT);
3291 + update_stmt(asm_or_stmt);
3292 @@ -100072,10 +100947,10 @@ index 0000000..0408e06
3293 +}
3294 diff --git a/tools/gcc/latent_entropy_plugin.c b/tools/gcc/latent_entropy_plugin.c
3295 new file mode 100644
3296 -index 0000000..b5395ba
3297 +index 0000000..2ef6fd9
3298 --- /dev/null
3299 +++ b/tools/gcc/latent_entropy_plugin.c
3300 -@@ -0,0 +1,327 @@
3301 +@@ -0,0 +1,321 @@
3302 +/*
3303 + * Copyright 2012-2013 by the PaX Team <pageexec@××××××××.hu>
3304 + * Licensed under the GPL v2
3305 @@ -100127,7 +101002,7 @@ index 0000000..b5395ba
3306 +static tree latent_entropy_decl;
3307 +
3308 +static struct plugin_info latent_entropy_plugin_info = {
3309 -+ .version = "201303102320",
3310 ++ .version = "201308230230",
3311 + .help = NULL
3312 +};
3313 +
3314 @@ -100236,13 +101111,10 @@ index 0000000..b5395ba
3315 + op = get_op(&rhs);
3316 + addxorrol = fold_build2_loc(UNKNOWN_LOCATION, op, unsigned_intDI_type_node, local_entropy, rhs);
3317 + assign = gimple_build_assign(local_entropy, addxorrol);
3318 -+#if BUILDING_GCC_VERSION <= 4007
3319 -+ find_referenced_vars_in(assign);
3320 -+#endif
3321 -+//debug_bb(bb);
3322 + gsi = gsi_after_labels(bb);
3323 + gsi_insert_before(&gsi, assign, GSI_NEW_STMT);
3324 + update_stmt(assign);
3325 ++//debug_bb(bb);
3326 +}
3327 +
3328 +static void perturb_latent_entropy(basic_block bb, tree rhs)
3329 @@ -100255,13 +101127,14 @@ index 0000000..b5395ba
3330 + temp = create_tmp_var(unsigned_intDI_type_node, "temp_latent_entropy");
3331 +#if BUILDING_GCC_VERSION <= 4007
3332 + add_referenced_var(temp);
3333 -+ mark_sym_for_renaming(temp);
3334 +#endif
3335 +
3336 + // 2. read...
3337 ++ temp = make_ssa_name(temp, NULL);
3338 + assign = gimple_build_assign(temp, latent_entropy_decl);
3339 ++ SSA_NAME_DEF_STMT(temp) = assign;
3340 +#if BUILDING_GCC_VERSION <= 4007
3341 -+ find_referenced_vars_in(assign);
3342 ++ add_referenced_var(latent_entropy_decl);
3343 +#endif
3344 + gsi = gsi_after_labels(bb);
3345 + gsi_insert_after(&gsi, assign, GSI_NEW_STMT);
3346 @@ -100269,18 +101142,14 @@ index 0000000..b5395ba
3347 +
3348 + // 3. ...modify...
3349 + addxorrol = fold_build2_loc(UNKNOWN_LOCATION, get_op(NULL), unsigned_intDI_type_node, temp, rhs);
3350 ++ temp = make_ssa_name(SSA_NAME_VAR(temp), NULL);
3351 + assign = gimple_build_assign(temp, addxorrol);
3352 -+#if BUILDING_GCC_VERSION <= 4007
3353 -+ find_referenced_vars_in(assign);
3354 -+#endif
3355 ++ SSA_NAME_DEF_STMT(temp) = assign;
3356 + gsi_insert_after(&gsi, assign, GSI_NEW_STMT);
3357 + update_stmt(assign);
3358 +
3359 + // 4. ...write latent_entropy
3360 + assign = gimple_build_assign(latent_entropy_decl, temp);
3361 -+#if BUILDING_GCC_VERSION <= 4007
3362 -+ find_referenced_vars_in(assign);
3363 -+#endif
3364 + gsi_insert_after(&gsi, assign, GSI_NEW_STMT);
3365 + update_stmt(assign);
3366 +}
3367 @@ -100331,21 +101200,21 @@ index 0000000..b5395ba
3368 +
3369 + assign = gimple_build_assign(local_entropy, build_int_cstu(unsigned_intDI_type_node, get_random_const()));
3370 +// gimple_set_location(assign, loc);
3371 -+#if BUILDING_GCC_VERSION <= 4007
3372 -+ find_referenced_vars_in(assign);
3373 -+#endif
3374 + gsi_insert_after(&gsi, assign, GSI_NEW_STMT);
3375 + update_stmt(assign);
3376 ++//debug_bb(bb);
3377 + bb = bb->next_bb;
3378 +
3379 + // 3. instrument each BB with an operation on the local entropy variable
3380 + while (bb != EXIT_BLOCK_PTR) {
3381 + perturb_local_entropy(bb, local_entropy);
3382 ++//debug_bb(bb);
3383 + bb = bb->next_bb;
3384 + };
3385 +
3386 + // 4. mix local entropy into the global entropy variable
3387 + perturb_latent_entropy(EXIT_BLOCK_PTR->prev_bb, local_entropy);
3388 ++//debug_bb(EXIT_BLOCK_PTR->prev_bb);
3389 + return 0;
3390 +}
3391 +
3392 @@ -105195,10 +106064,10 @@ index 0000000..6fcc08d
3393 +alloc_dr_65495 alloc_dr 2 65495 NULL
3394 diff --git a/tools/gcc/size_overflow_plugin.c b/tools/gcc/size_overflow_plugin.c
3395 new file mode 100644
3396 -index 0000000..9db0d0e
3397 +index 0000000..03d0c84
3398 --- /dev/null
3399 +++ b/tools/gcc/size_overflow_plugin.c
3400 -@@ -0,0 +1,2114 @@
3401 +@@ -0,0 +1,2113 @@
3402 +/*
3403 + * Copyright 2011, 2012, 2013 by Emese Revfy <re.emese@×××××.com>
3404 + * Licensed under the GPL v2, or (at your option) v3
3405 @@ -105288,7 +106157,7 @@ index 0000000..9db0d0e
3406 +static void print_missing_msg(tree func, unsigned int argnum);
3407 +
3408 +static struct plugin_info size_overflow_plugin_info = {
3409 -+ .version = "20130410beta",
3410 ++ .version = "20130822beta",
3411 + .help = "no-size-overflow\tturn off size overflow checking\n",
3412 +};
3413 +
3414 @@ -105668,7 +106537,6 @@ index 0000000..9db0d0e
3415 +
3416 +#if BUILDING_GCC_VERSION <= 4007
3417 + add_referenced_var(new_var);
3418 -+ mark_sym_for_renaming(new_var);
3419 +#endif
3420 + return new_var;
3421 +}