]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 30 Mar 2008 21:27:01 +0000 (14:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 30 Mar 2008 21:27:01 +0000 (14:27 -0700)
* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm: fix for non-coherent DMA PowerPC
  drm: radeon: fix sparse integer as NULL pointer warnings in radeon_mem.c
  drm/i915: fix oops on agp=off
  drm/r300: fix bug in r300 userspace hardware wait emission

69 files changed:
arch/powerpc/oprofile/cell/vma_map.c
arch/powerpc/platforms/pseries/xics.c
drivers/ata/libata-core.c
drivers/ata/libata-eh.c
drivers/ata/pata_sil680.c
drivers/char/n_tty.c
drivers/char/nozomi.c
drivers/crypto/hifn_795x.c
drivers/dma/fsldma.h
drivers/dma/ioat_dca.c
drivers/ide/ide-iops.c
drivers/ide/ide-probe.c
drivers/infiniband/core/addr.c
drivers/infiniband/core/cm.c
drivers/infiniband/core/cma.c
drivers/lguest/lguest_user.c
drivers/media/common/saa7146_core.c
drivers/media/common/saa7146_fops.c
drivers/media/dvb/dvb-core/dvb_net.c
drivers/media/video/adv7170.c
drivers/media/video/adv7175.c
drivers/media/video/bt819.c
drivers/media/video/bt856.c
drivers/media/video/dpc7146.c
drivers/media/video/mt20xx.c
drivers/media/video/mxb.c
drivers/media/video/pvrusb2/pvrusb2-ctrl.c
drivers/media/video/pvrusb2/pvrusb2-hdw.c
drivers/media/video/pvrusb2/pvrusb2-io.c
drivers/media/video/pvrusb2/pvrusb2-ioread.c
drivers/media/video/pwc/pwc-if.c
drivers/media/video/saa7110.c
drivers/media/video/saa7111.c
drivers/media/video/saa7114.c
drivers/media/video/saa7185.c
drivers/media/video/tda9840.c
drivers/media/video/tea6415c.c
drivers/media/video/tea6420.c
drivers/media/video/tvp5150.c
drivers/media/video/zoran_driver.c
drivers/media/video/zr364xx.c
drivers/mfd/asic3.c
drivers/misc/fujitsu-laptop.c
drivers/misc/ibmasm/module.c
drivers/misc/lkdtm.c
drivers/net/dm9000.c
drivers/serial/8250_pci.c
drivers/virtio/virtio_pci.c
fs/cifs/cifsacl.c
fs/jbd/journal.c
fs/jbd/revoke.c
fs/jbd2/journal.c
fs/jbd2/revoke.c
fs/reiserfs/do_balan.c
fs/reiserfs/fix_node.c
fs/reiserfs/lbalance.c
fs/reiserfs/namei.c
fs/smbfs/smbiod.c
include/asm-frv/system.h
include/linux/compat.h
include/linux/dmaengine.h
include/linux/ide.h
include/linux/libata.h
kernel/cgroup.c
kernel/futex.c
kernel/futex_compat.c
mm/sparse-vmemmap.c
net/rxrpc/ar-internal.h
net/rxrpc/rxkad.c

index 76ec1d16aef79cad409500ad39bdb9101c2d8454..9a932177e70eca3efca0c06b88ce9a28f9ca9c98 100644 (file)
@@ -92,7 +92,7 @@ vma_map_add(struct vma_to_fileoffset_map *map, unsigned int vma,
  * A pointer to the first vma_map in the generated list
  * of vma_maps is returned.  */
 struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
-                                            unsigned long spu_elf_start)
+                                            unsigned long __spu_elf_start)
 {
        static const unsigned char expected[EI_PAD] = {
                [EI_MAG0] = ELFMAG0,
@@ -107,9 +107,11 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
 
        int grd_val;
        struct vma_to_fileoffset_map *map = NULL;
+       void __user *spu_elf_start = (void __user *)__spu_elf_start;
        struct spu_overlay_info ovly;
        unsigned int overlay_tbl_offset = -1;
-       unsigned long phdr_start, shdr_start;
+       Elf32_Phdr __user *phdr_start;
+       Elf32_Shdr __user *shdr_start;
        Elf32_Ehdr ehdr;
        Elf32_Phdr phdr;
        Elf32_Shdr shdr, shdr_str;
@@ -121,12 +123,12 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
        unsigned int ovly_buf_table_sym = 0;
        unsigned int ovly_table_end_sym = 0;
        unsigned int ovly_buf_table_end_sym = 0;
-       unsigned long ovly_table;
+       struct spu_overlay_info __user *ovly_table;
        unsigned int n_ovlys;
 
        /* Get and validate ELF header.  */
 
-       if (copy_from_user(&ehdr, (void *) spu_elf_start, sizeof (ehdr)))
+       if (copy_from_user(&ehdr, spu_elf_start, sizeof (ehdr)))
                goto fail;
 
        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,
 
        /* Traverse program headers.  */
        for (i = 0; i < ehdr.e_phnum; i++) {
-               if (copy_from_user(&phdr,
-                                  (void *) (phdr_start + i * sizeof(phdr)),
-                                  sizeof(phdr)))
+               if (copy_from_user(&phdr, phdr_start + i, sizeof(phdr)))
                        goto fail;
 
                if (phdr.p_type != PT_LOAD)
@@ -171,9 +171,7 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
        pr_debug("SPU_PROF: Created non-overlay maps\n");
        /* Traverse section table and search for overlay-related symbols.  */
        for (i = 0; i < ehdr.e_shnum; i++) {
-               if (copy_from_user(&shdr,
-                                  (void *) (shdr_start + i * sizeof(shdr)),
-                                  sizeof(shdr)))
+               if (copy_from_user(&shdr, shdr_start + i, sizeof(shdr)))
                        goto fail;
 
                if (shdr.sh_type != SHT_SYMTAB)
@@ -182,8 +180,7 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
                        continue;
 
                if (copy_from_user(&shdr_str,
-                                  (void *) (shdr_start + shdr.sh_link *
-                                            sizeof(shdr)),
+                                  shdr_start + shdr.sh_link,
                                   sizeof(shdr)))
                        goto fail;
 
@@ -191,15 +188,15 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
                        goto fail;;
 
                for (j = 0; j < shdr.sh_size / sizeof (sym); j++) {
-                       if (copy_from_user(&sym, (void *) (spu_elf_start +
-                                                      shdr.sh_offset + j *
-                                                          sizeof (sym)),
+                       if (copy_from_user(&sym, spu_elf_start +
+                                                shdr.sh_offset +
+                                                j * sizeof (sym),
                                           sizeof (sym)))
                                goto fail;
 
-                       if (copy_from_user(name, (void *)
-                                          (spu_elf_start + shdr_str.sh_offset +
-                                           sym.st_name),
+                       if (copy_from_user(name, 
+                                          spu_elf_start + shdr_str.sh_offset +
+                                          sym.st_name,
                                           20))
                                goto fail;
 
@@ -245,9 +242,7 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
 
        /* Traverse overlay table.  */
        for (i = 0; i < n_ovlys; i++) {
-               if (copy_from_user(&ovly, (void *)
-                                  (ovly_table + i * sizeof (ovly)),
-                                  sizeof (ovly)))
+               if (copy_from_user(&ovly, ovly_table + i, sizeof (ovly)))
                        goto fail;
 
                /* The ovly.vma/size/offset arguments are analogous to the same
index ca52b587166d950856f36bb4102aba8cb0f466e1..a977f200db895c6bbdfd4f98cc60a69af65912df 100644 (file)
@@ -763,7 +763,7 @@ void xics_request_IPIs(void)
 }
 #endif /* CONFIG_SMP */
 
-void xics_teardown_cpu()
+void xics_teardown_cpu(void)
 {
        int cpu = smp_processor_id();
 
index c4248b37ff645c71422d67f1c67802458d020a72..48519887f94a021caa2e91e9287ad1db491e9c29 100644 (file)
@@ -972,7 +972,7 @@ static void ata_dev_disable_pm(struct ata_device *dev)
 void ata_lpm_schedule(struct ata_port *ap, enum link_pm policy)
 {
        ap->pm_policy = policy;
-       ap->link.eh_info.action |= ATA_EHI_LPM;
+       ap->link.eh_info.action |= ATA_EH_LPM;
        ap->link.eh_info.flags |= ATA_EHI_NO_AUTOPSY;
        ata_port_schedule_eh(ap);
 }
index 681252fd814360103ec60e268aeffc6087e58341..a5830329eda4cda9f9660349305e9b1666ecd729 100644 (file)
@@ -2748,7 +2748,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
                        ehc->i.flags &= ~ATA_EHI_SETMODE;
                }
 
-               if (ehc->i.action & ATA_EHI_LPM)
+               if (ehc->i.action & ATA_EH_LPM)
                        ata_link_for_each_dev(dev, link)
                                ata_dev_enable_pm(dev, ap->pm_policy);
 
index 503245a1eafadba2126c4d310abe9dad4509396f..3988e44f4934b198a2beb1798ef903c6ce7979de 100644 (file)
@@ -269,7 +269,11 @@ static u8 sil680_init_chip(struct pci_dev *pdev, int *try_mmio)
        dev_dbg(&pdev->dev, "sil680: BA5_EN = %d clock = %02X\n",
                tmpbyte & 1, tmpbyte & 0x30);
 
-       *try_mmio = (tmpbyte & 1) || pci_resource_start(pdev, 5);
+       *try_mmio = 0;
+#ifdef CONFIG_PPC
+       if (machine_is(cell))
+               *try_mmio = (tmpbyte & 1) || pci_resource_start(pdev, 5);
+#endif
 
        switch(tmpbyte & 0x30) {
                case 0x00:
index 46b2a1cc8b54af4caf14971ca24ac95be101a390..0c09409fa45d4dc5f13a212c0211bab5fb307ae7 100644 (file)
@@ -1183,7 +1183,7 @@ static int copy_from_read_buf(struct tty_struct *tty,
        return retval;
 }
 
-extern ssize_t redirected_tty_write(struct file *, const char *,
+extern ssize_t redirected_tty_write(struct file *, const char __user *,
                                                        size_t, loff_t *);
 
 /**
index 6d0dc5f9b6bbc015b4b4323d02fb6ed83b7e81e9..6a6843a0a6742ba15b44cbf47fe93856ed71b26f 100644 (file)
@@ -438,7 +438,7 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
                        u32 size_bytes)
 {
        u32 i = 0;
-       const u32 *ptr = (__force u32 *) mem_addr_start;
+       const u32 __iomem *ptr = mem_addr_start;
        u16 *buf16;
 
        if (unlikely(!ptr || !buf))
@@ -448,11 +448,11 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
        switch (size_bytes) {
        case 2: /* 2 bytes */
                buf16 = (u16 *) buf;
-               *buf16 = __le16_to_cpu(readw((void __iomem *)ptr));
+               *buf16 = __le16_to_cpu(readw(ptr));
                goto out;
                break;
        case 4: /* 4 bytes */
-               *(buf) = __le32_to_cpu(readl((void __iomem *)ptr));
+               *(buf) = __le32_to_cpu(readl(ptr));
                goto out;
                break;
        }
@@ -461,11 +461,11 @@ static void read_mem32(u32 *buf, const void __iomem *mem_addr_start,
                if (size_bytes - i == 2) {
                        /* Handle 2 bytes in the end */
                        buf16 = (u16 *) buf;
-                       *(buf16) = __le16_to_cpu(readw((void __iomem *)ptr));
+                       *(buf16) = __le16_to_cpu(readw(ptr));
                        i += 2;
                } else {
                        /* Read 4 bytes */
-                       *(buf) = __le32_to_cpu(readl((void __iomem *)ptr));
+                       *(buf) = __le32_to_cpu(readl(ptr));
                        i += 4;
                }
                buf++;
@@ -484,7 +484,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
                        u32 size_bytes)
 {
        u32 i = 0;
-       u32 *ptr = (__force u32 *) mem_addr_start;
+       u32 __iomem *ptr = mem_addr_start;
        const u16 *buf16;
 
        if (unlikely(!ptr || !buf))
@@ -494,7 +494,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
        switch (size_bytes) {
        case 2: /* 2 bytes */
                buf16 = (const u16 *)buf;
-               writew(__cpu_to_le16(*buf16), (void __iomem *)ptr);
+               writew(__cpu_to_le16(*buf16), ptr);
                return 2;
                break;
        case 1: /*
@@ -502,7 +502,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
                 * so falling through..
                 */
        case 4: /* 4 bytes */
-               writel(__cpu_to_le32(*buf), (void __iomem *)ptr);
+               writel(__cpu_to_le32(*buf), ptr);
                return 4;
                break;
        }
@@ -511,11 +511,11 @@ static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
                if (size_bytes - i == 2) {
                        /* 2 bytes */
                        buf16 = (const u16 *)buf;
-                       writew(__cpu_to_le16(*buf16), (void __iomem *)ptr);
+                       writew(__cpu_to_le16(*buf16), ptr);
                        i += 2;
                } else {
                        /* 4 bytes */
-                       writel(__cpu_to_le32(*buf), (void __iomem *)ptr);
+                       writel(__cpu_to_le32(*buf), ptr);
                        i += 4;
                }
                buf++;
index 3110bf7014f7b18bc636bddfae099e8d62294db9..81f3f950cd7d4c5007a64cadd11c18b61c8c6db2 100644 (file)
@@ -392,8 +392,8 @@ static atomic_t hifn_dev_number;
 
 struct hifn_desc
 {
-       volatile u32            l;
-       volatile u32            p;
+       volatile __le32         l;
+       volatile __le32         p;
 };
 
 struct hifn_dma {
@@ -481,10 +481,10 @@ struct hifn_device
 
 struct hifn_base_command
 {
-       volatile u16            masks;
-       volatile u16            session_num;
-       volatile u16            total_source_count;
-       volatile u16            total_dest_count;
+       volatile __le16         masks;
+       volatile __le16         session_num;
+       volatile __le16         total_source_count;
+       volatile __le16         total_dest_count;
 };
 
 #define        HIFN_BASE_CMD_COMP              0x0100  /* enable compression engine */
@@ -504,10 +504,10 @@ struct hifn_base_command
  */
 struct hifn_crypt_command
 {
-       volatile u16            masks;
-       volatile u16            header_skip;
-       volatile u16            source_count;
-       volatile u16            reserved;
+       volatile __le16                 masks;
+       volatile __le16                 header_skip;
+       volatile __le16                 source_count;
+       volatile __le16                 reserved;
 };
 
 #define        HIFN_CRYPT_CMD_ALG_MASK         0x0003          /* algorithm: */
@@ -670,7 +670,7 @@ static inline u32 hifn_read_0(struct hifn_device *dev, u32 reg)
 {
        u32 ret;
 
-       ret = readl((char *)(dev->bar[0]) + reg);
+       ret = readl(dev->bar[0] + reg);
 
        return ret;
 }
@@ -679,19 +679,19 @@ static inline u32 hifn_read_1(struct hifn_device *dev, u32 reg)
 {
        u32 ret;
 
-       ret = readl((char *)(dev->bar[1]) + reg);
+       ret = readl(dev->bar[1] + reg);
 
        return ret;
 }
 
 static inline void hifn_write_0(struct hifn_device *dev, u32 reg, u32 val)
 {
-       writel(val, (char *)(dev->bar[0]) + reg);
+       writel(val, dev->bar[0] + reg);
 }
 
 static inline void hifn_write_1(struct hifn_device *dev, u32 reg, u32 val)
 {
-       writel(val, (char *)(dev->bar[1]) + reg);
+       writel(val, dev->bar[1] + reg);
 }
 
 static void hifn_wait_puc(struct hifn_device *dev)
index fddd6aee2a63acb7fd56af275c226c5f8035e066..6faf07ba0d0eb4d095f1968dee4bdd8d5ea803c0 100644 (file)
 #define FSL_DMA_DGSR_EOSI      0x02
 #define FSL_DMA_DGSR_EOLSI     0x01
 
+typedef u64 __bitwise v64;
+typedef u32 __bitwise v32;
+
 struct fsl_dma_ld_hw {
-       u64 __bitwise   src_addr;
-       u64 __bitwise   dst_addr;
-       u64 __bitwise   next_ln_addr;
-       u32 __bitwise   count;
-       u32 __bitwise   reserve;
+       v64 src_addr;
+       v64 dst_addr;
+       v64 next_ln_addr;
+       v32 count;
+       v32 reserve;
 } __attribute__((aligned(32)));
 
 struct fsl_desc_sw {
@@ -92,13 +95,13 @@ struct fsl_desc_sw {
 } __attribute__((aligned(32)));
 
 struct fsl_dma_chan_regs {
-       u32 __bitwise   mr;     /* 0x00 - Mode Register */
-       u32 __bitwise   sr;     /* 0x04 - Status Register */
-       u64 __bitwise   cdar;   /* 0x08 - Current descriptor address register */
-       u64 __bitwise   sar;    /* 0x10 - Source Address Register */
-       u64 __bitwise   dar;    /* 0x18 - Destination Address Register */
-       u32 __bitwise   bcr;    /* 0x20 - Byte Count Register */
-       u64 __bitwise   ndar;   /* 0x24 - Next Descriptor Address Register */
+       u32 mr; /* 0x00 - Mode Register */
+       u32 sr; /* 0x04 - Status Register */
+       u64 cdar;       /* 0x08 - Current descriptor address register */
+       u64 sar;        /* 0x10 - Source Address Register */
+       u64 dar;        /* 0x18 - Destination Address Register */
+       u32 bcr;        /* 0x20 - Byte Count Register */
+       u64 ndar;       /* 0x24 - Next Descriptor Address Register */
 };
 
 struct fsl_dma_chan;
@@ -151,25 +154,27 @@ struct fsl_dma_chan {
 #ifndef __powerpc64__
 static u64 in_be64(const u64 __iomem *addr)
 {
-       return ((u64)in_be32((u32 *)addr) << 32) | (in_be32((u32 *)addr + 1));
+       return ((u64)in_be32((u32 __iomem *)addr) << 32) |
+               (in_be32((u32 __iomem *)addr + 1));
 }
 
 static void out_be64(u64 __iomem *addr, u64 val)
 {
-       out_be32((u32 *)addr, val >> 32);
-       out_be32((u32 *)addr + 1, (u32)val);
+       out_be32((u32 __iomem *)addr, val >> 32);
+       out_be32((u32 __iomem *)addr + 1, (u32)val);
 }
 
 /* There is no asm instructions for 64 bits reverse loads and stores */
 static u64 in_le64(const u64 __iomem *addr)
 {
-       return ((u64)in_le32((u32 *)addr + 1) << 32) | (in_le32((u32 *)addr));
+       return ((u64)in_le32((u32 __iomem *)addr + 1) << 32) |
+               (in_le32((u32 __iomem *)addr));
 }
 
 static void out_le64(u64 __iomem *addr, u64 val)
 {
-       out_le32((u32 *)addr + 1, val >> 32);
-       out_le32((u32 *)addr, (u32)val);
+       out_le32((u32 __iomem *)addr + 1, val >> 32);
+       out_le32((u32 __iomem *)addr, (u32)val);
 }
 #endif
 
@@ -182,9 +187,11 @@ static void out_le64(u64 __iomem *addr, u64 val)
 
 #define DMA_TO_CPU(fsl_chan, d, width)                                 \
                (((fsl_chan)->feature & FSL_DMA_BIG_ENDIAN) ?           \
-                       be##width##_to_cpu(d) : le##width##_to_cpu(d))
+                       be##width##_to_cpu((__force __be##width)(v##width)d) : \
+                       le##width##_to_cpu((__force __le##width)(v##width)d))
 #define CPU_TO_DMA(fsl_chan, c, width)                                 \
                (((fsl_chan)->feature & FSL_DMA_BIG_ENDIAN) ?           \
-                       cpu_to_be##width(c) : cpu_to_le##width(c))
+                       (__force v##width)cpu_to_be##width(c) :         \
+                       (__force v##width)cpu_to_le##width(c))
 
 #endif /* __DMA_FSLDMA_H */
index 0fa8a98051a8b05f8f0b1705e1ca430c2c91bbf8..9e922760b7ffc4b76688bf56652e72085827e7da 100644 (file)
@@ -98,7 +98,7 @@ struct ioat_dca_slot {
 
 struct ioat_dca_priv {
        void __iomem            *iobase;
-       void                    *dca_base;
+       void __iomem            *dca_base;
        int                      max_requesters;
        int                      requester_count;
        u8                       tag_map[IOAT_TAG_MAP_LEN];
@@ -338,7 +338,7 @@ static struct dca_ops ioat2_dca_ops = {
        .get_tag                = ioat2_dca_get_tag,
 };
 
-static int ioat2_dca_count_dca_slots(void *iobase, u16 dca_offset)
+static int ioat2_dca_count_dca_slots(void __iomem *iobase, u16 dca_offset)
 {
        int slots = 0;
        u32 req;
index c419266234a75276a1ed85e00314d6b182b12b70..01b92208f09d4b8dbd23090ef31c2176eed4a665 100644 (file)
@@ -595,6 +595,7 @@ u8 eighty_ninty_three (ide_drive_t *drive)
 
        /*
         * FIXME:
+        * - change master/slave IDENTIFY order
         * - force bit13 (80c cable present) check also for !ivb devices
         *   (unless the slave device is pre-ATA3)
         */
index 194ecb0049eb1ed37c3dde4c00d3a83273c1dc88..47a114927c318ffc4b22229c59eb5e97db9e539f 100644 (file)
@@ -774,9 +774,10 @@ static int ide_probe_port(ide_hwif_t *hwif)
                printk(KERN_DEBUG "%s: Wait for ready failed before probe !\n", hwif->name);
 
        /*
-        * Need to probe slave device first to make it release PDIAG-.
+        * Second drive should only exist if first drive was found,
+        * but a lot of cdrom drives are configured as single slaves.
         */
-       for (unit = MAX_DRIVES - 1; unit >= 0; unit--) {
+       for (unit = 0; unit < MAX_DRIVES; ++unit) {
                ide_drive_t *drive = &hwif->drives[unit];
                drive->dn = (hwif->channel ? 2 : 0) + unit;
                (void) probe_for_drive(drive);
index a58ad8a470f98219f9286a12ed8bd9195dbae1bf..781ea59503737bdf558ca0391bfa6b75700f1702 100644 (file)
@@ -154,7 +154,7 @@ static void addr_send_arp(struct sockaddr_in *dst_in)
 {
        struct rtable *rt;
        struct flowi fl;
-       u32 dst_ip = dst_in->sin_addr.s_addr;
+       __be32 dst_ip = dst_in->sin_addr.s_addr;
 
        memset(&fl, 0, sizeof fl);
        fl.nl_u.ip4_u.daddr = dst_ip;
@@ -169,8 +169,8 @@ static int addr_resolve_remote(struct sockaddr_in *src_in,
                               struct sockaddr_in *dst_in,
                               struct rdma_dev_addr *addr)
 {
-       u32 src_ip = src_in->sin_addr.s_addr;
-       u32 dst_ip = dst_in->sin_addr.s_addr;
+       __be32 src_ip = src_in->sin_addr.s_addr;
+       __be32 dst_ip = dst_in->sin_addr.s_addr;
        struct flowi fl;
        struct rtable *rt;
        struct neighbour *neigh;
@@ -257,7 +257,7 @@ static int addr_resolve_local(struct sockaddr_in *src_in,
                              struct rdma_dev_addr *addr)
 {
        struct net_device *dev;
-       u32 src_ip = src_in->sin_addr.s_addr;
+       __be32 src_ip = src_in->sin_addr.s_addr;
        __be32 dst_ip = dst_in->sin_addr.s_addr;
        int ret;
 
index 4df405157086f458aae293a837a83d0983556210..faa7ce318a6d8e71300cbe7445685a6f114e975d 100644 (file)
@@ -393,7 +393,7 @@ static int cm_alloc_id(struct cm_id_private *cm_id_priv)
                spin_unlock_irqrestore(&cm.lock, flags);
        } while( (ret == -EAGAIN) && idr_pre_get(&cm.local_id_table, GFP_KERNEL) );
 
-       cm_id_priv->id.local_id = (__force __be32) (id ^ cm.random_id_operand);
+       cm_id_priv->id.local_id = (__force __be32)id ^ cm.random_id_operand;
        return ret;
 }
 
index 34507daaf9b654e11b35dd7f68b9b7549008b57d..d81c156a22b41b85ce727bd585376bed2345e903 100644 (file)
@@ -168,15 +168,15 @@ struct cma_work {
 union cma_ip_addr {
        struct in6_addr ip6;
        struct {
-               __u32 pad[3];
-               __u32 addr;
+               __be32 pad[3];
+               __be32 addr;
        } ip4;
 };
 
 struct cma_hdr {
        u8 cma_version;
        u8 ip_version;  /* IP version: 7:4 */
-       __u16 port;
+       __be16 port;
        union cma_ip_addr src_addr;
        union cma_ip_addr dst_addr;
 };
@@ -186,8 +186,8 @@ struct sdp_hh {
        u8 sdp_version; /* Major version: 7:4 */
        u8 ip_version;  /* IP version: 7:4 */
        u8 sdp_specific1[10];
-       __u16 port;
-       __u16 sdp_specific2;
+       __be16 port;
+       __be16 sdp_specific2;
        union cma_ip_addr src_addr;
        union cma_ip_addr dst_addr;
 };
@@ -663,7 +663,7 @@ static inline int cma_any_port(struct sockaddr *addr)
 }
 
 static int cma_get_net_info(void *hdr, enum rdma_port_space ps,
-                           u8 *ip_ver, __u16 *port,
+                           u8 *ip_ver, __be16 *port,
                            union cma_ip_addr **src, union cma_ip_addr **dst)
 {
        switch (ps) {
@@ -695,7 +695,7 @@ static int cma_get_net_info(void *hdr, enum rdma_port_space ps,
 
 static void cma_save_net_info(struct rdma_addr *addr,
                              struct rdma_addr *listen_addr,
-                             u8 ip_ver, __u16 port,
+                             u8 ip_ver, __be16 port,
                              union cma_ip_addr *src, union cma_ip_addr *dst)
 {
        struct sockaddr_in *listen4, *ip4;
@@ -996,7 +996,7 @@ static struct rdma_id_private *cma_new_conn_id(struct rdma_cm_id *listen_id,
        struct rdma_cm_id *id;
        struct rdma_route *rt;
        union cma_ip_addr *src, *dst;
-       __u16 port;
+       __be16 port;
        u8 ip_ver;
 
        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,
        struct rdma_id_private *id_priv;
        struct rdma_cm_id *id;
        union cma_ip_addr *src, *dst;
-       __u16 port;
+       __be16 port;
        u8 ip_ver;
        int ret;
 
@@ -1165,7 +1165,7 @@ static void cma_set_compare_data(enum rdma_port_space ps, struct sockaddr *addr,
 {
        struct cma_hdr *cma_data, *cma_mask;
        struct sdp_hh *sdp_data, *sdp_mask;
-       __u32 ip4_addr;
+       __be32 ip4_addr;
        struct in6_addr ip6_addr;
 
        memset(compare, 0, sizeof *compare);
@@ -1181,12 +1181,12 @@ static void cma_set_compare_data(enum rdma_port_space ps, struct sockaddr *addr,
                        sdp_set_ip_ver(sdp_data, 4);
                        sdp_set_ip_ver(sdp_mask, 0xF);
                        sdp_data->dst_addr.ip4.addr = ip4_addr;
-                       sdp_mask->dst_addr.ip4.addr = ~0;
+                       sdp_mask->dst_addr.ip4.addr = htonl(~0);
                } else {
                        cma_set_ip_ver(cma_data, 4);
                        cma_set_ip_ver(cma_mask, 0xF);
                        cma_data->dst_addr.ip4.addr = ip4_addr;
-                       cma_mask->dst_addr.ip4.addr = ~0;
+                       cma_mask->dst_addr.ip4.addr = htonl(~0);
                }
                break;
        case AF_INET6:
index 564e425d71dd37747735e8ba47ed1b1881a022cb..645e6e040bfbeab46bad83b52f9bdf42a310d788 100644 (file)
@@ -189,7 +189,7 @@ static int initialize(struct file *file, const unsigned long __user *input)
        }
 
        /* Populate the easy fields of our "struct lguest" */
-       lg->mem_base = (void __user *)(long)args[0];
+       lg->mem_base = (void __user *)args[0];
        lg->pfn_limit = args[1];
 
        /* This is the first cpu (cpu 0) and it will start booting at args[3] */
index 168a8d3a5e556e889b7b44033b06531addb9faf8..7707b8c7394b17308c067b2813f6809e105c5072 100644 (file)
@@ -306,25 +306,22 @@ static irqreturn_t interrupt_hw(int irq, void *dev_id)
                return IRQ_NONE;
        }
 
-       if( 0 != (dev->ext)) {
-               if( 0 != (dev->ext->irq_mask & isr )) {
-                       if( 0 != dev->ext->irq_func ) {
+       if (dev->ext) {
+               if (dev->ext->irq_mask & isr) {
+                       if (dev->ext->irq_func)
                                dev->ext->irq_func(dev, &isr);
-                       }
                        isr &= ~dev->ext->irq_mask;
                }
        }
        if (0 != (isr & (MASK_27))) {
                DEB_INT(("irq: RPS0 (0x%08x).\n",isr));
-               if( 0 != dev->vv_data && 0 != dev->vv_callback) {
+               if (dev->vv_data && dev->vv_callback)
                        dev->vv_callback(dev,isr);
-               }
                isr &= ~MASK_27;
        }
        if (0 != (isr & (MASK_28))) {
-               if( 0 != dev->vv_data && 0 != dev->vv_callback) {
+               if (dev->vv_data && dev->vv_callback)
                        dev->vv_callback(dev,isr);
-               }
                isr &= ~MASK_28;
        }
        if (0 != (isr & (MASK_16|MASK_17))) {
index f0703d8bc3e8d9492e47382330db3f021dbb93e8..171afe7da6b60e9d66dd78259d987aada6eb0dfa 100644 (file)
@@ -272,7 +272,7 @@ static int fops_open(struct inode *inode, struct file *file)
 
        result = 0;
 out:
-       if( fh != 0 && result != 0 ) {
+       if (fh && result != 0) {
                kfree(fh);
                file->private_data = NULL;
        }
index ed3f8268ed11445e60fce10500a66e15d3e3be53..4c8b62e2c035246095e5fc6e750a3127e7a188b3 100644 (file)
@@ -784,8 +784,8 @@ static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len,
 {
        struct net_device *dev = feed->priv;
 
-       if (buffer2 != 0)
-               printk(KERN_WARNING "buffer2 not 0: %p.\n", buffer2);
+       if (buffer2)
+               printk(KERN_WARNING "buffer2 not NULL: %p.\n", buffer2);
        if (buffer1_len > 32768)
                printk(KERN_WARNING "length > 32k: %zu.\n", buffer1_len);
        /* printk("TS callback: %u bytes, %u TS cells @ %p.\n",
index cbab53fc6243a830a94aaecb6fd122c61198611b..fea2e723e34b965da2853c58a9d2618d6f0a98f2 100644 (file)
@@ -408,7 +408,7 @@ adv7170_detect_client (struct i2c_adapter *adapter,
                return 0;
 
        client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
-       if (client == 0)
+       if (!client)
                return -ENOMEM;
        client->addr = address;
        client->adapter = adapter;
index 0d0c554bfdf7bce39f3ca0736bf768d27047137f..10d4d89623f15431080c3fda94b37164c4dc67fd 100644 (file)
@@ -426,7 +426,7 @@ adv7175_detect_client (struct i2c_adapter *adapter,
                return 0;
 
        client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
-       if (client == 0)
+       if (!client)
                return -ENOMEM;
        client->addr = address;
        client->adapter = adapter;
index 12d1b9248be599faa2d7bababc59c9d4816632b8..e663cc045c41c7a1748145b0b78f7ea41860c628 100644 (file)
@@ -524,7 +524,7 @@ bt819_detect_client (struct i2c_adapter *adapter,
                return 0;
 
        client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
-       if (client == 0)
+       if (!client)
                return -ENOMEM;
        client->addr = address;
        client->adapter = adapter;
index e1028a76c042046760d3a634552c92a9bd441006..7dee2e3235ad5619a735c0c74db3c4c67d25cd32 100644 (file)
@@ -311,7 +311,7 @@ bt856_detect_client (struct i2c_adapter *adapter,
                return 0;
 
        client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
-       if (client == 0)
+       if (!client)
                return -ENOMEM;
        client->addr = address;
        client->adapter = adapter;
index 566e479e2629086145954876da78da7dc5cd7e60..9ceb6b2f394920af86ff64bc7be36f3a080c3cfb 100644 (file)
@@ -131,7 +131,7 @@ static int dpc_probe(struct saa7146_dev* dev)
        device_for_each_child(&dpc->i2c_adapter.dev, dpc, dpc_check_clients);
 
        /* check if all devices are present */
-       if( 0 == dpc->saa7111a ) {
+       if (!dpc->saa7111a) {
                DEB_D(("dpc_v4l2.o: dpc_attach failed for this device.\n"));
                i2c_del_adapter(&dpc->i2c_adapter);
                kfree(dpc);
index 58bab653330fee8ce0b6e26d618cd02c3c9fb37e..74fd6a01d4c4060b05037f93d7069715b0b41433 100644 (file)
@@ -647,7 +647,7 @@ struct dvb_frontend *microtune_attach(struct dvb_frontend *fe,
        default:
                tuner_info("microtune %s found, not (yet?) supported, sorry :-/\n",
                           name);
-               return 0;
+               return NULL;
        }
 
        strlcpy(fe->ops.tuner_ops.info.name, name,
index add6d0d680bed7fc8e43ac6d687232cd12627ab9..cb5a510f9251b49f5e1a9ccfecf0d386b7e80c0b 100644 (file)
@@ -221,9 +221,8 @@ static int mxb_probe(struct saa7146_dev* dev)
        device_for_each_child(&mxb->i2c_adapter.dev, mxb, mxb_check_clients);
 
        /* check if all devices are present */
-       if(    0 == mxb->tea6420_1      || 0 == mxb->tea6420_2  || 0 == mxb->tea6415c
-           || 0 == mxb->tda9840        || 0 == mxb->saa7111a   || 0 == mxb->tuner ) {
-
+       if (!mxb->tea6420_1 || !mxb->tea6420_2 || !mxb->tea6415c ||
+           !mxb->tda9840 || !mxb->saa7111a || !mxb->tuner) {
                printk("mxb: did not find all i2c devices. aborting\n");
                i2c_del_adapter(&mxb->i2c_adapter);
                kfree(mxb);
index 46f156fb108c79ffe2506470b857466f03ea6d10..5a3e8d21a38ae7e95b58cd4940a4b905186928d5 100644 (file)
@@ -60,7 +60,7 @@ int pvr2_ctrl_set_mask_value(struct pvr2_ctrl *cptr,int mask,int val)
        int ret = 0;
        if (!cptr) return -EINVAL;
        LOCK_TAKE(cptr->hdw->big_lock); do {
-               if (cptr->info->set_value != 0) {
+               if (cptr->info->set_value) {
                        if (cptr->info->type == pvr2_ctl_bitmask) {
                                mask &= cptr->info->def.type_bitmask.valid_bits;
                        } else if (cptr->info->type == pvr2_ctl_int) {
@@ -265,7 +265,7 @@ unsigned int pvr2_ctrl_get_v4lflags(struct pvr2_ctrl *cptr)
 int pvr2_ctrl_is_writable(struct pvr2_ctrl *cptr)
 {
        if (!cptr) return 0;
-       return cptr->info->set_value != 0;
+       return cptr->info->set_value != NULL;
 }
 
 
index 41ae980405edfac42a38cc22449389a68fe9658c..d6955fa39598bdce1b5be999e247a5179248db43 100644 (file)
@@ -2291,7 +2291,7 @@ static int pvr2_hdw_commit_setup(struct pvr2_hdw *hdw)
 
        for (idx = 0; idx < hdw->control_cnt; idx++) {
                cptr = hdw->controls + idx;
-               if (cptr->info->is_dirty == 0) continue;
+               if (!cptr->info->is_dirty) continue;
                if (!cptr->info->is_dirty(cptr)) continue;
                commit_flag = !0;
 
@@ -2646,7 +2646,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw,
        u16 address;
        unsigned int pipe;
        LOCK_TAKE(hdw->big_lock); do {
-               if ((hdw->fw_buffer == 0) == !enable_flag) break;
+               if ((hdw->fw_buffer == NULL) == !enable_flag) break;
 
                if (!enable_flag) {
                        pvr2_trace(PVR2_TRACE_FIRMWARE,
@@ -2715,7 +2715,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw,
 /* Return true if we're in a mode for retrieval CPU firmware */
 int pvr2_hdw_cpufw_get_enabled(struct pvr2_hdw *hdw)
 {
-       return hdw->fw_buffer != 0;
+       return hdw->fw_buffer != NULL;
 }
 
 
index ce3c8982ffe088aa6378da27ef18a9af4e6e9545..a9889ff96ecc945b1f344c9fd4ab7e8eced695e0 100644 (file)
@@ -563,7 +563,7 @@ void pvr2_stream_kill(struct pvr2_stream *sp)
        struct pvr2_buffer *bp;
        mutex_lock(&sp->mutex); do {
                pvr2_stream_internal_flush(sp);
-               while ((bp = pvr2_stream_get_ready_buffer(sp)) != 0) {
+               while ((bp = pvr2_stream_get_ready_buffer(sp)) != NULL) {
                        pvr2_buffer_set_idle(bp);
                }
                if (sp->buffer_total_count != sp->buffer_target_count) {
index f782418afa45db71c6a07e27382db0e5a5637b3e..c572212c9f158feddba21f5757ad8018016a73a5 100644 (file)
@@ -165,7 +165,7 @@ static int pvr2_ioread_start(struct pvr2_ioread *cp)
        if (!(cp->stream)) return 0;
        pvr2_trace(PVR2_TRACE_START_STOP,
                   "/*---TRACE_READ---*/ pvr2_ioread_start id=%p",cp);
-       while ((bp = pvr2_stream_get_idle_buffer(cp->stream)) != 0) {
+       while ((bp = pvr2_stream_get_idle_buffer(cp->stream)) != NULL) {
                stat = pvr2_buffer_queue(bp);
                if (stat < 0) {
                        pvr2_trace(PVR2_TRACE_DATA_FLOW,
index f991d72fe10808d29263e7c0cb6411e9f93bc0b1..e0a453a6543d2526c2ba3ef39e1dd86901c8c89e 100644 (file)
@@ -915,7 +915,7 @@ static void pwc_iso_stop(struct pwc_device *pdev)
                struct urb *urb;
 
                urb = pdev->sbuf[i].urb;
-               if (urb != 0) {
+               if (urb) {
                        PWC_DEBUG_MEMORY("Unlinking URB %p\n", urb);
                        usb_kill_urb(urb);
                }
@@ -931,7 +931,7 @@ static void pwc_iso_free(struct pwc_device *pdev)
                struct urb *urb;
 
                urb = pdev->sbuf[i].urb;
-               if (urb != 0) {
+               if (urb) {
                        PWC_DEBUG_MEMORY("Freeing URB\n");
                        usb_free_urb(urb);
                        pdev->sbuf[i].urb = NULL;
@@ -1759,8 +1759,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
 
        /* Allocate video_device structure */
        pdev->vdev = video_device_alloc();
-       if (pdev->vdev == 0)
-       {
+       if (!pdev->vdev) {
                PWC_ERROR("Err, cannot allocate video_device struture. Failing probe.");
                kfree(pdev);
                return -ENOMEM;
index 061134a7ba9fe7ce69cdf91f6937710a7a459b82..1df2602cd1842c40d0ed1a9ca56d2793221e8a0c 100644 (file)
@@ -488,7 +488,7 @@ saa7110_detect_client (struct i2c_adapter *adapter,
                return 0;
 
        client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
-       if (client == 0)
+       if (!client)
                return -ENOMEM;
        client->addr = address;
        client->adapter = adapter;
@@ -496,7 +496,7 @@ saa7110_detect_client (struct i2c_adapter *adapter,
        strlcpy(I2C_NAME(client), "saa7110", sizeof(I2C_NAME(client)));
 
        decoder = kzalloc(sizeof(struct saa7110), GFP_KERNEL);
-       if (decoder == 0) {
+       if (!decoder) {
                kfree(client);
                return -ENOMEM;
        }
index 7ae2d646d0008f12a8a94fd2058c6e0673dac076..a0772c53bb1f5e78c8dd2a00b5dd529664805683 100644 (file)
@@ -502,7 +502,7 @@ saa7111_detect_client (struct i2c_adapter *adapter,
                return 0;
 
        client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
-       if (client == 0)
+       if (!client)
                return -ENOMEM;
        client->addr = address;
        client->adapter = adapter;
index 677df51de1a9e3136856dd417260df4e5dd1a46e..bf91a4faa706f154903b9be9f7069fb9e55ded2a 100644 (file)
@@ -841,7 +841,7 @@ saa7114_detect_client (struct i2c_adapter *adapter,
                return 0;
 
        client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
-       if (client == 0)
+       if (!client)
                return -ENOMEM;
        client->addr = address;
        client->adapter = adapter;
index 66cc92c0ea66f725a43a29ea652621218ff11212..41f70440fd3bcb2b842720680d4d42a3b97476a9 100644 (file)
@@ -403,7 +403,7 @@ saa7185_detect_client (struct i2c_adapter *adapter,
                return 0;
 
        client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
-       if (client == 0)
+       if (!client)
                return -ENOMEM;
        client->addr = address;
        client->adapter = adapter;
index ef494febb5e4f7996c9752861cde4134c6c74c80..bdca5d278978374b7a65e7e55bd65aa06a010ee2 100644 (file)
@@ -172,7 +172,7 @@ static int detect(struct i2c_adapter *adapter, int address, int kind)
 
        /* allocate memory for client structure */
        client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
-       if (0 == client) {
+       if (!client) {
                printk("not enough kernel memory\n");
                return -ENOMEM;
        }
index 523df0b8cc63c387e4446a41a91fe62d8e392d3a..df2fad9f391eb0a2936b8c14c39c51a1273a0e0c 100644 (file)
@@ -64,7 +64,7 @@ static int detect(struct i2c_adapter *adapter, int address, int kind)
 
        /* allocate memory for client structure */
        client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
-       if (0 == client) {
+       if (!client) {
                return -ENOMEM;
        }
 
index ca05cd65508765559524b104dc7805ab5dad278f..4ff6c63f7237517a05d974fd60cfbcbb838af0cf 100644 (file)
@@ -101,7 +101,7 @@ static int tea6420_detect(struct i2c_adapter *adapter, int address, int kind)
 
        /* allocate memory for client structure */
        client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
-       if (0 == client) {
+       if (!client) {
                return -ENOMEM;
        }
 
index d28318cb2b8d2a5b88c3d048ad27c8cbd6661cc1..b6e24e714a230c1e53e212687dd97b1140cf0f22 100644 (file)
@@ -1072,12 +1072,12 @@ static int tvp5150_detect_client(struct i2c_adapter *adapter,
                return 0;
 
        c = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
-       if (c == 0)
+       if (!c)
                return -ENOMEM;
        memcpy(c, &client_template, sizeof(struct i2c_client));
 
        core = kzalloc(sizeof(struct tvp5150), GFP_KERNEL);
-       if (core == 0) {
+       if (!core) {
                kfree(c);
                return -ENOMEM;
        }
index dd3d7d2c8b0e38323ed29e2a9b21a6a429a46111..fea4946ee713c82d4b17eaff5864ccb943a9f545 100644 (file)
@@ -339,7 +339,7 @@ v4l_fbuffer_alloc (struct file *file)
                        /* Use kmalloc */
 
                        mem = kmalloc(fh->v4l_buffers.buffer_size, GFP_KERNEL);
-                       if (mem == 0) {
+                       if (!mem) {
                                dprintk(1,
                                        KERN_ERR
                                        "%s: v4l_fbuffer_alloc() - kmalloc for V4L buf %d failed\n",
index 1b44784d0efb46b26054d930eb732e553c08d326..04949c823654db4b4e95d4a4814d73a23a029d02 100644 (file)
@@ -390,7 +390,7 @@ static int read_frame(struct zr364xx_camera *cam, int framenum)
 }
 
 
-static ssize_t zr364xx_read(struct file *file, char *buf, size_t cnt,
+static ssize_t zr364xx_read(struct file *file, char __user *buf, size_t cnt,
                            loff_t * ppos)
 {
        unsigned long count = cnt;
index 63fb1ff3ad100b61b8a441cae9435fdb0186c264..f6f2d960cadbef6e883842b4b43b09a85947f4ea 100644 (file)
 static inline void asic3_write_register(struct asic3 *asic,
                                 unsigned int reg, u32 value)
 {
-       iowrite16(value, (unsigned long)asic->mapping +
+       iowrite16(value, asic->mapping +
                  (reg >> asic->bus_shift));
 }
 
 static inline u32 asic3_read_register(struct asic3 *asic,
                               unsigned int reg)
 {
-       return ioread16((unsigned long)asic->mapping +
+       return ioread16(asic->mapping +
                        (reg >> asic->bus_shift));
 }
 
index 1cfd7f3f129400fd9d8d22d429689d6d29234d4a..e2e7c05a147b7382ea0516a3fa6702716081f38f 100644 (file)
@@ -231,7 +231,7 @@ static int acpi_fujitsu_remove(struct acpi_device *device, int type)
 
        if (!device || !acpi_driver_data(device))
                return -EINVAL;
-       fujitsu->acpi_handle = 0;
+       fujitsu->acpi_handle = NULL;
 
        return 0;
 }
index 4f9d4a9da983ddfaa58c3c2f99b57e5da9119e4e..b5f6add34b0b9b4a39b587c51e3dc7079722c50a 100644 (file)
@@ -106,7 +106,7 @@ static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_devi
        sp->irq = pdev->irq;
        sp->base_address = ioremap(pci_resource_start(pdev, 0),
                                        pci_resource_len(pdev, 0));
-       if (sp->base_address == 0) {
+       if (!sp->base_address) {
                dev_err(sp->dev, "Failed to ioremap pci memory\n");
                result =  -ENODEV;
                goto error_ioremap;
index c884730c5eafc55701486be80c13450f1f6a09e8..1bfe5d16963b9ece644b25c5bb81a411d2c1045f 100644 (file)
@@ -197,7 +197,7 @@ static int lkdtm_parse_commandline(void)
 {
        int i;
 
-       if (cpoint_name == INVALID || cpoint_type == NONE ||
+       if (cpoint_name == NULL || cpoint_type == NULL ||
                                        cpoint_count < 1 || recur_count < 1)
                return -EINVAL;
 
index b09a53de1c53373c1d469f60a6c1356fb12f63d9..d63cc93f055dfd2be2c8a493a514b20a743fd9fa 100644 (file)
@@ -968,7 +968,7 @@ dm9000_interrupt(int irq, void *dev_id)
 struct dm9000_rxhdr {
        u8      RxPktReady;
        u8      RxStatus;
-       u16     RxLen;
+       __le16  RxLen;
 } __attribute__((__packed__));
 
 /*
index a8bec498cad6f8dddd323dd7a3df9b8e7b1a65ac..f97224ce59da709f739dfe45c31631ac4a635adc 100644 (file)
@@ -1214,13 +1214,6 @@ static struct pciserial_board pci_boards[] __devinitdata = {
                .base_baud      = 115200,
                .uart_offset    = 8,
        },
-       [pbn_b0_8_115200] = {
-               .flags          = FL_BASE0,
-               .num_ports      = 8,
-               .base_baud      = 115200,
-               .uart_offset    = 8,
-       },
-
        [pbn_b0_1_921600] = {
                .flags          = FL_BASE0,
                .num_ports      = 1,
index 6c8ecde6aad188a17b44030e1769ac2310564605..c0df924766a7ea0daaf0bfa46ad5df4c06a2adc8 100644 (file)
@@ -37,7 +37,7 @@ struct virtio_pci_device
        struct pci_dev *pci_dev;
 
        /* the IO mapping for the PCI config space */
-       void *ioaddr;
+       void __iomem *ioaddr;
 
        /* a list of queues so we can dispatch IRQs */
        spinlock_t lock;
@@ -111,7 +111,7 @@ static void vp_get(struct virtio_device *vdev, unsigned offset,
                   void *buf, unsigned len)
 {
        struct virtio_pci_device *vp_dev = to_vp_device(vdev);
-       void *ioaddr = vp_dev->ioaddr + VIRTIO_PCI_CONFIG + offset;
+       void __iomem *ioaddr = vp_dev->ioaddr + VIRTIO_PCI_CONFIG + offset;
        u8 *ptr = buf;
        int i;
 
@@ -125,7 +125,7 @@ static void vp_set(struct virtio_device *vdev, unsigned offset,
                   const void *buf, unsigned len)
 {
        struct virtio_pci_device *vp_dev = to_vp_device(vdev);
-       void *ioaddr = vp_dev->ioaddr + VIRTIO_PCI_CONFIG + offset;
+       void __iomem *ioaddr = vp_dev->ioaddr + VIRTIO_PCI_CONFIG + offset;
        const u8 *ptr = buf;
        int i;
 
index 1f5a4289b848e3bd0f4eb779a37b322e2a3a305f..1cb5b0a9f2aca95b8790a8b6be3fae90157f9e68 100644 (file)
@@ -261,7 +261,7 @@ static void mode_to_access_flags(umode_t mode, umode_t bits_to_use,
        return;
 }
 
-static __le16 fill_ace_for_sid(struct cifs_ace *pntace,
+static __u16 fill_ace_for_sid(struct cifs_ace *pntace,
                        const struct cifs_sid *psid, __u64 nmode, umode_t bits)
 {
        int i;
@@ -411,7 +411,7 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
 static int set_chmod_dacl(struct cifs_acl *pndacl, struct cifs_sid *pownersid,
                        struct cifs_sid *pgrpsid, __u64 nmode)
 {
-       __le16 size = 0;
+       u16 size = 0;
        struct cifs_acl *pnndacl;
 
        pnndacl = (struct cifs_acl *)((char *)pndacl + sizeof(struct cifs_acl));
index 9816293442ab33fa27601baf628ca2ad23ba2ddd..0e081d5f32e85f8993af7bf809acbacb9d4a82e5 100644 (file)
@@ -1620,14 +1620,14 @@ static int journal_init_journal_head_cache(void)
 {
        int retval;
 
-       J_ASSERT(journal_head_cache == 0);
+       J_ASSERT(journal_head_cache == NULL);
        journal_head_cache = kmem_cache_create("journal_head",
                                sizeof(struct journal_head),
                                0,              /* offset */
                                SLAB_TEMPORARY, /* flags */
                                NULL);          /* ctor */
        retval = 0;
-       if (journal_head_cache == 0) {
+       if (!journal_head_cache) {
                retval = -ENOMEM;
                printk(KERN_EMERG "JBD: no memory for journal_head cache\n");
        }
index ad2eacf570c6e5b0d0404978d49ad6eebed3fba1..d5f8eee7c88cfd0287a51cf934ad5270da5ce6c1 100644 (file)
@@ -173,13 +173,13 @@ int __init journal_init_revoke_caches(void)
                                           0,
                                           SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY,
                                           NULL);
-       if (revoke_record_cache == 0)
+       if (!revoke_record_cache)
                return -ENOMEM;
 
        revoke_table_cache = kmem_cache_create("revoke_table",
                                           sizeof(struct jbd_revoke_table_s),
                                           0, SLAB_TEMPORARY, NULL);
-       if (revoke_table_cache == 0) {
+       if (!revoke_table_cache) {
                kmem_cache_destroy(revoke_record_cache);
                revoke_record_cache = NULL;
                return -ENOMEM;
index 96ba846992e934f476511bbfd40152868f211d8b..954cff001df6d1a9bf51a964774bc3d3eef13b79 100644 (file)
@@ -219,7 +219,7 @@ static int jbd2_journal_start_thread(journal_t *journal)
        if (IS_ERR(t))
                return PTR_ERR(t);
 
-       wait_event(journal->j_wait_done_commit, journal->j_task != 0);
+       wait_event(journal->j_wait_done_commit, journal->j_task != NULL);
        return 0;
 }
 
@@ -231,7 +231,7 @@ static void journal_kill_thread(journal_t *journal)
        while (journal->j_task) {
                wake_up(&journal->j_wait_commit);
                spin_unlock(&journal->j_state_lock);
-               wait_event(journal->j_wait_done_commit, journal->j_task == 0);
+               wait_event(journal->j_wait_done_commit, journal->j_task == NULL);
                spin_lock(&journal->j_state_lock);
        }
        spin_unlock(&journal->j_state_lock);
@@ -1969,14 +1969,14 @@ static int journal_init_jbd2_journal_head_cache(void)
 {
        int retval;
 
-       J_ASSERT(jbd2_journal_head_cache == 0);
+       J_ASSERT(jbd2_journal_head_cache == NULL);
        jbd2_journal_head_cache = kmem_cache_create("jbd2_journal_head",
                                sizeof(struct journal_head),
                                0,              /* offset */
                                SLAB_TEMPORARY, /* flags */
                                NULL);          /* ctor */
        retval = 0;
-       if (jbd2_journal_head_cache == 0) {
+       if (!jbd2_journal_head_cache) {
                retval = -ENOMEM;
                printk(KERN_EMERG "JBD: no memory for journal_head cache\n");
        }
@@ -2002,14 +2002,14 @@ static struct journal_head *journal_alloc_journal_head(void)
        atomic_inc(&nr_journal_heads);
 #endif
        ret = kmem_cache_alloc(jbd2_journal_head_cache, GFP_NOFS);
-       if (ret == 0) {
+       if (!ret) {
                jbd_debug(1, "out of memory for journal_head\n");
                if (time_after(jiffies, last_warning + 5*HZ)) {
                        printk(KERN_NOTICE "ENOMEM in %s, retrying.\n",
                               __FUNCTION__);
                        last_warning = jiffies;
                }
-               while (ret == 0) {
+               while (!ret) {
                        yield();
                        ret = kmem_cache_alloc(jbd2_journal_head_cache, GFP_NOFS);
                }
index df36f42e19e11687b32bd08741c5969db325e116..2e1453a5e998d6a8dc606015a0b2ee953d365386 100644 (file)
@@ -174,13 +174,13 @@ int __init jbd2_journal_init_revoke_caches(void)
                                           0,
                                           SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY,
                                           NULL);
-       if (jbd2_revoke_record_cache == 0)
+       if (!jbd2_revoke_record_cache)
                return -ENOMEM;
 
        jbd2_revoke_table_cache = kmem_cache_create("jbd2_revoke_table",
                                           sizeof(struct jbd2_revoke_table_s),
                                           0, SLAB_TEMPORARY, NULL);
-       if (jbd2_revoke_table_cache == 0) {
+       if (!jbd2_revoke_table_cache) {
                kmem_cache_destroy(jbd2_revoke_record_cache);
                jbd2_revoke_record_cache = NULL;
                return -ENOMEM;
index f85c5cf4934ce3a3869e15c8f5cb9d432a05461c..7ee4208793b6370321de3068b0f0c848549e8038 100644 (file)
@@ -283,7 +283,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih,      /* item h
                return balance_leaf_when_delete(tb, flag);
 
        zeros_num = 0;
-       if (flag == M_INSERT && body == 0)
+       if (flag == M_INSERT && !body)
                zeros_num = ih_item_len(ih);
 
        pos_in_item = tb->tb_path->pos_in_item;
@@ -1728,7 +1728,7 @@ struct buffer_head *get_FEB(struct tree_balance *tb)
        struct buffer_info bi;
 
        for (i = 0; i < MAX_FEB_SIZE; i++)
-               if (tb->FEB[i] != 0)
+               if (tb->FEB[i] != NULL)
                        break;
 
        if (i == MAX_FEB_SIZE)
@@ -1827,7 +1827,7 @@ int get_left_neighbor_position(struct tree_balance *tb, int h)
 {
        int Sh_position = PATH_H_POSITION(tb->tb_path, h + 1);
 
-       RFALSE(PATH_H_PPARENT(tb->tb_path, h) == 0 || tb->FL[h] == 0,
+       RFALSE(PATH_H_PPARENT(tb->tb_path, h) == NULL || tb->FL[h] == NULL,
               "vs-12325: FL[%d](%p) or F[%d](%p) does not exist",
               h, tb->FL[h], h, PATH_H_PPARENT(tb->tb_path, h));
 
@@ -1841,7 +1841,7 @@ int get_right_neighbor_position(struct tree_balance *tb, int h)
 {
        int Sh_position = PATH_H_POSITION(tb->tb_path, h + 1);
 
-       RFALSE(PATH_H_PPARENT(tb->tb_path, h) == 0 || tb->FR[h] == 0,
+       RFALSE(PATH_H_PPARENT(tb->tb_path, h) == NULL || tb->FR[h] == NULL,
               "vs-12330: F[%d](%p) or FR[%d](%p) does not exist",
               h, PATH_H_PPARENT(tb->tb_path, h), h, tb->FR[h]);
 
index 0ee35c6c9b722ef225e666f63713e4d92cf29be6..07d05e0842b72525b32eabac59dda28e7e3cc26a 100644 (file)
@@ -153,7 +153,7 @@ static void create_virtual_node(struct tree_balance *tb, int h)
        if (vn->vn_mode == M_INSERT) {
                struct virtual_item *vi = vn->vn_vi + vn->vn_affected_item_num;
 
-               RFALSE(vn->vn_ins_ih == 0,
+               RFALSE(vn->vn_ins_ih == NULL,
                       "vs-8040: item header of inserted item is not specified");
                vi->vi_item_len = tb->insert_size[0];
                vi->vi_ih = vn->vn_ins_ih;
@@ -857,7 +857,8 @@ static int get_lfree(struct tree_balance *tb, int h)
        struct buffer_head *l, *f;
        int order;
 
-       if ((f = PATH_H_PPARENT(tb->tb_path, h)) == 0 || (l = tb->FL[h]) == 0)
+       if ((f = PATH_H_PPARENT(tb->tb_path, h)) == NULL ||
+           (l = tb->FL[h]) == NULL)
                return 0;
 
        if (f == l)
@@ -878,7 +879,8 @@ static int get_rfree(struct tree_balance *tb, int h)
        struct buffer_head *r, *f;
        int order;
 
-       if ((f = PATH_H_PPARENT(tb->tb_path, h)) == 0 || (r = tb->FR[h]) == 0)
+       if ((f = PATH_H_PPARENT(tb->tb_path, h)) == NULL ||
+           (r = tb->FR[h]) == NULL)
                return 0;
 
        if (f == r)
index 281f8061ac58112579d82c5a2078327aff576d59..6de060a6aa7fc79c04a6f1d3d3a6b70648bd2af6 100644 (file)
@@ -626,7 +626,7 @@ static void leaf_define_dest_src_infos(int shift_mode, struct tree_balance *tb,
                               "vs-10250: leaf_define_dest_src_infos: shift type is unknown (%d)",
                               shift_mode);
        }
-       RFALSE(src_bi->bi_bh == 0 || dest_bi->bi_bh == 0,
+       RFALSE(!src_bi->bi_bh || !dest_bi->bi_bh,
               "vs-10260: mode==%d, source (%p) or dest (%p) buffer is initialized incorrectly",
               shift_mode, src_bi->bi_bh, dest_bi->bi_bh);
 }
index b378eea332caefaaf069e91f75db339cc6c9b3b2..8867533cb727bcad8048f8dee072aa2137e8c567 100644 (file)
@@ -452,7 +452,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
        buflen = DEH_SIZE + ROUND_UP(namelen);
        if (buflen > sizeof(small_buf)) {
                buffer = kmalloc(buflen, GFP_NOFS);
-               if (buffer == 0)
+               if (!buffer)
                        return -ENOMEM;
        } else
                buffer = small_buf;
index fae8e85af0ed59ae850ca66f250d3a71c36c1ff8..6bd9b691a463f783058b03a84d6de28b49813ee7 100644 (file)
@@ -206,7 +206,7 @@ int smbiod_retry(struct smb_sb_info *server)
 
        smb_close_socket(server);
 
-       if (pid == 0) {
+       if (!pid) {
                /* FIXME: this is fatal, umount? */
                printk(KERN_ERR "smb_retry: no connection process\n");
                server->state = CONN_RETRIED;
index b400cea81487e8e84041fc89bd9a34b9978233b1..2c57f473474641d50942f615344c3daf5debea97 100644 (file)
@@ -234,7 +234,7 @@ extern void free_initmem(void);
                break;                                                          \
                                                                                \
        default:                                                                \
-               __xg_orig = 0;                                                  \
+               __xg_orig = (__typeof__(__xg_orig))0;                           \
                asm volatile("break");                                          \
                break;                                                          \
        }                                                                       \
@@ -259,7 +259,7 @@ extern uint32_t __cmpxchg_32(uint32_t *v, uint32_t test, uint32_t new);
                                         (__force uint32_t)__xg_test,           \
                                         (__force uint32_t)__xg_new); break;    \
        default:                                                                \
-               __xg_orig = 0;                                                  \
+               __xg_orig = (__typeof__(__xg_orig))0;                           \
                asm volatile("break");                                          \
                break;                                                          \
        }                                                                       \
index a671dbff7a1fa229ab45851286ade5eed9b8fef1..8fa7857e153bc7f7649ea25e088924fb0a6190f9 100644 (file)
@@ -192,8 +192,8 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
                struct compat_timeval __user *tvp);
 
 asmlinkage long compat_sys_wait4(compat_pid_t pid,
-                                compat_uint_t *stat_addr, int options,
-                                struct compat_rusage *ru);
+                                compat_uint_t __user *stat_addr, int options,
+                                struct compat_rusage __user *ru);
 
 #define BITS_PER_COMPAT_LONG    (8*sizeof(compat_long_t))
 
index 261e43a4c873042c687138db87e9e1a242e6ffd8..34d440698293e6ea20f8d3763e42b04126a7980d 100644 (file)
@@ -423,7 +423,7 @@ void dma_async_device_unregister(struct dma_device *device);
 /* --- Helper iov-locking functions --- */
 
 struct dma_page_list {
-       char *base_address;
+       char __user *base_address;
        int nr_pages;
        struct page **pages;
 };
index a3b69c10d667c98c5631308456673374491aaec5..bc26b2f273591cc83d7ec373ad9e9d22c633357c 100644 (file)
@@ -26,7 +26,7 @@
 #include <asm/semaphore.h>
 #include <asm/mutex.h>
 
-#if defined(CRIS) || defined(FRV)
+#if defined(CONFIG_CRIS) || defined(CONFIG_FRV)
 # define SUPPORT_VLB_SYNC 0
 #else
 # define SUPPORT_VLB_SYNC 1
index 269cdba095789b94993b2b23d74fa1495c019e96..b064bfeb69ee236a189aa1d1c81adad8df24fbf8 100644 (file)
@@ -295,6 +295,7 @@ enum {
        ATA_EH_SOFTRESET        = (1 << 1),
        ATA_EH_HARDRESET        = (1 << 2),
        ATA_EH_ENABLE_LINK      = (1 << 3),
+       ATA_EH_LPM              = (1 << 4),  /* link power management action */
 
        ATA_EH_RESET_MASK       = ATA_EH_SOFTRESET | ATA_EH_HARDRESET,
        ATA_EH_PERDEV_MASK      = ATA_EH_REVALIDATE,
@@ -304,7 +305,6 @@ enum {
        ATA_EHI_RESUME_LINK     = (1 << 1),  /* resume link (reset modifier) */
        ATA_EHI_NO_AUTOPSY      = (1 << 2),  /* no autopsy */
        ATA_EHI_QUIET           = (1 << 3),  /* be quiet */
-       ATA_EHI_LPM             = (1 << 4),  /* link power management action */
 
        ATA_EHI_DID_SOFTRESET   = (1 << 16), /* already soft-reset this port */
        ATA_EHI_DID_HARDRESET   = (1 << 17), /* already soft-reset this port */
index e9c2fb01e89bf9e0943c3e7a1230098af3df6243..53d86b4b0ce074470fdc27c5f00814c49aa4c8c1 100644 (file)
@@ -2082,7 +2082,7 @@ static int cgroup_tasks_open(struct inode *unused, struct file *file)
 
                kfree(pidarray);
        } else {
-               ctr->buf = 0;
+               ctr->buf = NULL;
                ctr->bufsz = 0;
        }
        file->private_data = ctr;
@@ -2614,7 +2614,7 @@ static int proc_cgroupstats_show(struct seq_file *m, void *v)
 
 static int cgroupstats_open(struct inode *inode, struct file *file)
 {
-       return single_open(file, proc_cgroupstats_show, 0);
+       return single_open(file, proc_cgroupstats_show, NULL);
 }
 
 static struct file_operations proc_cgroupstats_operations = {
index 87a6428cb5b67363a23252628c6a03d8b2a789c8..e43945e995f54040aecc49678922b9e18186db52 100644 (file)
@@ -281,7 +281,7 @@ static int get_futex_key(u32 __user *uaddr, struct rw_semaphore *fshared,
  */
 static void get_futex_key_refs(union futex_key *key)
 {
-       if (key->both.ptr == 0)
+       if (key->both.ptr == NULL)
                return;
        switch (key->both.offset & (FUT_OFF_INODE|FUT_OFF_MMSHARED)) {
                case FUT_OFF_INODE:
index ff90f049f8f6de9e5c6a01782bcb09f7df5c4bc8..04ac3a9e42cf58435dc3d3d689049e1bf1f91a8a 100644 (file)
@@ -30,7 +30,7 @@ fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **entry,
        return 0;
 }
 
-static void __user *futex_uaddr(struct robust_list *entry,
+static void __user *futex_uaddr(struct robust_list __user *entry,
                                compat_long_t futex_offset)
 {
        compat_uptr_t base = ptr_to_compat(entry);
index cd75b21dd4c312e1cf3dcf22a2801ad2f49c24c6..99c4f36eb8a33def3c713937cecb9cc51256359a 100644 (file)
@@ -76,7 +76,7 @@ pte_t * __meminit vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node)
                pte_t entry;
                void *p = vmemmap_alloc_block(PAGE_SIZE, node);
                if (!p)
-                       return 0;
+                       return NULL;
                entry = pfn_pte(__pa(p) >> PAGE_SHIFT, PAGE_KERNEL);
                set_pte_at(&init_mm, addr, pte, entry);
        }
@@ -89,7 +89,7 @@ pmd_t * __meminit vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node)
        if (pmd_none(*pmd)) {
                void *p = vmemmap_alloc_block(PAGE_SIZE, node);
                if (!p)
-                       return 0;
+                       return NULL;
                pmd_populate_kernel(&init_mm, pmd, p);
        }
        return pmd;
@@ -101,7 +101,7 @@ pud_t * __meminit vmemmap_pud_populate(pgd_t *pgd, unsigned long addr, int node)
        if (pud_none(*pud)) {
                void *p = vmemmap_alloc_block(PAGE_SIZE, node);
                if (!p)
-                       return 0;
+                       return NULL;
                pud_populate(&init_mm, pud, p);
        }
        return pud;
@@ -113,7 +113,7 @@ pgd_t * __meminit vmemmap_pgd_populate(unsigned long addr, int node)
        if (pgd_none(*pgd)) {
                void *p = vmemmap_alloc_block(PAGE_SIZE, node);
                if (!p)
-                       return 0;
+                       return NULL;
                pgd_populate(&init_mm, pgd, p);
        }
        return pgd;
index 1aaa2e804b0d118a78d6f94f4491b64a347f0bc5..126ca777b410abc3228eb465e1e33589ec113c04 100644 (file)
@@ -23,7 +23,7 @@
 struct rxrpc_crypt {
        union {
                u8      x[FCRYPT_BSIZE];
-               u32     n[2];
+               __be32  n[2];
        };
 } __attribute__((aligned(8)));
 
index f48434adb7c242a5cae2e6cdbd074a43951aac1d..d1c296f2d61719344e1c4cf92a34bf57e2aa9045 100644 (file)
@@ -261,6 +261,7 @@ static int rxkad_secure_packet(const struct rxrpc_call *call,
                __be32 x[2];
        } tmpbuf __attribute__((aligned(8))); /* must all be in same page */
        __be32 x;
+       u32 y;
        int ret;
 
        sp = rxrpc_skb(skb);
@@ -292,11 +293,11 @@ static int rxkad_secure_packet(const struct rxrpc_call *call,
        sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf));
        crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf));
 
-       x = ntohl(tmpbuf.x[1]);
-       x = (x >> 16) & 0xffff;
-       if (x == 0)
-               x = 1; /* zero checksums are not permitted */
-       sp->hdr.cksum = htons(x);
+       y = ntohl(tmpbuf.x[1]);
+       y = (y >> 16) & 0xffff;
+       if (y == 0)
+               y = 1; /* zero checksums are not permitted */
+       sp->hdr.cksum = htons(y);
 
        switch (call->conn->security_level) {
        case RXRPC_SECURITY_PLAIN:
@@ -314,7 +315,7 @@ static int rxkad_secure_packet(const struct rxrpc_call *call,
                break;
        }
 
-       _leave(" = %d [set %hx]", ret, x);
+       _leave(" = %d [set %hx]", ret, y);
        return ret;
 }
 
@@ -492,6 +493,7 @@ static int rxkad_verify_packet(const struct rxrpc_call *call,
                __be32 x[2];
        } tmpbuf __attribute__((aligned(8))); /* must all be in same page */
        __be32 x;
+       u16 y;
        __be16 cksum;
        int ret;
 
@@ -526,12 +528,12 @@ static int rxkad_verify_packet(const struct rxrpc_call *call,
        sg_init_one(&sg[1], &tmpbuf, sizeof(tmpbuf));
        crypto_blkcipher_encrypt_iv(&desc, &sg[0], &sg[1], sizeof(tmpbuf));
 
-       x = ntohl(tmpbuf.x[1]);
-       x = (x >> 16) & 0xffff;
-       if (x == 0)
-               x = 1; /* zero checksums are not permitted */
+       y = ntohl(tmpbuf.x[1]);
+       y = (y >> 16) & 0xffff;
+       if (y == 0)
+               y = 1; /* zero checksums are not permitted */
 
-       cksum = htons(x);
+       cksum = htons(y);
        if (sp->hdr.cksum != cksum) {
                *_abort_code = RXKADSEALEDINCON;
                _leave(" = -EPROTO [csum failed]");
@@ -1001,7 +1003,8 @@ static int rxkad_verify_response(struct rxrpc_connection *conn,
        struct rxrpc_crypt session_key;
        time_t expiry;
        void *ticket;
-       u32 abort_code, version, kvno, ticket_len, csum, level;
+       u32 abort_code, version, kvno, ticket_len, level;
+       __be32 csum;
        int ret;
 
        _enter("{%d,%x}", conn->debug_id, key_serial(conn->server_key));