aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/oprofile/cell/vma_map.c37
-rw-r--r--arch/powerpc/platforms/pseries/xics.c2
-rw-r--r--drivers/char/n_tty.c2
-rw-r--r--drivers/char/nozomi.c20
-rw-r--r--drivers/crypto/hifn_795x.c28
-rw-r--r--drivers/dma/fsldma.h47
-rw-r--r--drivers/dma/ioat_dca.c4
-rw-r--r--drivers/infiniband/core/addr.c8
-rw-r--r--drivers/infiniband/core/cm.c2
-rw-r--r--drivers/infiniband/core/cma.c24
-rw-r--r--drivers/lguest/lguest_user.c2
-rw-r--r--drivers/media/common/saa7146_core.c13
-rw-r--r--drivers/media/common/saa7146_fops.c2
-rw-r--r--drivers/media/dvb/dvb-core/dvb_net.c4
-rw-r--r--drivers/media/video/adv7170.c2
-rw-r--r--drivers/media/video/adv7175.c2
-rw-r--r--drivers/media/video/bt819.c2
-rw-r--r--drivers/media/video/bt856.c2
-rw-r--r--drivers/media/video/dpc7146.c2
-rw-r--r--drivers/media/video/mt20xx.c2
-rw-r--r--drivers/media/video/mxb.c5
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-ctrl.c4
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c6
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-io.c2
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-ioread.c2
-rw-r--r--drivers/media/video/pwc/pwc-if.c7
-rw-r--r--drivers/media/video/saa7110.c4
-rw-r--r--drivers/media/video/saa7111.c2
-rw-r--r--drivers/media/video/saa7114.c2
-rw-r--r--drivers/media/video/saa7185.c2
-rw-r--r--drivers/media/video/tda9840.c2
-rw-r--r--drivers/media/video/tea6415c.c2
-rw-r--r--drivers/media/video/tea6420.c2
-rw-r--r--drivers/media/video/tvp5150.c4
-rw-r--r--drivers/media/video/zoran_driver.c2
-rw-r--r--drivers/media/video/zr364xx.c2
-rw-r--r--drivers/mfd/asic3.c4
-rw-r--r--drivers/misc/fujitsu-laptop.c2
-rw-r--r--drivers/misc/ibmasm/module.c2
-rw-r--r--drivers/misc/lkdtm.c2
-rw-r--r--drivers/net/dm9000.c2
-rw-r--r--drivers/serial/8250_pci.c7
-rw-r--r--drivers/virtio/virtio_pci.c6
-rw-r--r--fs/cifs/cifsacl.c4
-rw-r--r--fs/jbd/journal.c4
-rw-r--r--fs/jbd/revoke.c4
-rw-r--r--fs/jbd2/journal.c12
-rw-r--r--fs/jbd2/revoke.c4
-rw-r--r--fs/reiserfs/do_balan.c8
-rw-r--r--fs/reiserfs/fix_node.c8
-rw-r--r--fs/reiserfs/lbalance.c2
-rw-r--r--fs/reiserfs/namei.c2
-rw-r--r--fs/smbfs/smbiod.c2
-rw-r--r--include/asm-frv/system.h4
-rw-r--r--include/linux/compat.h4
-rw-r--r--include/linux/dmaengine.h2
-rw-r--r--kernel/cgroup.c4
-rw-r--r--kernel/futex.c2
-rw-r--r--kernel/futex_compat.c2
-rw-r--r--mm/sparse-vmemmap.c8
-rw-r--r--net/rxrpc/ar-internal.h2
-rw-r--r--net/rxrpc/rxkad.c27
62 files changed, 191 insertions, 196 deletions
diff --git a/arch/powerpc/oprofile/cell/vma_map.c b/arch/powerpc/oprofile/cell/vma_map.c
index 76ec1d16aef7..9a932177e70e 100644
--- a/arch/powerpc/oprofile/cell/vma_map.c
+++ b/arch/powerpc/oprofile/cell/vma_map.c
@@ -92,7 +92,7 @@ vma_map_add(struct vma_to_fileoffset_map *map, unsigned int vma,
92 * A pointer to the first vma_map in the generated list 92 * A pointer to the first vma_map in the generated list
93 * of vma_maps is returned. */ 93 * of vma_maps is returned. */
94struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu, 94struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
95 unsigned long spu_elf_start) 95 unsigned long __spu_elf_start)
96{ 96{
97 static const unsigned char expected[EI_PAD] = { 97 static const unsigned char expected[EI_PAD] = {
98 [EI_MAG0] = ELFMAG0, 98 [EI_MAG0] = ELFMAG0,
@@ -107,9 +107,11 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
107 107
108 int grd_val; 108 int grd_val;
109 struct vma_to_fileoffset_map *map = NULL; 109 struct vma_to_fileoffset_map *map = NULL;
110 void __user *spu_elf_start = (void __user *)__spu_elf_start;
110 struct spu_overlay_info ovly; 111 struct spu_overlay_info ovly;
111 unsigned int overlay_tbl_offset = -1; 112 unsigned int overlay_tbl_offset = -1;
112 unsigned long phdr_start, shdr_start; 113 Elf32_Phdr __user *phdr_start;
114 Elf32_Shdr __user *shdr_start;
113 Elf32_Ehdr ehdr; 115 Elf32_Ehdr ehdr;
114 Elf32_Phdr phdr; 116 Elf32_Phdr phdr;
115 Elf32_Shdr shdr, shdr_str; 117 Elf32_Shdr shdr, shdr_str;
@@ -121,12 +123,12 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
121 unsigned int ovly_buf_table_sym = 0; 123 unsigned int ovly_buf_table_sym = 0;
122 unsigned int ovly_table_end_sym = 0; 124 unsigned int ovly_table_end_sym = 0;
123 unsigned int ovly_buf_table_end_sym = 0; 125 unsigned int ovly_buf_table_end_sym = 0;
124 unsigned long ovly_table; 126 struct spu_overlay_info __user *ovly_table;
125 unsigned int n_ovlys; 127 unsigned int n_ovlys;
126 128
127 /* Get and validate ELF header. */ 129 /* Get and validate ELF header. */
128 130
129 if (copy_from_user(&ehdr, (void *) spu_elf_start, sizeof (ehdr))) 131 if (copy_from_user(&ehdr, spu_elf_start, sizeof (ehdr)))
130 goto fail; 132 goto fail;
131 133
132 if (memcmp(ehdr.e_ident, expected, EI_PAD) != 0) { 134 if (memcmp(ehdr.e_ident, expected, EI_PAD) != 0) {
@@ -152,9 +154,7 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
152 154
153 /* Traverse program headers. */ 155 /* Traverse program headers. */
154 for (i = 0; i < ehdr.e_phnum; i++) { 156 for (i = 0; i < ehdr.e_phnum; i++) {
155 if (copy_from_user(&phdr, 157 if (copy_from_user(&phdr, phdr_start + i, sizeof(phdr)))
156 (void *) (phdr_start + i * sizeof(phdr)),
157 sizeof(phdr)))
158 goto fail; 158 goto fail;
159 159
160 if (phdr.p_type != PT_LOAD) 160 if (phdr.p_type != PT_LOAD)
@@ -171,9 +171,7 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
171 pr_debug("SPU_PROF: Created non-overlay maps\n"); 171 pr_debug("SPU_PROF: Created non-overlay maps\n");
172 /* Traverse section table and search for overlay-related symbols. */ 172 /* Traverse section table and search for overlay-related symbols. */
173 for (i = 0; i < ehdr.e_shnum; i++) { 173 for (i = 0; i < ehdr.e_shnum; i++) {
174 if (copy_from_user(&shdr, 174 if (copy_from_user(&shdr, shdr_start + i, sizeof(shdr)))
175 (void *) (shdr_start + i * sizeof(shdr)),
176 sizeof(shdr)))
177 goto fail; 175 goto fail;
178 176
179 if (shdr.sh_type != SHT_SYMTAB) 177 if (shdr.sh_type != SHT_SYMTAB)
@@ -182,8 +180,7 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
182 continue; 180 continue;
183 181
184 if (copy_from_user(&shdr_str, 182 if (copy_from_user(&shdr_str,
185 (void *) (shdr_start + shdr.sh_link * 183 shdr_start + shdr.sh_link,
186 sizeof(shdr)),
187 sizeof(shdr))) 184 sizeof(shdr)))
188 goto fail; 185 goto fail;
189 186
@@ -191,15 +188,15 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
191 goto fail;; 188 goto fail;;
192 189
193 for (j = 0; j < shdr.sh_size / sizeof (sym); j++) { 190 for (j = 0; j < shdr.sh_size / sizeof (sym); j++) {
194 if (copy_from_user(&sym, (void *) (spu_elf_start + 191 if (copy_from_user(&sym, spu_elf_start +
195 shdr.sh_offset + j * 192 shdr.sh_offset +
196 sizeof (sym)), 193 j * sizeof (sym),
197 sizeof (sym))) 194 sizeof (sym)))
198 goto fail; 195 goto fail;
199 196
200 if (copy_from_user(name, (void *) 197 if (copy_from_user(name,
201 (spu_elf_start + shdr_str.sh_offset + 198 spu_elf_start + shdr_str.sh_offset +
202 sym.st_name), 199 sym.st_name,
203 20)) 200 20))
204 goto fail; 201 goto fail;
205 202
@@ -245,9 +242,7 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
245 242
246 /* Traverse overlay table. */ 243 /* Traverse overlay table. */
247 for (i = 0; i < n_ovlys; i++) { 244 for (i = 0; i < n_ovlys; i++) {
248 if (copy_from_user(&ovly, (void *) 245 if (copy_from_user(&ovly, ovly_table + i, sizeof (ovly)))
249 (ovly_table + i * sizeof (ovly)),
250 sizeof (ovly)))
251 goto fail; 246 goto fail;
252 247
253 /* The ovly.vma/size/offset arguments are analogous to the same 248 /* The ovly.vma/size/offset arguments are analogous to the same
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index ca52b587166d..a977f200db89 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -763,7 +763,7 @@ void xics_request_IPIs(void)
763} 763}
764#endif /* CONFIG_SMP */ 764#endif /* CONFIG_SMP */
765 765
766void xics_teardown_cpu() 766void xics_teardown_cpu(void)
767{ 767{
768 int cpu = smp_processor_id(); 768 int cpu = smp_processor_id();
769 769
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 46b2a1cc8b54..0c09409fa45d 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -1183,7 +1183,7 @@ static int copy_from_read_buf(struct tty_struct *tty,
1183 return retval; 1183 return retval;
1184} 1184}
1185 1185
1186extern ssize_t redirected_tty_write(struct file *, const char *, 1186extern ssize_t redirected_tty_write(struct file *, const char __user *,
1187 size_t, loff_t *); 1187 size_t, loff_t *);
1188 1188
1189/** 1189/**
diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c
index 6d0dc5f9b6bb..6a6843a0a674 100644
--- a/drivers/char/nozomi.c
+++ b/drivers/char/nozomi.c
@@ -438,7 +438,7 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
438 u32 size_bytes) 438 u32 size_bytes)
439{ 439{
440 u32 i = 0; 440 u32 i = 0;
441 const u32 *ptr = (__force u32 *) mem_addr_start; 441 const u32 __iomem *ptr = mem_addr_start;
442 u16 *buf16; 442 u16 *buf16;
443 443
444 if (unlikely(!ptr || !buf)) 444 if (unlikely(!ptr || !buf))
@@ -448,11 +448,11 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
448 switch (size_bytes) { 448 switch (size_bytes) {
449 case 2: /* 2 bytes */ 449 case 2: /* 2 bytes */
450 buf16 = (u16 *) buf; 450 buf16 = (u16 *) buf;
451 *buf16 = __le16_to_cpu(readw((void __iomem *)ptr)); 451 *buf16 = __le16_to_cpu(readw(ptr));
452 goto out; 452 goto out;
453 break; 453 break;
454 case 4: /* 4 bytes */ 454 case 4: /* 4 bytes */
455 *(buf) = __le32_to_cpu(readl((void __iomem *)ptr)); 455 *(buf) = __le32_to_cpu(readl(ptr));
456 goto out; 456 goto out;
457 break; 457 break;
458 } 458 }
@@ -461,11 +461,11 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
461 if (size_bytes - i == 2) { 461 if (size_bytes - i == 2) {
462 /* Handle 2 bytes in the end */ 462 /* Handle 2 bytes in the end */
463 buf16 = (u16 *) buf; 463 buf16 = (u16 *) buf;
464 *(buf16) = __le16_to_cpu(readw((void __iomem *)ptr)); 464 *(buf16) = __le16_to_cpu(readw(ptr));
465 i += 2; 465 i += 2;
466 } else { 466 } else {
467 /* Read 4 bytes */ 467 /* Read 4 bytes */
468 *(buf) = __le32_to_cpu(readl((void __iomem *)ptr)); 468 *(buf) = __le32_to_cpu(readl(ptr));
469 i += 4; 469 i += 4;
470 } 470 }
471 buf++; 471 buf++;
@@ -484,7 +484,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
484 u32 size_bytes) 484 u32 size_bytes)
485{ 485{
486 u32 i = 0; 486 u32 i = 0;
487 u32 *ptr = (__force u32 *) mem_addr_start; 487 u32 __iomem *ptr = mem_addr_start;
488 const u16 *buf16; 488 const u16 *buf16;
489 489
490 if (unlikely(!ptr || !buf)) 490 if (unlikely(!ptr || !buf))
@@ -494,7 +494,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
494 switch (size_bytes) { 494 switch (size_bytes) {
495 case 2: /* 2 bytes */ 495 case 2: /* 2 bytes */
496 buf16 = (const u16 *)buf; 496 buf16 = (const u16 *)buf;
497 writew(__cpu_to_le16(*buf16), (void __iomem *)ptr); 497 writew(__cpu_to_le16(*buf16), ptr);
498 return 2; 498 return 2;
499 break; 499 break;
500 case 1: /* 500 case 1: /*
@@ -502,7 +502,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
502 * so falling through.. 502 * so falling through..
503 */ 503 */
504 case 4: /* 4 bytes */ 504 case 4: /* 4 bytes */
505 writel(__cpu_to_le32(*buf), (void __iomem *)ptr); 505 writel(__cpu_to_le32(*buf), ptr);
506 return 4; 506 return 4;
507 break; 507 break;
508 } 508 }
@@ -511,11 +511,11 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
511 if (size_bytes - i == 2) { 511 if (size_bytes - i == 2) {
512 /* 2 bytes */ 512 /* 2 bytes */
513 buf16 = (const u16 *)buf; 513 buf16 = (const u16 *)buf;
514 writew(__cpu_to_le16(*buf16), (void __iomem *)ptr); 514 writew(__cpu_to_le16(*buf16), ptr);
515 i += 2; 515 i += 2;
516 } else { 516 } else {
517 /* 4 bytes */ 517 /* 4 bytes */
518 writel(__cpu_to_le32(*buf), (void __iomem *)ptr); 518 writel(__cpu_to_le32(*buf), ptr);
519 i += 4; 519 i += 4;
520 } 520 }
521 buf++; 521 buf++;
diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
index 3110bf7014f7..81f3f950cd7d 100644
--- a/drivers/crypto/hifn_795x.c
+++ b/drivers/crypto/hifn_795x.c
@@ -392,8 +392,8 @@ static atomic_t hifn_dev_number;
392 392
393struct hifn_desc 393struct hifn_desc
394{ 394{
395 volatile u32 l; 395 volatile __le32 l;
396 volatile u32 p; 396 volatile __le32 p;
397}; 397};
398 398
399struct hifn_dma { 399struct hifn_dma {
@@ -481,10 +481,10 @@ struct hifn_device
481 481
482struct hifn_base_command 482struct hifn_base_command
483{ 483{
484 volatile u16 masks; 484 volatile __le16 masks;
485 volatile u16 session_num; 485 volatile __le16 session_num;
486 volatile u16 total_source_count; 486 volatile __le16 total_source_count;
487 volatile u16 total_dest_count; 487 volatile __le16 total_dest_count;
488}; 488};
489 489
490#define HIFN_BASE_CMD_COMP 0x0100 /* enable compression engine */ 490#define HIFN_BASE_CMD_COMP 0x0100 /* enable compression engine */
@@ -504,10 +504,10 @@ struct hifn_base_command
504 */ 504 */
505struct hifn_crypt_command 505struct hifn_crypt_command
506{ 506{
507 volatile u16 masks; 507 volatile __le16 masks;
508 volatile u16 header_skip; 508 volatile __le16 header_skip;
509 volatile u16 source_count; 509 volatile __le16 source_count;
510 volatile u16 reserved; 510 volatile __le16 reserved;
511}; 511};
512 512
513#define HIFN_CRYPT_CMD_ALG_MASK 0x0003 /* algorithm: */ 513#define HIFN_CRYPT_CMD_ALG_MASK 0x0003 /* algorithm: */
@@ -670,7 +670,7 @@ static inline u32 hifn_read_0(struct hifn_device *dev, u32 reg)
670{ 670{
671 u32 ret; 671 u32 ret;
672 672
673 ret = readl((char *)(dev->bar[0]) + reg); 673 ret = readl(dev->bar[0] + reg);
674 674
675 return ret; 675 return ret;
676} 676}
@@ -679,19 +679,19 @@ static inline u32 hifn_read_1(struct hifn_device *dev, u32 reg)
679{ 679{
680 u32 ret; 680 u32 ret;
681 681
682 ret = readl((char *)(dev->bar[1]) + reg); 682 ret = readl(dev->bar[1] + reg);
683 683
684 return ret; 684 return ret;
685} 685}
686 686
687static inline void hifn_write_0(struct hifn_device *dev, u32 reg, u32 val) 687static inline void hifn_write_0(struct hifn_device *dev, u32 reg, u32 val)
688{ 688{
689 writel(val, (char *)(dev->bar[0]) + reg); 689 writel(val, dev->bar[0] + reg);
690} 690}
691 691
692static inline void hifn_write_1(struct hifn_device *dev, u32 reg, u32 val) 692static inline void hifn_write_1(struct hifn_device *dev, u32 reg, u32 val)
693{ 693{
694 writel(val, (char *)(dev->bar[1]) + reg); 694 writel(val, dev->bar[1] + reg);
695} 695}
696 696
697static void hifn_wait_puc(struct hifn_device *dev) 697static void hifn_wait_puc(struct hifn_device *dev)
diff --git a/drivers/dma/fsldma.h b/drivers/dma/fsldma.h
index fddd6aee2a63..6faf07ba0d0e 100644
--- a/drivers/dma/fsldma.h
+++ b/drivers/dma/fsldma.h
@@ -75,12 +75,15 @@
75#define FSL_DMA_DGSR_EOSI 0x02 75#define FSL_DMA_DGSR_EOSI 0x02
76#define FSL_DMA_DGSR_EOLSI 0x01 76#define FSL_DMA_DGSR_EOLSI 0x01
77 77
78typedef u64 __bitwise v64;
79typedef u32 __bitwise v32;
80
78struct fsl_dma_ld_hw { 81struct fsl_dma_ld_hw {
79 u64 __bitwise src_addr; 82 v64 src_addr;
80 u64 __bitwise dst_addr; 83 v64 dst_addr;
81 u64 __bitwise next_ln_addr; 84 v64 next_ln_addr;
82 u32 __bitwise count; 85 v32 count;
83 u32 __bitwise reserve; 86 v32 reserve;
84} __attribute__((aligned(32))); 87} __attribute__((aligned(32)));
85 88
86struct fsl_desc_sw { 89struct fsl_desc_sw {
@@ -92,13 +95,13 @@ struct fsl_desc_sw {
92} __attribute__((aligned(32))); 95} __attribute__((aligned(32)));
93 96
94struct fsl_dma_chan_regs { 97struct fsl_dma_chan_regs {
95 u32 __bitwise mr; /* 0x00 - Mode Register */ 98 u32 mr; /* 0x00 - Mode Register */
96 u32 __bitwise sr; /* 0x04 - Status Register */ 99 u32 sr; /* 0x04 - Status Register */
97 u64 __bitwise cdar; /* 0x08 - Current descriptor address register */ 100 u64 cdar; /* 0x08 - Current descriptor address register */
98 u64 __bitwise sar; /* 0x10 - Source Address Register */ 101 u64 sar; /* 0x10 - Source Address Register */
99 u64 __bitwise dar; /* 0x18 - Destination Address Register */ 102 u64 dar; /* 0x18 - Destination Address Register */
100 u32 __bitwise bcr; /* 0x20 - Byte Count Register */ 103 u32 bcr; /* 0x20 - Byte Count Register */
101 u64 __bitwise ndar; /* 0x24 - Next Descriptor Address Register */ 104 u64 ndar; /* 0x24 - Next Descriptor Address Register */
102}; 105};
103 106
104struct fsl_dma_chan; 107struct fsl_dma_chan;
@@ -151,25 +154,27 @@ struct fsl_dma_chan {
151#ifndef __powerpc64__ 154#ifndef __powerpc64__
152static u64 in_be64(const u64 __iomem *addr) 155static u64 in_be64(const u64 __iomem *addr)
153{ 156{
154 return ((u64)in_be32((u32 *)addr) << 32) | (in_be32((u32 *)addr + 1)); 157 return ((u64)in_be32((u32 __iomem *)addr) << 32) |
158 (in_be32((u32 __iomem *)addr + 1));
155} 159}
156 160
157static void out_be64(u64 __iomem *addr, u64 val) 161static void out_be64(u64 __iomem *addr, u64 val)
158{ 162{
159 out_be32((u32 *)addr, val >> 32); 163 out_be32((u32 __iomem *)addr, val >> 32);
160 out_be32((u32 *)addr + 1, (u32)val); 164 out_be32((u32 __iomem *)addr + 1, (u32)val);
161} 165}
162 166
163/* There is no asm instructions for 64 bits reverse loads and stores */ 167/* There is no asm instructions for 64 bits reverse loads and stores */
164static u64 in_le64(const u64 __iomem *addr) 168static u64 in_le64(const u64 __iomem *addr)
165{ 169{
166 return ((u64)in_le32((u32 *)addr + 1) << 32) | (in_le32((u32 *)addr)); 170 return ((u64)in_le32((u32 __iomem *)addr + 1) << 32) |
171 (in_le32((u32 __iomem *)addr));
167} 172}
168 173
169static void out_le64(u64 __iomem *addr, u64 val) 174static void out_le64(u64 __iomem *addr, u64 val)
170{ 175{
171 out_le32((u32 *)addr + 1, val >> 32); 176 out_le32((u32 __iomem *)addr + 1, val >> 32);
172 out_le32((u32 *)addr, (u32)val); 177 out_le32((u32 __iomem *)addr, (u32)val);
173} 178}
174#endif 179#endif
175 180
@@ -182,9 +187,11 @@ static void out_le64(u64 __iomem *addr, u64 val)
182 187
183#define DMA_TO_CPU(fsl_chan, d, width) \ 188#define DMA_TO_CPU(fsl_chan, d, width) \
184 (((fsl_chan)->feature & FSL_DMA_BIG_ENDIAN) ? \ 189 (((fsl_chan)->feature & FSL_DMA_BIG_ENDIAN) ? \
185 be##width##_to_cpu(d) : le##width##_to_cpu(d)) 190 be##width##_to_cpu((__force __be##width)(v##width)d) : \
191 le##width##_to_cpu((__force __le##width)(v##width)d))
186#define CPU_TO_DMA(fsl_chan, c, width) \ 192#define CPU_TO_DMA(fsl_chan, c, width) \
187 (((fsl_chan)->feature & FSL_DMA_BIG_ENDIAN) ? \ 193 (((fsl_chan)->feature & FSL_DMA_BIG_ENDIAN) ? \
188 cpu_to_be##width(c) : cpu_to_le##width(c)) 194 (__force v##width)cpu_to_be##width(c) : \
195 (__force v##width)cpu_to_le##width(c))
189 196
190#endif /* __DMA_FSLDMA_H */ 197#endif /* __DMA_FSLDMA_H */
diff --git a/drivers/dma/ioat_dca.c b/drivers/dma/ioat_dca.c
index 0fa8a98051a8..9e922760b7ff 100644
--- a/drivers/dma/ioat_dca.c
+++ b/drivers/dma/ioat_dca.c
@@ -98,7 +98,7 @@ struct ioat_dca_slot {
98 98
99struct ioat_dca_priv { 99struct ioat_dca_priv {
100 void __iomem *iobase; 100 void __iomem *iobase;
101 void *dca_base; 101 void __iomem *dca_base;
102 int max_requesters; 102 int max_requesters;
103 int requester_count; 103 int requester_count;
104 u8 tag_map[IOAT_TAG_MAP_LEN]; 104 u8 tag_map[IOAT_TAG_MAP_LEN];
@@ -338,7 +338,7 @@ static struct dca_ops ioat2_dca_ops = {
338 .get_tag = ioat2_dca_get_tag, 338 .get_tag = ioat2_dca_get_tag,
339}; 339};
340 340
341static int ioat2_dca_count_dca_slots(void *iobase, u16 dca_offset) 341static int ioat2_dca_count_dca_slots(void __iomem *iobase, u16 dca_offset)
342{ 342{
343 int slots = 0; 343 int slots = 0;
344 u32 req; 344 u32 req;
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index a58ad8a470f9..781ea5950373 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -154,7 +154,7 @@ static void addr_send_arp(struct sockaddr_in *dst_in)
154{ 154{
155 struct rtable *rt; 155 struct rtable *rt;
156 struct flowi fl; 156 struct flowi fl;
157 u32 dst_ip = dst_in->sin_addr.s_addr; 157 __be32 dst_ip = dst_in->sin_addr.s_addr;
158 158
159 memset(&fl, 0, sizeof fl); 159 memset(&fl, 0, sizeof fl);
160 fl.nl_u.ip4_u.daddr = dst_ip; 160 fl.nl_u.ip4_u.daddr = dst_ip;
@@ -169,8 +169,8 @@ static int addr_resolve_remote(struct sockaddr_in *src_in,
169 struct sockaddr_in *dst_in, 169 struct sockaddr_in *dst_in,
170 struct rdma_dev_addr *addr) 170 struct rdma_dev_addr *addr)
171{ 171{
172 u32 src_ip = src_in->sin_addr.s_addr; 172 __be32 src_ip = src_in->sin_addr.s_addr;
173 u32 dst_ip = dst_in->sin_addr.s_addr; 173 __be32 dst_ip = dst_in->sin_addr.s_addr;
174 struct flowi fl; 174 struct flowi fl;
175 struct rtable *rt; 175 struct rtable *rt;
176 struct neighbour *neigh; 176 struct neighbour *neigh;
@@ -257,7 +257,7 @@ static int addr_resolve_local(struct sockaddr_in *src_in,
257 struct rdma_dev_addr *addr) 257 struct rdma_dev_addr *addr)
258{ 258{
259 struct net_device *dev; 259 struct net_device *dev;
260 u32 src_ip = src_in->sin_addr.s_addr; 260 __be32 src_ip = src_in->sin_addr.s_addr;
261 __be32 dst_ip = dst_in->sin_addr.s_addr; 261 __be32 dst_ip = dst_in->sin_addr.s_addr;
262 int ret; 262 int ret;
263 263
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 4df405157086..faa7ce318a6d 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -393,7 +393,7 @@ static int cm_alloc_id(struct cm_id_private *cm_id_priv)
393 spin_unlock_irqrestore(&cm.lock, flags); 393 spin_unlock_irqrestore(&cm.lock, flags);
394 } while( (ret == -EAGAIN) && idr_pre_get(&cm.local_id_table, GFP_KERNEL) ); 394 } while( (ret == -EAGAIN) && idr_pre_get(&cm.local_id_table, GFP_KERNEL) );
395 395
396 cm_id_priv->id.local_id = (__force __be32) (id ^ cm.random_id_operand); 396 cm_id_priv->id.local_id = (__force __be32)id ^ cm.random_id_operand;
397 return ret; 397 return ret;
398} 398}
399 399
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 34507daaf9b6..d81c156a22b4 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -168,15 +168,15 @@ struct cma_work {
168union cma_ip_addr { 168union cma_ip_addr {
169 struct in6_addr ip6; 169 struct in6_addr ip6;
170 struct { 170 struct {
171 __u32 pad[3]; 171 __be32 pad[3];
172 __u32 addr; 172 __be32 addr;
173 } ip4; 173 } ip4;
174}; 174};
175 175
176struct cma_hdr { 176struct cma_hdr {
177 u8 cma_version; 177 u8 cma_version;
178 u8 ip_version; /* IP version: 7:4 */ 178 u8 ip_version; /* IP version: 7:4 */
179 __u16 port; 179 __be16 port;
180 union cma_ip_addr src_addr; 180 union cma_ip_addr src_addr;
181 union cma_ip_addr dst_addr; 181 union cma_ip_addr dst_addr;
182}; 182};
@@ -186,8 +186,8 @@ struct sdp_hh {
186 u8 sdp_version; /* Major version: 7:4 */ 186 u8 sdp_version; /* Major version: 7:4 */
187 u8 ip_version; /* IP version: 7:4 */ 187 u8 ip_version; /* IP version: 7:4 */
188 u8 sdp_specific1[10]; 188 u8 sdp_specific1[10];
189 __u16 port; 189 __be16 port;
190 __u16 sdp_specific2; 190 __be16 sdp_specific2;
191 union cma_ip_addr src_addr; 191 union cma_ip_addr src_addr;
192 union cma_ip_addr dst_addr; 192 union cma_ip_addr dst_addr;
193}; 193};
@@ -663,7 +663,7 @@ static inline int cma_any_port(struct sockaddr *addr)
663} 663}
664 664
665static int cma_get_net_info(void *hdr, enum rdma_port_space ps, 665static int cma_get_net_info(void *hdr, enum rdma_port_space ps,
666 u8 *ip_ver, __u16 *port, 666 u8 *ip_ver, __be16 *port,
667 union cma_ip_addr **src, union cma_ip_addr **dst) 667 union cma_ip_addr **src, union cma_ip_addr **dst)
668{ 668{
669 switch (ps) { 669 switch (ps) {
@@ -695,7 +695,7 @@ static int cma_get_net_info(void *hdr, enum rdma_port_space ps,
695 695
696static void cma_save_net_info(struct rdma_addr *addr, 696static void cma_save_net_info(struct rdma_addr *addr,
697 struct rdma_addr *listen_addr, 697 struct rdma_addr *listen_addr,
698 u8 ip_ver, __u16 port, 698 u8 ip_ver, __be16 port,
699 union cma_ip_addr *src, union cma_ip_addr *dst) 699 union cma_ip_addr *src, union cma_ip_addr *dst)
700{ 700{
701 struct sockaddr_in *listen4, *ip4; 701 struct sockaddr_in *listen4, *ip4;
@@ -996,7 +996,7 @@ static struct rdma_id_private *cma_new_conn_id(struct rdma_cm_id *listen_id,
996 struct rdma_cm_id *id; 996 struct rdma_cm_id *id;
997 struct rdma_route *rt; 997 struct rdma_route *rt;
998 union cma_ip_addr *src, *dst; 998 union cma_ip_addr *src, *dst;
999 __u16 port; 999 __be16 port;
1000 u8 ip_ver; 1000 u8 ip_ver;
1001 1001
1002 if (cma_get_net_info(ib_event->private_data, listen_id->ps, 1002 if (cma_get_net_info(ib_event->private_data, listen_id->ps,
@@ -1043,7 +1043,7 @@ static struct rdma_id_private *cma_new_udp_id(struct rdma_cm_id *listen_id,
1043 struct rdma_id_private *id_priv; 1043 struct rdma_id_private *id_priv;
1044 struct rdma_cm_id *id; 1044 struct rdma_cm_id *id;
1045 union cma_ip_addr *src, *dst; 1045 union cma_ip_addr *src, *dst;
1046 __u16 port; 1046 __be16 port;
1047 u8 ip_ver; 1047 u8 ip_ver;
1048 int ret; 1048 int ret;
1049 1049
@@ -1165,7 +1165,7 @@ static void cma_set_compare_data(enum rdma_port_space ps, struct sockaddr *addr,
1165{ 1165{
1166 struct cma_hdr *cma_data, *cma_mask; 1166 struct cma_hdr *cma_data, *cma_mask;
1167 struct sdp_hh *sdp_data, *sdp_mask; 1167 struct sdp_hh *sdp_data, *sdp_mask;
1168 __u32 ip4_addr; 1168 __be32 ip4_addr;
1169 struct in6_addr ip6_addr; 1169 struct in6_addr ip6_addr;
1170 1170
1171 memset(compare, 0, sizeof *compare); 1171 memset(compare, 0, sizeof *compare);
@@ -1181,12 +1181,12 @@ static void cma_set_compare_data(enum rdma_port_space ps, struct sockaddr *addr,
1181 sdp_set_ip_ver(sdp_data, 4); 1181 sdp_set_ip_ver(sdp_data, 4);
1182 sdp_set_ip_ver(sdp_mask, 0xF); 1182 sdp_set_ip_ver(sdp_mask, 0xF);
1183 sdp_data->dst_addr.ip4.addr = ip4_addr; 1183 sdp_data->dst_addr.ip4.addr = ip4_addr;
1184 sdp_mask->dst_addr.ip4.addr = ~0; 1184 sdp_mask->dst_addr.ip4.addr = htonl(~0);
1185 } else { 1185 } else {
1186 cma_set_ip_ver(cma_data, 4); 1186 cma_set_ip_ver(cma_data, 4);
1187 cma_set_ip_ver(cma_mask, 0xF); 1187 cma_set_ip_ver(cma_mask, 0xF);
1188 cma_data->dst_addr.ip4.addr = ip4_addr; 1188 cma_data->dst_addr.ip4.addr = ip4_addr;
1189 cma_mask->dst_addr.ip4.addr = ~0; 1189 cma_mask->dst_addr.ip4.addr = htonl(~0);
1190 } 1190 }
1191 break; 1191 break;
1192 case AF_INET6: 1192 case AF_INET6:
diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c
index 564e425d71dd..645e6e040bfb 100644
--- a/drivers/lguest/lguest_user.c
+++ b/drivers/lguest/lguest_user.c
@@ -189,7 +189,7 @@ static int initialize(struct file *file, const unsigned long __user *input)
189 } 189 }
190 190
191 /* Populate the easy fields of our "struct lguest" */ 191 /* Populate the easy fields of our "struct lguest" */
192 lg->mem_base = (void __user *)(long)args[0]; 192 lg->mem_base = (void __user *)args[0];
193 lg->pfn_limit = args[1]; 193 lg->pfn_limit = args[1];
194 194
195 /* This is the first cpu (cpu 0) and it will start booting at args[3] */ 195 /* This is the first cpu (cpu 0) and it will start booting at args[3] */
diff --git a/drivers/media/common/saa7146_core.c b/drivers/media/common/saa7146_core.c
index 168a8d3a5e55..7707b8c7394b 100644
--- a/drivers/media/common/saa7146_core.c
+++ b/drivers/media/common/saa7146_core.c
@@ -306,25 +306,22 @@ static irqreturn_t interrupt_hw(int irq, void *dev_id)
306 return IRQ_NONE; 306 return IRQ_NONE;
307 } 307 }
308 308
309 if( 0 != (dev->ext)) { 309 if (dev->ext) {
310 if( 0 != (dev->ext->irq_mask & isr )) { 310 if (dev->ext->irq_mask & isr) {
311 if( 0 != dev->ext->irq_func ) { 311 if (dev->ext->irq_func)
312 dev->ext->irq_func(dev, &isr); 312 dev->ext->irq_func(dev, &isr);
313 }
314 isr &= ~dev->ext->irq_mask; 313 isr &= ~dev->ext->irq_mask;
315 } 314 }
316 } 315 }
317 if (0 != (isr & (MASK_27))) { 316 if (0 != (isr & (MASK_27))) {
318 DEB_INT(("irq: RPS0 (0x%08x).\n",isr)); 317 DEB_INT(("irq: RPS0 (0x%08x).\n",isr));
319 if( 0 != dev->vv_data && 0 != dev->vv_callback) { 318 if (dev->vv_data && dev->vv_callback)
320 dev->vv_callback(dev,isr); 319 dev->vv_callback(dev,isr);
321 }
322 isr &= ~MASK_27; 320 isr &= ~MASK_27;
323 } 321 }
324 if (0 != (isr & (MASK_28))) { 322 if (0 != (isr & (MASK_28))) {
325 if( 0 != dev->vv_data && 0 != dev->vv_callback) { 323 if (dev->vv_data && dev->vv_callback)
326 dev->vv_callback(dev,isr); 324 dev->vv_callback(dev,isr);
327 }
328 isr &= ~MASK_28; 325 isr &= ~MASK_28;
329 } 326 }
330 if (0 != (isr & (MASK_16|MASK_17))) { 327 if (0 != (isr & (MASK_16|MASK_17))) {
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c
index f0703d8bc3e8..171afe7da6b6 100644
--- a/drivers/media/common/saa7146_fops.c
+++ b/drivers/media/common/saa7146_fops.c
@@ -272,7 +272,7 @@ static int fops_open(struct inode *inode, struct file *file)
272 272
273 result = 0; 273 result = 0;
274out: 274out:
275 if( fh != 0 && result != 0 ) { 275 if (fh && result != 0) {
276 kfree(fh); 276 kfree(fh);
277 file->private_data = NULL; 277 file->private_data = NULL;
278 } 278 }
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c
index ed3f8268ed11..4c8b62e2c035 100644
--- a/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/drivers/media/dvb/dvb-core/dvb_net.c
@@ -784,8 +784,8 @@ static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len,
784{ 784{
785 struct net_device *dev = feed->priv; 785 struct net_device *dev = feed->priv;
786 786
787 if (buffer2 != 0) 787 if (buffer2)
788 printk(KERN_WARNING "buffer2 not 0: %p.\n", buffer2); 788 printk(KERN_WARNING "buffer2 not NULL: %p.\n", buffer2);
789 if (buffer1_len > 32768) 789 if (buffer1_len > 32768)
790 printk(KERN_WARNING "length > 32k: %zu.\n", buffer1_len); 790 printk(KERN_WARNING "length > 32k: %zu.\n", buffer1_len);
791 /* printk("TS callback: %u bytes, %u TS cells @ %p.\n", 791 /* printk("TS callback: %u bytes, %u TS cells @ %p.\n",
diff --git a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c
index cbab53fc6243..fea2e723e34b 100644
--- a/drivers/media/video/adv7170.c
+++ b/drivers/media/video/adv7170.c
@@ -408,7 +408,7 @@ adv7170_detect_client (struct i2c_adapter *adapter,
408 return 0; 408 return 0;
409 409
410 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 410 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
411 if (client == 0) 411 if (!client)
412 return -ENOMEM; 412 return -ENOMEM;
413 client->addr = address; 413 client->addr = address;
414 client->adapter = adapter; 414 client->adapter = adapter;
diff --git a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c
index 0d0c554bfdf7..10d4d89623f1 100644
--- a/drivers/media/video/adv7175.c
+++ b/drivers/media/video/adv7175.c
@@ -426,7 +426,7 @@ adv7175_detect_client (struct i2c_adapter *adapter,
426 return 0; 426 return 0;
427 427
428 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 428 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
429 if (client == 0) 429 if (!client)
430 return -ENOMEM; 430 return -ENOMEM;
431 client->addr = address; 431 client->addr = address;
432 client->adapter = adapter; 432 client->adapter = adapter;
diff --git a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c
index 12d1b9248be5..e663cc045c41 100644
--- a/drivers/media/video/bt819.c
+++ b/drivers/media/video/bt819.c
@@ -524,7 +524,7 @@ bt819_detect_client (struct i2c_adapter *adapter,
524 return 0; 524 return 0;
525 525
526 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 526 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
527 if (client == 0) 527 if (!client)
528 return -ENOMEM; 528 return -ENOMEM;
529 client->addr = address; 529 client->addr = address;
530 client->adapter = adapter; 530 client->adapter = adapter;
diff --git a/drivers/media/video/bt856.c b/drivers/media/video/bt856.c
index e1028a76c042..7dee2e3235ad 100644
--- a/drivers/media/video/bt856.c
+++ b/drivers/media/video/bt856.c
@@ -311,7 +311,7 @@ bt856_detect_client (struct i2c_adapter *adapter,
311 return 0; 311 return 0;
312 312
313 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 313 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
314 if (client == 0) 314 if (!client)
315 return -ENOMEM; 315 return -ENOMEM;
316 client->addr = address; 316 client->addr = address;
317 client->adapter = adapter; 317 client->adapter = adapter;
diff --git a/drivers/media/video/dpc7146.c b/drivers/media/video/dpc7146.c
index 566e479e2629..9ceb6b2f3949 100644
--- a/drivers/media/video/dpc7146.c
+++ b/drivers/media/video/dpc7146.c
@@ -131,7 +131,7 @@ static int dpc_probe(struct saa7146_dev* dev)
131 device_for_each_child(&dpc->i2c_adapter.dev, dpc, dpc_check_clients); 131 device_for_each_child(&dpc->i2c_adapter.dev, dpc, dpc_check_clients);
132 132
133 /* check if all devices are present */ 133 /* check if all devices are present */
134 if( 0 == dpc->saa7111a ) { 134 if (!dpc->saa7111a) {
135 DEB_D(("dpc_v4l2.o: dpc_attach failed for this device.\n")); 135 DEB_D(("dpc_v4l2.o: dpc_attach failed for this device.\n"));
136 i2c_del_adapter(&dpc->i2c_adapter); 136 i2c_del_adapter(&dpc->i2c_adapter);
137 kfree(dpc); 137 kfree(dpc);
diff --git a/drivers/media/video/mt20xx.c b/drivers/media/video/mt20xx.c
index 58bab653330f..74fd6a01d4c4 100644
--- a/drivers/media/video/mt20xx.c
+++ b/drivers/media/video/mt20xx.c
@@ -647,7 +647,7 @@ struct dvb_frontend *microtune_attach(struct dvb_frontend *fe,
647 default: 647 default:
648 tuner_info("microtune %s found, not (yet?) supported, sorry :-/\n", 648 tuner_info("microtune %s found, not (yet?) supported, sorry :-/\n",
649 name); 649 name);
650 return 0; 650 return NULL;
651 } 651 }
652 652
653 strlcpy(fe->ops.tuner_ops.info.name, name, 653 strlcpy(fe->ops.tuner_ops.info.name, name,
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c
index add6d0d680be..cb5a510f9251 100644
--- a/drivers/media/video/mxb.c
+++ b/drivers/media/video/mxb.c
@@ -221,9 +221,8 @@ static int mxb_probe(struct saa7146_dev* dev)
221 device_for_each_child(&mxb->i2c_adapter.dev, mxb, mxb_check_clients); 221 device_for_each_child(&mxb->i2c_adapter.dev, mxb, mxb_check_clients);
222 222
223 /* check if all devices are present */ 223 /* check if all devices are present */
224 if( 0 == mxb->tea6420_1 || 0 == mxb->tea6420_2 || 0 == mxb->tea6415c 224 if (!mxb->tea6420_1 || !mxb->tea6420_2 || !mxb->tea6415c ||
225 || 0 == mxb->tda9840 || 0 == mxb->saa7111a || 0 == mxb->tuner ) { 225 !mxb->tda9840 || !mxb->saa7111a || !mxb->tuner) {
226
227 printk("mxb: did not find all i2c devices. aborting\n"); 226 printk("mxb: did not find all i2c devices. aborting\n");
228 i2c_del_adapter(&mxb->i2c_adapter); 227 i2c_del_adapter(&mxb->i2c_adapter);
229 kfree(mxb); 228 kfree(mxb);
diff --git a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c
index 46f156fb108c..5a3e8d21a38a 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c
@@ -60,7 +60,7 @@ int pvr2_ctrl_set_mask_value(struct pvr2_ctrl *cptr,int mask,int val)
60 int ret = 0; 60 int ret = 0;
61 if (!cptr) return -EINVAL; 61 if (!cptr) return -EINVAL;
62 LOCK_TAKE(cptr->hdw->big_lock); do { 62 LOCK_TAKE(cptr->hdw->big_lock); do {
63 if (cptr->info->set_value != 0) { 63 if (cptr->info->set_value) {
64 if (cptr->info->type == pvr2_ctl_bitmask) { 64 if (cptr->info->type == pvr2_ctl_bitmask) {
65 mask &= cptr->info->def.type_bitmask.valid_bits; 65 mask &= cptr->info->def.type_bitmask.valid_bits;
66 } else if (cptr->info->type == pvr2_ctl_int) { 66 } else if (cptr->info->type == pvr2_ctl_int) {
@@ -265,7 +265,7 @@ unsigned int pvr2_ctrl_get_v4lflags(struct pvr2_ctrl *cptr)
265int pvr2_ctrl_is_writable(struct pvr2_ctrl *cptr) 265int pvr2_ctrl_is_writable(struct pvr2_ctrl *cptr)
266{ 266{
267 if (!cptr) return 0; 267 if (!cptr) return 0;
268 return cptr->info->set_value != 0; 268 return cptr->info->set_value != NULL;
269} 269}
270 270
271 271
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 41ae980405ed..d6955fa39598 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -2291,7 +2291,7 @@ static int pvr2_hdw_commit_setup(struct pvr2_hdw *hdw)
2291 2291
2292 for (idx = 0; idx < hdw->control_cnt; idx++) { 2292 for (idx = 0; idx < hdw->control_cnt; idx++) {
2293 cptr = hdw->controls + idx; 2293 cptr = hdw->controls + idx;
2294 if (cptr->info->is_dirty == 0) continue; 2294 if (!cptr->info->is_dirty) continue;
2295 if (!cptr->info->is_dirty(cptr)) continue; 2295 if (!cptr->info->is_dirty(cptr)) continue;
2296 commit_flag = !0; 2296 commit_flag = !0;
2297 2297
@@ -2646,7 +2646,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw,
2646 u16 address; 2646 u16 address;
2647 unsigned int pipe; 2647 unsigned int pipe;
2648 LOCK_TAKE(hdw->big_lock); do { 2648 LOCK_TAKE(hdw->big_lock); do {
2649 if ((hdw->fw_buffer == 0) == !enable_flag) break; 2649 if ((hdw->fw_buffer == NULL) == !enable_flag) break;
2650 2650
2651 if (!enable_flag) { 2651 if (!enable_flag) {
2652 pvr2_trace(PVR2_TRACE_FIRMWARE, 2652 pvr2_trace(PVR2_TRACE_FIRMWARE,
@@ -2715,7 +2715,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw,
2715/* Return true if we're in a mode for retrieval CPU firmware */ 2715/* Return true if we're in a mode for retrieval CPU firmware */
2716int pvr2_hdw_cpufw_get_enabled(struct pvr2_hdw *hdw) 2716int pvr2_hdw_cpufw_get_enabled(struct pvr2_hdw *hdw)
2717{ 2717{
2718 return hdw->fw_buffer != 0; 2718 return hdw->fw_buffer != NULL;
2719} 2719}
2720 2720
2721 2721
diff --git a/drivers/media/video/pvrusb2/pvrusb2-io.c b/drivers/media/video/pvrusb2/pvrusb2-io.c
index ce3c8982ffe0..a9889ff96ecc 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-io.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-io.c
@@ -563,7 +563,7 @@ void pvr2_stream_kill(struct pvr2_stream *sp)
563 struct pvr2_buffer *bp; 563 struct pvr2_buffer *bp;
564 mutex_lock(&sp->mutex); do { 564 mutex_lock(&sp->mutex); do {
565 pvr2_stream_internal_flush(sp); 565 pvr2_stream_internal_flush(sp);
566 while ((bp = pvr2_stream_get_ready_buffer(sp)) != 0) { 566 while ((bp = pvr2_stream_get_ready_buffer(sp)) != NULL) {
567 pvr2_buffer_set_idle(bp); 567 pvr2_buffer_set_idle(bp);
568 } 568 }
569 if (sp->buffer_total_count != sp->buffer_target_count) { 569 if (sp->buffer_total_count != sp->buffer_target_count) {
diff --git a/drivers/media/video/pvrusb2/pvrusb2-ioread.c b/drivers/media/video/pvrusb2/pvrusb2-ioread.c
index f782418afa45..c572212c9f15 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-ioread.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-ioread.c
@@ -165,7 +165,7 @@ static int pvr2_ioread_start(struct pvr2_ioread *cp)
165 if (!(cp->stream)) return 0; 165 if (!(cp->stream)) return 0;
166 pvr2_trace(PVR2_TRACE_START_STOP, 166 pvr2_trace(PVR2_TRACE_START_STOP,
167 "/*---TRACE_READ---*/ pvr2_ioread_start id=%p",cp); 167 "/*---TRACE_READ---*/ pvr2_ioread_start id=%p",cp);
168 while ((bp = pvr2_stream_get_idle_buffer(cp->stream)) != 0) { 168 while ((bp = pvr2_stream_get_idle_buffer(cp->stream)) != NULL) {
169 stat = pvr2_buffer_queue(bp); 169 stat = pvr2_buffer_queue(bp);
170 if (stat < 0) { 170 if (stat < 0) {
171 pvr2_trace(PVR2_TRACE_DATA_FLOW, 171 pvr2_trace(PVR2_TRACE_DATA_FLOW,
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index f991d72fe108..e0a453a6543d 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -915,7 +915,7 @@ static void pwc_iso_stop(struct pwc_device *pdev)
915 struct urb *urb; 915 struct urb *urb;
916 916
917 urb = pdev->sbuf[i].urb; 917 urb = pdev->sbuf[i].urb;
918 if (urb != 0) { 918 if (urb) {
919 PWC_DEBUG_MEMORY("Unlinking URB %p\n", urb); 919 PWC_DEBUG_MEMORY("Unlinking URB %p\n", urb);
920 usb_kill_urb(urb); 920 usb_kill_urb(urb);
921 } 921 }
@@ -931,7 +931,7 @@ static void pwc_iso_free(struct pwc_device *pdev)
931 struct urb *urb; 931 struct urb *urb;
932 932
933 urb = pdev->sbuf[i].urb; 933 urb = pdev->sbuf[i].urb;
934 if (urb != 0) { 934 if (urb) {
935 PWC_DEBUG_MEMORY("Freeing URB\n"); 935 PWC_DEBUG_MEMORY("Freeing URB\n");
936 usb_free_urb(urb); 936 usb_free_urb(urb);
937 pdev->sbuf[i].urb = NULL; 937 pdev->sbuf[i].urb = NULL;
@@ -1759,8 +1759,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
1759 1759
1760 /* Allocate video_device structure */ 1760 /* Allocate video_device structure */
1761 pdev->vdev = video_device_alloc(); 1761 pdev->vdev = video_device_alloc();
1762 if (pdev->vdev == 0) 1762 if (!pdev->vdev) {
1763 {
1764 PWC_ERROR("Err, cannot allocate video_device struture. Failing probe."); 1763 PWC_ERROR("Err, cannot allocate video_device struture. Failing probe.");
1765 kfree(pdev); 1764 kfree(pdev);
1766 return -ENOMEM; 1765 return -ENOMEM;
diff --git a/drivers/media/video/saa7110.c b/drivers/media/video/saa7110.c
index 061134a7ba9f..1df2602cd184 100644
--- a/drivers/media/video/saa7110.c
+++ b/drivers/media/video/saa7110.c
@@ -488,7 +488,7 @@ saa7110_detect_client (struct i2c_adapter *adapter,
488 return 0; 488 return 0;
489 489
490 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 490 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
491 if (client == 0) 491 if (!client)
492 return -ENOMEM; 492 return -ENOMEM;
493 client->addr = address; 493 client->addr = address;
494 client->adapter = adapter; 494 client->adapter = adapter;
@@ -496,7 +496,7 @@ saa7110_detect_client (struct i2c_adapter *adapter,
496 strlcpy(I2C_NAME(client), "saa7110", sizeof(I2C_NAME(client))); 496 strlcpy(I2C_NAME(client), "saa7110", sizeof(I2C_NAME(client)));
497 497
498 decoder = kzalloc(sizeof(struct saa7110), GFP_KERNEL); 498 decoder = kzalloc(sizeof(struct saa7110), GFP_KERNEL);
499 if (decoder == 0) { 499 if (!decoder) {
500 kfree(client); 500 kfree(client);
501 return -ENOMEM; 501 return -ENOMEM;
502 } 502 }
diff --git a/drivers/media/video/saa7111.c b/drivers/media/video/saa7111.c
index 7ae2d646d000..a0772c53bb1f 100644
--- a/drivers/media/video/saa7111.c
+++ b/drivers/media/video/saa7111.c
@@ -502,7 +502,7 @@ saa7111_detect_client (struct i2c_adapter *adapter,
502 return 0; 502 return 0;
503 503
504 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 504 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
505 if (client == 0) 505 if (!client)
506 return -ENOMEM; 506 return -ENOMEM;
507 client->addr = address; 507 client->addr = address;
508 client->adapter = adapter; 508 client->adapter = adapter;
diff --git a/drivers/media/video/saa7114.c b/drivers/media/video/saa7114.c
index 677df51de1a9..bf91a4faa706 100644
--- a/drivers/media/video/saa7114.c
+++ b/drivers/media/video/saa7114.c
@@ -841,7 +841,7 @@ saa7114_detect_client (struct i2c_adapter *adapter,
841 return 0; 841 return 0;
842 842
843 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 843 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
844 if (client == 0) 844 if (!client)
845 return -ENOMEM; 845 return -ENOMEM;
846 client->addr = address; 846 client->addr = address;
847 client->adapter = adapter; 847 client->adapter = adapter;
diff --git a/drivers/media/video/saa7185.c b/drivers/media/video/saa7185.c
index 66cc92c0ea66..41f70440fd3b 100644
--- a/drivers/media/video/saa7185.c
+++ b/drivers/media/video/saa7185.c
@@ -403,7 +403,7 @@ saa7185_detect_client (struct i2c_adapter *adapter,
403 return 0; 403 return 0;
404 404
405 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 405 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
406 if (client == 0) 406 if (!client)
407 return -ENOMEM; 407 return -ENOMEM;
408 client->addr = address; 408 client->addr = address;
409 client->adapter = adapter; 409 client->adapter = adapter;
diff --git a/drivers/media/video/tda9840.c b/drivers/media/video/tda9840.c
index ef494febb5e4..bdca5d278978 100644
--- a/drivers/media/video/tda9840.c
+++ b/drivers/media/video/tda9840.c
@@ -172,7 +172,7 @@ static int detect(struct i2c_adapter *adapter, int address, int kind)
172 172
173 /* allocate memory for client structure */ 173 /* allocate memory for client structure */
174 client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); 174 client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
175 if (0 == client) { 175 if (!client) {
176 printk("not enough kernel memory\n"); 176 printk("not enough kernel memory\n");
177 return -ENOMEM; 177 return -ENOMEM;
178 } 178 }
diff --git a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c
index 523df0b8cc63..df2fad9f391e 100644
--- a/drivers/media/video/tea6415c.c
+++ b/drivers/media/video/tea6415c.c
@@ -64,7 +64,7 @@ static int detect(struct i2c_adapter *adapter, int address, int kind)
64 64
65 /* allocate memory for client structure */ 65 /* allocate memory for client structure */
66 client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); 66 client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
67 if (0 == client) { 67 if (!client) {
68 return -ENOMEM; 68 return -ENOMEM;
69 } 69 }
70 70
diff --git a/drivers/media/video/tea6420.c b/drivers/media/video/tea6420.c
index ca05cd655087..4ff6c63f7237 100644
--- a/drivers/media/video/tea6420.c
+++ b/drivers/media/video/tea6420.c
@@ -101,7 +101,7 @@ static int tea6420_detect(struct i2c_adapter *adapter, int address, int kind)
101 101
102 /* allocate memory for client structure */ 102 /* allocate memory for client structure */
103 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 103 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
104 if (0 == client) { 104 if (!client) {
105 return -ENOMEM; 105 return -ENOMEM;
106 } 106 }
107 107
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c
index d28318cb2b8d..b6e24e714a23 100644
--- a/drivers/media/video/tvp5150.c
+++ b/drivers/media/video/tvp5150.c
@@ -1072,12 +1072,12 @@ static int tvp5150_detect_client(struct i2c_adapter *adapter,
1072 return 0; 1072 return 0;
1073 1073
1074 c = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); 1074 c = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
1075 if (c == 0) 1075 if (!c)
1076 return -ENOMEM; 1076 return -ENOMEM;
1077 memcpy(c, &client_template, sizeof(struct i2c_client)); 1077 memcpy(c, &client_template, sizeof(struct i2c_client));
1078 1078
1079 core = kzalloc(sizeof(struct tvp5150), GFP_KERNEL); 1079 core = kzalloc(sizeof(struct tvp5150), GFP_KERNEL);
1080 if (core == 0) { 1080 if (!core) {
1081 kfree(c); 1081 kfree(c);
1082 return -ENOMEM; 1082 return -ENOMEM;
1083 } 1083 }
diff --git a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c
index dd3d7d2c8b0e..fea4946ee713 100644
--- a/drivers/media/video/zoran_driver.c
+++ b/drivers/media/video/zoran_driver.c
@@ -339,7 +339,7 @@ v4l_fbuffer_alloc (struct file *file)
339 /* Use kmalloc */ 339 /* Use kmalloc */
340 340
341 mem = kmalloc(fh->v4l_buffers.buffer_size, GFP_KERNEL); 341 mem = kmalloc(fh->v4l_buffers.buffer_size, GFP_KERNEL);
342 if (mem == 0) { 342 if (!mem) {
343 dprintk(1, 343 dprintk(1,
344 KERN_ERR 344 KERN_ERR
345 "%s: v4l_fbuffer_alloc() - kmalloc for V4L buf %d failed\n", 345 "%s: v4l_fbuffer_alloc() - kmalloc for V4L buf %d failed\n",
diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c
index 1b44784d0efb..04949c823654 100644
--- a/drivers/media/video/zr364xx.c
+++ b/drivers/media/video/zr364xx.c
@@ -390,7 +390,7 @@ static int read_frame(struct zr364xx_camera *cam, int framenum)
390} 390}
391 391
392 392
393static ssize_t zr364xx_read(struct file *file, char *buf, size_t cnt, 393static ssize_t zr364xx_read(struct file *file, char __user *buf, size_t cnt,
394 loff_t * ppos) 394 loff_t * ppos)
395{ 395{
396 unsigned long count = cnt; 396 unsigned long count = cnt;
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 63fb1ff3ad10..f6f2d960cadb 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -28,14 +28,14 @@
28static inline void asic3_write_register(struct asic3 *asic, 28static inline void asic3_write_register(struct asic3 *asic,
29 unsigned int reg, u32 value) 29 unsigned int reg, u32 value)
30{ 30{
31 iowrite16(value, (unsigned long)asic->mapping + 31 iowrite16(value, asic->mapping +
32 (reg >> asic->bus_shift)); 32 (reg >> asic->bus_shift));
33} 33}
34 34
35static inline u32 asic3_read_register(struct asic3 *asic, 35static inline u32 asic3_read_register(struct asic3 *asic,
36 unsigned int reg) 36 unsigned int reg)
37{ 37{
38 return ioread16((unsigned long)asic->mapping + 38 return ioread16(asic->mapping +
39 (reg >> asic->bus_shift)); 39 (reg >> asic->bus_shift));
40} 40}
41 41
diff --git a/drivers/misc/fujitsu-laptop.c b/drivers/misc/fujitsu-laptop.c
index 1cfd7f3f1294..e2e7c05a147b 100644
--- a/drivers/misc/fujitsu-laptop.c
+++ b/drivers/misc/fujitsu-laptop.c
@@ -231,7 +231,7 @@ static int acpi_fujitsu_remove(struct acpi_device *device, int type)
231 231
232 if (!device || !acpi_driver_data(device)) 232 if (!device || !acpi_driver_data(device))
233 return -EINVAL; 233 return -EINVAL;
234 fujitsu->acpi_handle = 0; 234 fujitsu->acpi_handle = NULL;
235 235
236 return 0; 236 return 0;
237} 237}
diff --git a/drivers/misc/ibmasm/module.c b/drivers/misc/ibmasm/module.c
index 4f9d4a9da983..b5f6add34b0b 100644
--- a/drivers/misc/ibmasm/module.c
+++ b/drivers/misc/ibmasm/module.c
@@ -106,7 +106,7 @@ static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_devi
106 sp->irq = pdev->irq; 106 sp->irq = pdev->irq;
107 sp->base_address = ioremap(pci_resource_start(pdev, 0), 107 sp->base_address = ioremap(pci_resource_start(pdev, 0),
108 pci_resource_len(pdev, 0)); 108 pci_resource_len(pdev, 0));
109 if (sp->base_address == 0) { 109 if (!sp->base_address) {
110 dev_err(sp->dev, "Failed to ioremap pci memory\n"); 110 dev_err(sp->dev, "Failed to ioremap pci memory\n");
111 result = -ENODEV; 111 result = -ENODEV;
112 goto error_ioremap; 112 goto error_ioremap;
diff --git a/drivers/misc/lkdtm.c b/drivers/misc/lkdtm.c
index c884730c5eaf..1bfe5d16963b 100644
--- a/drivers/misc/lkdtm.c
+++ b/drivers/misc/lkdtm.c
@@ -197,7 +197,7 @@ static int lkdtm_parse_commandline(void)
197{ 197{
198 int i; 198 int i;
199 199
200 if (cpoint_name == INVALID || cpoint_type == NONE || 200 if (cpoint_name == NULL || cpoint_type == NULL ||
201 cpoint_count < 1 || recur_count < 1) 201 cpoint_count < 1 || recur_count < 1)
202 return -EINVAL; 202 return -EINVAL;
203 203
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index b09a53de1c53..d63cc93f055d 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -968,7 +968,7 @@ dm9000_interrupt(int irq, void *dev_id)
968struct dm9000_rxhdr { 968struct dm9000_rxhdr {
969 u8 RxPktReady; 969 u8 RxPktReady;
970 u8 RxStatus; 970 u8 RxStatus;
971 u16 RxLen; 971 __le16 RxLen;
972} __attribute__((__packed__)); 972} __attribute__((__packed__));
973 973
974/* 974/*
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index a8bec498cad6..f97224ce59da 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -1214,13 +1214,6 @@ static struct pciserial_board pci_boards[] __devinitdata = {
1214 .base_baud = 115200, 1214 .base_baud = 115200,
1215 .uart_offset = 8, 1215 .uart_offset = 8,
1216 }, 1216 },
1217 [pbn_b0_8_115200] = {
1218 .flags = FL_BASE0,
1219 .num_ports = 8,
1220 .base_baud = 115200,
1221 .uart_offset = 8,
1222 },
1223
1224 [pbn_b0_1_921600] = { 1217 [pbn_b0_1_921600] = {
1225 .flags = FL_BASE0, 1218 .flags = FL_BASE0,
1226 .num_ports = 1, 1219 .num_ports = 1,
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index 6c8ecde6aad1..c0df924766a7 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -37,7 +37,7 @@ struct virtio_pci_device
37 struct pci_dev *pci_dev; 37 struct pci_dev *pci_dev;
38 38
39 /* the IO mapping for the PCI config space */ 39 /* the IO mapping for the PCI config space */
40 void *ioaddr; 40 void __iomem *ioaddr;
41 41
42 /* a list of queues so we can dispatch IRQs */ 42 /* a list of queues so we can dispatch IRQs */
43 spinlock_t lock; 43 spinlock_t lock;
@@ -111,7 +111,7 @@ static void vp_get(struct virtio_device *vdev, unsigned offset,
111 void *buf, unsigned len) 111 void *buf, unsigned len)
112{ 112{
113 struct virtio_pci_device *vp_dev = to_vp_device(vdev); 113 struct virtio_pci_device *vp_dev = to_vp_device(vdev);
114 void *ioaddr = vp_dev->ioaddr + VIRTIO_PCI_CONFIG + offset; 114 void __iomem *ioaddr = vp_dev->ioaddr + VIRTIO_PCI_CONFIG + offset;
115 u8 *ptr = buf; 115 u8 *ptr = buf;
116 int i; 116 int i;
117 117
@@ -125,7 +125,7 @@ static void vp_set(struct virtio_device *vdev, unsigned offset,
125 const void *buf, unsigned len) 125 const void *buf, unsigned len)
126{ 126{
127 struct virtio_pci_device *vp_dev = to_vp_device(vdev); 127 struct virtio_pci_device *vp_dev = to_vp_device(vdev);
128 void *ioaddr = vp_dev->ioaddr + VIRTIO_PCI_CONFIG + offset; 128 void __iomem *ioaddr = vp_dev->ioaddr + VIRTIO_PCI_CONFIG + offset;
129 const u8 *ptr = buf; 129 const u8 *ptr = buf;
130 int i; 130 int i;
131 131
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index 1f5a4289b848..1cb5b0a9f2ac 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -261,7 +261,7 @@ static void mode_to_access_flags(umode_t mode, umode_t bits_to_use,
261 return; 261 return;
262} 262}
263 263
264static __le16 fill_ace_for_sid(struct cifs_ace *pntace, 264static __u16 fill_ace_for_sid(struct cifs_ace *pntace,
265 const struct cifs_sid *psid, __u64 nmode, umode_t bits) 265 const struct cifs_sid *psid, __u64 nmode, umode_t bits)
266{ 266{
267 int i; 267 int i;
@@ -411,7 +411,7 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
411static int set_chmod_dacl(struct cifs_acl *pndacl, struct cifs_sid *pownersid, 411static int set_chmod_dacl(struct cifs_acl *pndacl, struct cifs_sid *pownersid,
412 struct cifs_sid *pgrpsid, __u64 nmode) 412 struct cifs_sid *pgrpsid, __u64 nmode)
413{ 413{
414 __le16 size = 0; 414 u16 size = 0;
415 struct cifs_acl *pnndacl; 415 struct cifs_acl *pnndacl;
416 416
417 pnndacl = (struct cifs_acl *)((char *)pndacl + sizeof(struct cifs_acl)); 417 pnndacl = (struct cifs_acl *)((char *)pndacl + sizeof(struct cifs_acl));
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index 9816293442ab..0e081d5f32e8 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -1620,14 +1620,14 @@ static int journal_init_journal_head_cache(void)
1620{ 1620{
1621 int retval; 1621 int retval;
1622 1622
1623 J_ASSERT(journal_head_cache == 0); 1623 J_ASSERT(journal_head_cache == NULL);
1624 journal_head_cache = kmem_cache_create("journal_head", 1624 journal_head_cache = kmem_cache_create("journal_head",
1625 sizeof(struct journal_head), 1625 sizeof(struct journal_head),
1626 0, /* offset */ 1626 0, /* offset */
1627 SLAB_TEMPORARY, /* flags */ 1627 SLAB_TEMPORARY, /* flags */
1628 NULL); /* ctor */ 1628 NULL); /* ctor */
1629 retval = 0; 1629 retval = 0;
1630 if (journal_head_cache == 0) { 1630 if (!journal_head_cache) {
1631 retval = -ENOMEM; 1631 retval = -ENOMEM;
1632 printk(KERN_EMERG "JBD: no memory for journal_head cache\n"); 1632 printk(KERN_EMERG "JBD: no memory for journal_head cache\n");
1633 } 1633 }
diff --git a/fs/jbd/revoke.c b/fs/jbd/revoke.c
index ad2eacf570c6..d5f8eee7c88c 100644
--- a/fs/jbd/revoke.c
+++ b/fs/jbd/revoke.c
@@ -173,13 +173,13 @@ int __init journal_init_revoke_caches(void)
173 0, 173 0,
174 SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY, 174 SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY,
175 NULL); 175 NULL);
176 if (revoke_record_cache == 0) 176 if (!revoke_record_cache)
177 return -ENOMEM; 177 return -ENOMEM;
178 178
179 revoke_table_cache = kmem_cache_create("revoke_table", 179 revoke_table_cache = kmem_cache_create("revoke_table",
180 sizeof(struct jbd_revoke_table_s), 180 sizeof(struct jbd_revoke_table_s),
181 0, SLAB_TEMPORARY, NULL); 181 0, SLAB_TEMPORARY, NULL);
182 if (revoke_table_cache == 0) { 182 if (!revoke_table_cache) {
183 kmem_cache_destroy(revoke_record_cache); 183 kmem_cache_destroy(revoke_record_cache);
184 revoke_record_cache = NULL; 184 revoke_record_cache = NULL;
185 return -ENOMEM; 185 return -ENOMEM;
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 96ba846992e9..954cff001df6 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -219,7 +219,7 @@ static int jbd2_journal_start_thread(journal_t *journal)
219 if (IS_ERR(t)) 219 if (IS_ERR(t))
220 return PTR_ERR(t); 220 return PTR_ERR(t);
221 221
222 wait_event(journal->j_wait_done_commit, journal->j_task != 0); 222 wait_event(journal->j_wait_done_commit, journal->j_task != NULL);
223 return 0; 223 return 0;
224} 224}
225 225
@@ -231,7 +231,7 @@ static void journal_kill_thread(journal_t *journal)
231 while (journal->j_task) { 231 while (journal->j_task) {
232 wake_up(&journal->j_wait_commit); 232 wake_up(&journal->j_wait_commit);
233 spin_unlock(&journal->j_state_lock); 233 spin_unlock(&journal->j_state_lock);
234 wait_event(journal->j_wait_done_commit, journal->j_task == 0); 234 wait_event(journal->j_wait_done_commit, journal->j_task == NULL);
235 spin_lock(&journal->j_state_lock); 235 spin_lock(&journal->j_state_lock);
236 } 236 }
237 spin_unlock(&journal->j_state_lock); 237 spin_unlock(&journal->j_state_lock);
@@ -1969,14 +1969,14 @@ static int journal_init_jbd2_journal_head_cache(void)
1969{ 1969{
1970 int retval; 1970 int retval;
1971 1971
1972 J_ASSERT(jbd2_journal_head_cache == 0); 1972 J_ASSERT(jbd2_journal_head_cache == NULL);
1973 jbd2_journal_head_cache = kmem_cache_create("jbd2_journal_head", 1973 jbd2_journal_head_cache = kmem_cache_create("jbd2_journal_head",
1974 sizeof(struct journal_head), 1974 sizeof(struct journal_head),
1975 0, /* offset */ 1975 0, /* offset */
1976 SLAB_TEMPORARY, /* flags */ 1976 SLAB_TEMPORARY, /* flags */
1977 NULL); /* ctor */ 1977 NULL); /* ctor */
1978 retval = 0; 1978 retval = 0;
1979 if (jbd2_journal_head_cache == 0) { 1979 if (!jbd2_journal_head_cache) {
1980 retval = -ENOMEM; 1980 retval = -ENOMEM;
1981 printk(KERN_EMERG "JBD: no memory for journal_head cache\n"); 1981 printk(KERN_EMERG "JBD: no memory for journal_head cache\n");
1982 } 1982 }
@@ -2002,14 +2002,14 @@ static struct journal_head *journal_alloc_journal_head(void)
2002 atomic_inc(&nr_journal_heads); 2002 atomic_inc(&nr_journal_heads);
2003#endif 2003#endif
2004 ret = kmem_cache_alloc(jbd2_journal_head_cache, GFP_NOFS); 2004 ret = kmem_cache_alloc(jbd2_journal_head_cache, GFP_NOFS);
2005 if (ret == 0) { 2005 if (!ret) {
2006 jbd_debug(1, "out of memory for journal_head\n"); 2006 jbd_debug(1, "out of memory for journal_head\n");
2007 if (time_after(jiffies, last_warning + 5*HZ)) { 2007 if (time_after(jiffies, last_warning + 5*HZ)) {
2008 printk(KERN_NOTICE "ENOMEM in %s, retrying.\n", 2008 printk(KERN_NOTICE "ENOMEM in %s, retrying.\n",
2009 __FUNCTION__); 2009 __FUNCTION__);
2010 last_warning = jiffies; 2010 last_warning = jiffies;
2011 } 2011 }
2012 while (ret == 0) { 2012 while (!ret) {
2013 yield(); 2013 yield();
2014 ret = kmem_cache_alloc(jbd2_journal_head_cache, GFP_NOFS); 2014 ret = kmem_cache_alloc(jbd2_journal_head_cache, GFP_NOFS);
2015 } 2015 }
diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c
index df36f42e19e1..2e1453a5e998 100644
--- a/fs/jbd2/revoke.c
+++ b/fs/jbd2/revoke.c
@@ -174,13 +174,13 @@ int __init jbd2_journal_init_revoke_caches(void)
174 0, 174 0,
175 SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY, 175 SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY,
176 NULL); 176 NULL);
177 if (jbd2_revoke_record_cache == 0) 177 if (!jbd2_revoke_record_cache)
178 return -ENOMEM; 178 return -ENOMEM;
179 179
180 jbd2_revoke_table_cache = kmem_cache_create("jbd2_revoke_table", 180 jbd2_revoke_table_cache = kmem_cache_create("jbd2_revoke_table",
181 sizeof(struct jbd2_revoke_table_s), 181 sizeof(struct jbd2_revoke_table_s),
182 0, SLAB_TEMPORARY, NULL); 182 0, SLAB_TEMPORARY, NULL);
183 if (jbd2_revoke_table_cache == 0) { 183 if (!jbd2_revoke_table_cache) {
184 kmem_cache_destroy(jbd2_revoke_record_cache); 184 kmem_cache_destroy(jbd2_revoke_record_cache);
185 jbd2_revoke_record_cache = NULL; 185 jbd2_revoke_record_cache = NULL;
186 return -ENOMEM; 186 return -ENOMEM;
diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c
index f85c5cf4934c..7ee4208793b6 100644
--- a/fs/reiserfs/do_balan.c
+++ b/fs/reiserfs/do_balan.c
@@ -283,7 +283,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
283 return balance_leaf_when_delete(tb, flag); 283 return balance_leaf_when_delete(tb, flag);
284 284
285 zeros_num = 0; 285 zeros_num = 0;
286 if (flag == M_INSERT && body == 0) 286 if (flag == M_INSERT && !body)
287 zeros_num = ih_item_len(ih); 287 zeros_num = ih_item_len(ih);
288 288
289 pos_in_item = tb->tb_path->pos_in_item; 289 pos_in_item = tb->tb_path->pos_in_item;
@@ -1728,7 +1728,7 @@ struct buffer_head *get_FEB(struct tree_balance *tb)
1728 struct buffer_info bi; 1728 struct buffer_info bi;
1729 1729
1730 for (i = 0; i < MAX_FEB_SIZE; i++) 1730 for (i = 0; i < MAX_FEB_SIZE; i++)
1731 if (tb->FEB[i] != 0) 1731 if (tb->FEB[i] != NULL)
1732 break; 1732 break;
1733 1733
1734 if (i == MAX_FEB_SIZE) 1734 if (i == MAX_FEB_SIZE)
@@ -1827,7 +1827,7 @@ int get_left_neighbor_position(struct tree_balance *tb, int h)
1827{ 1827{
1828 int Sh_position = PATH_H_POSITION(tb->tb_path, h + 1); 1828 int Sh_position = PATH_H_POSITION(tb->tb_path, h + 1);
1829 1829
1830 RFALSE(PATH_H_PPARENT(tb->tb_path, h) == 0 || tb->FL[h] == 0, 1830 RFALSE(PATH_H_PPARENT(tb->tb_path, h) == NULL || tb->FL[h] == NULL,
1831 "vs-12325: FL[%d](%p) or F[%d](%p) does not exist", 1831 "vs-12325: FL[%d](%p) or F[%d](%p) does not exist",
1832 h, tb->FL[h], h, PATH_H_PPARENT(tb->tb_path, h)); 1832 h, tb->FL[h], h, PATH_H_PPARENT(tb->tb_path, h));
1833 1833
@@ -1841,7 +1841,7 @@ int get_right_neighbor_position(struct tree_balance *tb, int h)
1841{ 1841{
1842 int Sh_position = PATH_H_POSITION(tb->tb_path, h + 1); 1842 int Sh_position = PATH_H_POSITION(tb->tb_path, h + 1);
1843 1843
1844 RFALSE(PATH_H_PPARENT(tb->tb_path, h) == 0 || tb->FR[h] == 0, 1844 RFALSE(PATH_H_PPARENT(tb->tb_path, h) == NULL || tb->FR[h] == NULL,
1845 "vs-12330: F[%d](%p) or FR[%d](%p) does not exist", 1845 "vs-12330: F[%d](%p) or FR[%d](%p) does not exist",
1846 h, PATH_H_PPARENT(tb->tb_path, h), h, tb->FR[h]); 1846 h, PATH_H_PPARENT(tb->tb_path, h), h, tb->FR[h]);
1847 1847
diff --git a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c
index 0ee35c6c9b72..07d05e0842b7 100644
--- a/fs/reiserfs/fix_node.c
+++ b/fs/reiserfs/fix_node.c
@@ -153,7 +153,7 @@ static void create_virtual_node(struct tree_balance *tb, int h)
153 if (vn->vn_mode == M_INSERT) { 153 if (vn->vn_mode == M_INSERT) {
154 struct virtual_item *vi = vn->vn_vi + vn->vn_affected_item_num; 154 struct virtual_item *vi = vn->vn_vi + vn->vn_affected_item_num;
155 155
156 RFALSE(vn->vn_ins_ih == 0, 156 RFALSE(vn->vn_ins_ih == NULL,
157 "vs-8040: item header of inserted item is not specified"); 157 "vs-8040: item header of inserted item is not specified");
158 vi->vi_item_len = tb->insert_size[0]; 158 vi->vi_item_len = tb->insert_size[0];
159 vi->vi_ih = vn->vn_ins_ih; 159 vi->vi_ih = vn->vn_ins_ih;
@@ -857,7 +857,8 @@ static int get_lfree(struct tree_balance *tb, int h)
857 struct buffer_head *l, *f; 857 struct buffer_head *l, *f;
858 int order; 858 int order;
859 859
860 if ((f = PATH_H_PPARENT(tb->tb_path, h)) == 0 || (l = tb->FL[h]) == 0) 860 if ((f = PATH_H_PPARENT(tb->tb_path, h)) == NULL ||
861 (l = tb->FL[h]) == NULL)
861 return 0; 862 return 0;
862 863
863 if (f == l) 864 if (f == l)
@@ -878,7 +879,8 @@ static int get_rfree(struct tree_balance *tb, int h)
878 struct buffer_head *r, *f; 879 struct buffer_head *r, *f;
879 int order; 880 int order;
880 881
881 if ((f = PATH_H_PPARENT(tb->tb_path, h)) == 0 || (r = tb->FR[h]) == 0) 882 if ((f = PATH_H_PPARENT(tb->tb_path, h)) == NULL ||
883 (r = tb->FR[h]) == NULL)
882 return 0; 884 return 0;
883 885
884 if (f == r) 886 if (f == r)
diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c
index 281f8061ac58..6de060a6aa7f 100644
--- a/fs/reiserfs/lbalance.c
+++ b/fs/reiserfs/lbalance.c
@@ -626,7 +626,7 @@ static void leaf_define_dest_src_infos(int shift_mode, struct tree_balance *tb,
626 "vs-10250: leaf_define_dest_src_infos: shift type is unknown (%d)", 626 "vs-10250: leaf_define_dest_src_infos: shift type is unknown (%d)",
627 shift_mode); 627 shift_mode);
628 } 628 }
629 RFALSE(src_bi->bi_bh == 0 || dest_bi->bi_bh == 0, 629 RFALSE(!src_bi->bi_bh || !dest_bi->bi_bh,
630 "vs-10260: mode==%d, source (%p) or dest (%p) buffer is initialized incorrectly", 630 "vs-10260: mode==%d, source (%p) or dest (%p) buffer is initialized incorrectly",
631 shift_mode, src_bi->bi_bh, dest_bi->bi_bh); 631 shift_mode, src_bi->bi_bh, dest_bi->bi_bh);
632} 632}
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index b378eea332ca..8867533cb727 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -452,7 +452,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
452 buflen = DEH_SIZE + ROUND_UP(namelen); 452 buflen = DEH_SIZE + ROUND_UP(namelen);
453 if (buflen > sizeof(small_buf)) { 453 if (buflen > sizeof(small_buf)) {
454 buffer = kmalloc(buflen, GFP_NOFS); 454 buffer = kmalloc(buflen, GFP_NOFS);
455 if (buffer == 0) 455 if (!buffer)
456 return -ENOMEM; 456 return -ENOMEM;
457 } else 457 } else
458 buffer = small_buf; 458 buffer = small_buf;
diff --git a/fs/smbfs/smbiod.c b/fs/smbfs/smbiod.c
index fae8e85af0ed..6bd9b691a463 100644
--- a/fs/smbfs/smbiod.c
+++ b/fs/smbfs/smbiod.c
@@ -206,7 +206,7 @@ int smbiod_retry(struct smb_sb_info *server)
206 206
207 smb_close_socket(server); 207 smb_close_socket(server);
208 208
209 if (pid == 0) { 209 if (!pid) {
210 /* FIXME: this is fatal, umount? */ 210 /* FIXME: this is fatal, umount? */
211 printk(KERN_ERR "smb_retry: no connection process\n"); 211 printk(KERN_ERR "smb_retry: no connection process\n");
212 server->state = CONN_RETRIED; 212 server->state = CONN_RETRIED;
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h
index b400cea81487..2c57f4734746 100644
--- a/include/asm-frv/system.h
+++ b/include/asm-frv/system.h
@@ -234,7 +234,7 @@ extern void free_initmem(void);
234 break; \ 234 break; \
235 \ 235 \
236 default: \ 236 default: \
237 __xg_orig = 0; \ 237 __xg_orig = (__typeof__(__xg_orig))0; \
238 asm volatile("break"); \ 238 asm volatile("break"); \
239 break; \ 239 break; \
240 } \ 240 } \
@@ -259,7 +259,7 @@ extern uint32_t __cmpxchg_32(uint32_t *v, uint32_t test, uint32_t new);
259 (__force uint32_t)__xg_test, \ 259 (__force uint32_t)__xg_test, \
260 (__force uint32_t)__xg_new); break; \ 260 (__force uint32_t)__xg_new); break; \
261 default: \ 261 default: \
262 __xg_orig = 0; \ 262 __xg_orig = (__typeof__(__xg_orig))0; \
263 asm volatile("break"); \ 263 asm volatile("break"); \
264 break; \ 264 break; \
265 } \ 265 } \
diff --git a/include/linux/compat.h b/include/linux/compat.h
index a671dbff7a1f..8fa7857e153b 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -192,8 +192,8 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
192 struct compat_timeval __user *tvp); 192 struct compat_timeval __user *tvp);
193 193
194asmlinkage long compat_sys_wait4(compat_pid_t pid, 194asmlinkage long compat_sys_wait4(compat_pid_t pid,
195 compat_uint_t *stat_addr, int options, 195 compat_uint_t __user *stat_addr, int options,
196 struct compat_rusage *ru); 196 struct compat_rusage __user *ru);
197 197
198#define BITS_PER_COMPAT_LONG (8*sizeof(compat_long_t)) 198#define BITS_PER_COMPAT_LONG (8*sizeof(compat_long_t))
199 199
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 261e43a4c873..34d440698293 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -423,7 +423,7 @@ void dma_async_device_unregister(struct dma_device *device);
423/* --- Helper iov-locking functions --- */ 423/* --- Helper iov-locking functions --- */
424 424
425struct dma_page_list { 425struct dma_page_list {
426 char *base_address; 426 char __user *base_address;
427 int nr_pages; 427 int nr_pages;
428 struct page **pages; 428 struct page **pages;
429}; 429};
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index e9c2fb01e89b..53d86b4b0ce0 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2082,7 +2082,7 @@ static int cgroup_tasks_open(struct inode *unused, struct file *file)
2082 2082
2083 kfree(pidarray); 2083 kfree(pidarray);
2084 } else { 2084 } else {
2085 ctr->buf = 0; 2085 ctr->buf = NULL;
2086 ctr->bufsz = 0; 2086 ctr->bufsz = 0;
2087 } 2087 }
2088 file->private_data = ctr; 2088 file->private_data = ctr;
@@ -2614,7 +2614,7 @@ static int proc_cgroupstats_show(struct seq_file *m, void *v)
2614 2614
2615static int cgroupstats_open(struct inode *inode, struct file *file) 2615static int cgroupstats_open(struct inode *inode, struct file *file)
2616{ 2616{
2617 return single_open(file, proc_cgroupstats_show, 0); 2617 return single_open(file, proc_cgroupstats_show, NULL);
2618} 2618}
2619 2619
2620static struct file_operations proc_cgroupstats_operations = { 2620static struct file_operations proc_cgroupstats_operations = {
diff --git a/kernel/futex.c b/kernel/futex.c
index 87a6428cb5b6..e43945e995f5 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -281,7 +281,7 @@ static int get_futex_key(u32 __user *uaddr, struct rw_semaphore *fshared,
281 */ 281 */
282static void get_futex_key_refs(union futex_key *key) 282static void get_futex_key_refs(union futex_key *key)
283{ 283{
284 if (key->both.ptr == 0) 284 if (key->both.ptr == NULL)
285 return; 285 return;
286 switch (key->both.offset & (FUT_OFF_INODE|FUT_OFF_MMSHARED)) { 286 switch (key->both.offset & (FUT_OFF_INODE|FUT_OFF_MMSHARED)) {
287 case FUT_OFF_INODE: 287 case FUT_OFF_INODE:
diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
index ff90f049f8f6..04ac3a9e42cf 100644
--- a/kernel/futex_compat.c
+++ b/kernel/futex_compat.c
@@ -30,7 +30,7 @@ fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **entry,
30 return 0; 30 return 0;
31} 31}
32 32
33static void __user *futex_uaddr(struct robust_list *entry, 33static void __user *futex_uaddr(struct robust_list __user *entry,
34 compat_long_t futex_offset) 34 compat_long_t futex_offset)
35{ 35{
36 compat_uptr_t base = ptr_to_compat(entry); 36 compat_uptr_t base = ptr_to_compat(entry);
diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
index cd75b21dd4c3..99c4f36eb8a3 100644
--- a/mm/sparse-vmemmap.c
+++ b/mm/sparse-vmemmap.c
@@ -76,7 +76,7 @@ pte_t * __meminit vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node)
76 pte_t entry; 76 pte_t entry;
77 void *p = vmemmap_alloc_block(PAGE_SIZE, node); 77 void *p = vmemmap_alloc_block(PAGE_SIZE, node);
78 if (!p) 78 if (!p)
79 return 0; 79 return NULL;
80 entry = pfn_pte(__pa(p) >> PAGE_SHIFT, PAGE_KERNEL); 80 entry = pfn_pte(__pa(p) >> PAGE_SHIFT, PAGE_KERNEL);
81 set_pte_at(&init_mm, addr, pte, entry); 81 set_pte_at(&init_mm, addr, pte, entry);
82 } 82 }
@@ -89,7 +89,7 @@ pmd_t * __meminit vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node)
89 if (pmd_none(*pmd)) { 89 if (pmd_none(*pmd)) {
90 void *p = vmemmap_alloc_block(PAGE_SIZE, node); 90 void *p = vmemmap_alloc_block(PAGE_SIZE, node);
91 if (!p) 91 if (!p)
92 return 0; 92 return NULL;
93 pmd_populate_kernel(&init_mm, pmd, p); 93 pmd_populate_kernel(&init_mm, pmd, p);
94 } 94 }
95 return pmd; 95 return pmd;
@@ -101,7 +101,7 @@ pud_t * __meminit vmemmap_pud_populate(pgd_t *pgd, unsigned long addr, int node)
101 if (pud_none(*pud)) { 101 if (pud_none(*pud)) {
102 void *p = vmemmap_alloc_block(PAGE_SIZE, node); 102 void *p = vmemmap_alloc_block(PAGE_SIZE, node);
103 if (!p) 103 if (!p)
104 return 0; 104 return NULL;
105 pud_populate(&init_mm, pud, p); 105 pud_populate(&init_mm, pud, p);
106 } 106 }
107 return pud; 107 return pud;
@@ -113,7 +113,7 @@ pgd_t * __meminit vmemmap_pgd_populate(unsigned long addr, int node)
113 if (pgd_none(*pgd)) { 113 if (pgd_none(*pgd)) {
114 void *p = vmemmap_alloc_block(PAGE_SIZE, node); 114 void *p = vmemmap_alloc_block(PAGE_SIZE, node);
115 if (!p) 115 if (!p)
116 return 0; 116 return NULL;
117 pgd_populate(&init_mm, pgd, p); 117 pgd_populate(&init_mm, pgd, p);
118 } 118 }
119 return pgd; 119 return pgd;
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
index 1aaa2e804b0d..126ca777b410 100644
--- a/net/rxrpc/ar-internal.h
+++ b/net/rxrpc/ar-internal.h
@@ -23,7 +23,7 @@
23struct rxrpc_crypt { 23struct rxrpc_crypt {
24 union { 24 union {
25 u8 x[FCRYPT_BSIZE]; 25 u8 x[FCRYPT_BSIZE];
26 u32 n[2]; 26 __be32 n[2];
27 }; 27 };
28} __attribute__((aligned(8))); 28} __attribute__((aligned(8)));
29 29
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c
index f48434adb7c2..d1c296f2d617 100644
--- a/net/rxrpc/rxkad.c
+++ b/net/rxrpc/rxkad.c
@@ -261,6 +261,7 @@ static int rxkad_secure_packet(const struct rxrpc_call *call,
261 __be32 x[2]; 261 __be32 x[2];
262 } tmpbuf __attribute__((aligned(8))); /* must all be in same page */ 262 } tmpbuf __attribute__((aligned(8))); /* must all be in same page */
263 __be32 x; 263 __be32 x;
264 u32 y;
264 int ret; 265 int ret;
265 266
266 sp = rxrpc_skb(skb); 267 sp = rxrpc_skb(skb);
@@ -292,11 +293,11 @@ static int rxkad_secure_packet(const struct rxrpc_call *call,
292 sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf)); 293 sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf));
293 crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf)); 294 crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf));
294 295
295 x = ntohl(tmpbuf.x[1]); 296 y = ntohl(tmpbuf.x[1]);
296 x = (x >> 16) & 0xffff; 297 y = (y >> 16) & 0xffff;
297 if (x == 0) 298 if (y == 0)
298 x = 1; /* zero checksums are not permitted */ 299 y = 1; /* zero checksums are not permitted */
299 sp->hdr.cksum = htons(x); 300 sp->hdr.cksum = htons(y);
300 301
301 switch (call->conn->security_level) { 302 switch (call->conn->security_level) {
302 case RXRPC_SECURITY_PLAIN: 303 case RXRPC_SECURITY_PLAIN:
@@ -314,7 +315,7 @@ static int rxkad_secure_packet(const struct rxrpc_call *call,
314 break; 315 break;
315 } 316 }
316 317
317 _leave(" = %d [set %hx]", ret, x); 318 _leave(" = %d [set %hx]", ret, y);
318 return ret; 319 return ret;
319} 320}
320 321
@@ -492,6 +493,7 @@ static int rxkad_verify_packet(const struct rxrpc_call *call,
492 __be32 x[2]; 493 __be32 x[2];
493 } tmpbuf __attribute__((aligned(8))); /* must all be in same page */ 494 } tmpbuf __attribute__((aligned(8))); /* must all be in same page */
494 __be32 x; 495 __be32 x;
496 u16 y;
495 __be16 cksum; 497 __be16 cksum;
496 int ret; 498 int ret;
497 499
@@ -526,12 +528,12 @@ static int rxkad_verify_packet(const struct rxrpc_call *call,
526 sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf)); 528 sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf));
527 crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf)); 529 crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf));
528 530
529 x = ntohl(tmpbuf.x[1]); 531 y = ntohl(tmpbuf.x[1]);
530 x = (x >> 16) & 0xffff; 532 y = (y >> 16) & 0xffff;
531 if (x == 0) 533 if (y == 0)
532 x = 1; /* zero checksums are not permitted */ 534 y = 1; /* zero checksums are not permitted */
533 535
534 cksum = htons(x); 536 cksum = htons(y);
535 if (sp->hdr.cksum != cksum) { 537 if (sp->hdr.cksum != cksum) {
536 *_abort_code = RXKADSEALEDINCON; 538 *_abort_code = RXKADSEALEDINCON;
537 _leave(" = -EPROTO [csum failed]"); 539 _leave(" = -EPROTO [csum failed]");
@@ -1001,7 +1003,8 @@ static int rxkad_verify_response(struct rxrpc_connection *conn,
1001 struct rxrpc_crypt session_key; 1003 struct rxrpc_crypt session_key;
1002 time_t expiry; 1004 time_t expiry;
1003 void *ticket; 1005 void *ticket;
1004 u32 abort_code, version, kvno, ticket_len, csum, level; 1006 u32 abort_code, version, kvno, ticket_len, level;
1007 __be32 csum;
1005 int ret; 1008 int ret;
1006 1009
1007 _enter("{%d,%x}", conn->debug_id, key_serial(conn->server_key)); 1010 _enter("{%d,%x}", conn->debug_id, key_serial(conn->server_key));