Merge branch 'warnings-upstream' of master.kernel.org:/pub/scm/linux/kernel/git/jgarz...
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 29 Oct 2007 19:10:49 +0000 (12:10 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 29 Oct 2007 19:10:49 +0000 (12:10 -0700)
* 'warnings-upstream' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6:
  [ISDN] capidrv: address two longstanding warnings

48 files changed:
arch/um/Kconfig.i386
arch/um/Makefile-i386
arch/um/Makefile-x86_64
arch/um/kernel/mem.c
arch/um/sys-i386/ptrace.c
arch/um/sys-x86_64/ptrace.c
arch/x86/kernel/pci-gart_64.c
block/cfq-iosched.c
block/compat_ioctl.c
block/ll_rw_blk.c
drivers/ata/libata-core.c
drivers/block/cciss.c
drivers/block/cciss_scsi.c
drivers/block/cciss_scsi.h
drivers/char/mem.c
drivers/md/raid6algos.c
drivers/md/raid6mmx.c
drivers/md/raid6sse1.c
drivers/md/raid6sse2.c
drivers/md/raid6x86.h
drivers/mmc/host/imxmmc.c
drivers/pci/intel-iommu.c
drivers/pci/intel-iommu.h
drivers/s390/scsi/zfcp_def.h
drivers/scsi/aacraid/commctrl.c
drivers/scsi/aacraid/comminit.c
drivers/scsi/aacraid/dpcsup.c
drivers/scsi/arcmsr/arcmsr.h
drivers/scsi/arcmsr/arcmsr_attr.c
drivers/scsi/arcmsr/arcmsr_hba.c
drivers/scsi/sg.c
drivers/spi/spidev.c
include/asm-um/unistd.h
include/linux/blkdev.h
include/linux/eventpoll.h
include/linux/scatterlist.h
include/linux/sunrpc/rpc_rdma.h
include/linux/types.h
include/net/sctp/auth.h
kernel/hrtimer.c
kernel/signal.c
kernel/time/tick-sched.c
kernel/time/timer_list.c
mm/filemap.c
mm/nommu.c
mm/slub.c
net/sctp/auth.c
net/sunrpc/xprtrdma/rpc_rdma.c

index 9876d80d85ddccdba00e5e89cd1e54db6ab8612b..e0ac74e5d4c4d7c754d37bfafd44be0788e9c3dc 100644 (file)
@@ -1,6 +1,6 @@
 menu "Host processor type and features"
 
-source "arch/i386/Kconfig.cpu"
+source "arch/x86/Kconfig.cpu"
 
 endmenu
 
index 0178df306939b856aef436456e7ffe194ed3b5a5..b01dfb00e5f8a8e16e254661e9ddf91279b429ad 100644 (file)
@@ -9,6 +9,7 @@ ELF_ARCH                := $(SUBARCH)
 ELF_FORMAT             := elf32-$(SUBARCH)
 OBJCOPYFLAGS           := -O binary -R .note -R .comment -S
 HEADER_ARCH            := x86
+CHECKFLAGS     += -D__i386__
 
 ifeq ("$(origin SUBARCH)", "command line")
 ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)")
@@ -26,10 +27,8 @@ AFLAGS                       += -DCONFIG_X86_32
 CONFIG_X86_32          := y
 export CONFIG_X86_32
 
-ARCH_KERNEL_DEFINES += -U__$(SUBARCH)__ -U$(SUBARCH)
-
 # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y.
-include $(srctree)/arch/i386/Makefile.cpu
+include $(srctree)/arch/x86/Makefile_32.cpu
 
 # prevent gcc from keeping the stack 16 byte aligned. Taken from i386.
 cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
index fe5316f0c6a55778fbda6bf7fb679c2f9a75a493..8ed362f93582e9723aaacde7325553f9de435383 100644 (file)
@@ -6,12 +6,9 @@ START := 0x60000000
 
 _extra_flags_ = -fno-builtin -m64
 
-#We #undef __x86_64__ for kernelspace, not for userspace where
-#it's needed for headers to work!
-ARCH_KERNEL_DEFINES = -U__$(SUBARCH)__
 KBUILD_CFLAGS += $(_extra_flags_)
 
-CHECKFLAGS  += -m64
+CHECKFLAGS  += -m64 -D__x86_64__
 KBUILD_AFLAGS += -m64
 LDFLAGS += -m elf_x86_64
 KBUILD_CPPFLAGS += -m64
index 8456397f5f4d614e3df04dc728c2ae79f08f6675..59822dee438adfe53f373569f9b74d675726b56d 100644 (file)
@@ -165,7 +165,7 @@ static void __init kmap_init(void)
        kmap_prot = PAGE_KERNEL;
 }
 
-static void init_highmem(void)
+static void __init init_highmem(void)
 {
        pgd_t *pgd;
        pud_t *pud;
index 9657c89fdf31cd5d9024b8786053def3814315ce..bd3da8a61f645810bc7af9ec42a6db240379b778 100644 (file)
@@ -155,7 +155,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
        if (err)
                return err;
 
-       n = copy_to_user((void *) buf, fpregs, sizeof(fpregs));
+       n = copy_to_user(buf, fpregs, sizeof(fpregs));
        if(n > 0)
                return -EFAULT;
 
@@ -168,7 +168,7 @@ int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
        long fpregs[HOST_FP_SIZE];
 
        BUG_ON(sizeof(*buf) != sizeof(fpregs));
-       n = copy_from_user(fpregs, (void *) buf, sizeof(fpregs));
+       n = copy_from_user(fpregs, buf, sizeof(fpregs));
        if (n > 0)
                return -EFAULT;
 
@@ -185,7 +185,7 @@ int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
        if (err)
                return err;
 
-       n = copy_to_user((void *) buf, fpregs, sizeof(fpregs));
+       n = copy_to_user(buf, fpregs, sizeof(fpregs));
        if(n > 0)
                return -EFAULT;
 
@@ -198,7 +198,7 @@ int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
        long fpregs[HOST_XFP_SIZE];
 
        BUG_ON(sizeof(*buf) != sizeof(fpregs));
-       n = copy_from_user(fpregs, (void *) buf, sizeof(fpregs));
+       n = copy_from_user(fpregs, buf, sizeof(fpregs));
        if (n > 0)
                return -EFAULT;
 
index a3cfeed17af42138e475b112208e72a462be9c98..b7631b0e9ddc212a12966652925646e996768188 100644 (file)
@@ -154,7 +154,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
        if (err)
                return err;
 
-       n = copy_to_user((void *) buf, fpregs, sizeof(fpregs));
+       n = copy_to_user(buf, fpregs, sizeof(fpregs));
        if(n > 0)
                return -EFAULT;
 
@@ -167,7 +167,7 @@ int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
        long fpregs[HOST_FP_SIZE];
 
        BUG_ON(sizeof(*buf) != sizeof(fpregs));
-       n = copy_from_user(fpregs, (void *) buf, sizeof(fpregs));
+       n = copy_from_user(fpregs, buf, sizeof(fpregs));
        if (n > 0)
                return -EFAULT;
 
index ae7e0161ce46e9e1eacbca8c2cb24a5a599456b9..79b514b381b1476acd8559f18e6c0019b0c19910 100644 (file)
@@ -435,7 +435,7 @@ static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents,
 
 error:
        flush_gart();
-       gart_unmap_sg(dev, sg, nents, dir);
+       gart_unmap_sg(dev, sg, out, dir);
        /* When it was forced or merged try again in a dumb way */
        if (force_iommu || iommu_merge) {
                out = dma_map_sg_nonforce(dev, sg, nents, dir);
index 54dc05439009d09968572e6f12ce30d0fef151e8..e47a9309eb485058b72d4649f631cf0029ee3dcb 100644 (file)
@@ -1443,8 +1443,11 @@ cfq_get_queue(struct cfq_data *cfqd, int is_sync, struct task_struct *tsk,
                cfqq = *async_cfqq;
        }
 
-       if (!cfqq)
+       if (!cfqq) {
                cfqq = cfq_find_alloc_queue(cfqd, is_sync, tsk, gfp_mask);
+               if (!cfqq)
+                       return NULL;
+       }
 
        /*
         * pin the queue now that it's allocated, scheduler exit will prune it
@@ -2053,7 +2056,7 @@ static void cfq_shutdown_timer_wq(struct cfq_data *cfqd)
 {
        del_timer_sync(&cfqd->idle_slice_timer);
        del_timer_sync(&cfqd->idle_class_timer);
-       blk_sync_queue(cfqd->queue);
+       kblockd_flush_work(&cfqd->unplug_work);
 }
 
 static void cfq_put_async_queues(struct cfq_data *cfqd)
index f84093b97f704f3d7720708b6ca035741ca6a67f..cae0a852619e372a7a2e87b53b7f818a402f8d86 100644 (file)
@@ -581,7 +581,7 @@ static int compat_blkdev_driver_ioctl(struct inode *inode, struct file *file,
 {
        int ret;
 
-       switch (arg) {
+       switch (cmd) {
        case HDIO_GET_UNMASKINTR:
        case HDIO_GET_MULTCOUNT:
        case HDIO_GET_KEEPSETTINGS:
index b01dee3ae7f36c1d29014bc91fee09466ed7b922..56f2646612e604c2599b3ba8589f99adbf752fcb 100644 (file)
@@ -39,7 +39,7 @@
 
 static void blk_unplug_work(struct work_struct *work);
 static void blk_unplug_timeout(unsigned long data);
-static void drive_stat_acct(struct request *rq, int nr_sectors, int new_io);
+static void drive_stat_acct(struct request *rq, int new_io);
 static void init_request_from_bio(struct request *req, struct bio *bio);
 static int __make_request(struct request_queue *q, struct bio *bio);
 static struct io_context *current_io_context(gfp_t gfp_flags, int node);
@@ -791,7 +791,6 @@ static int __blk_free_tags(struct blk_queue_tag *bqt)
        retval = atomic_dec_and_test(&bqt->refcnt);
        if (retval) {
                BUG_ON(bqt->busy);
-               BUG_ON(!list_empty(&bqt->busy_list));
 
                kfree(bqt->tag_index);
                bqt->tag_index = NULL;
@@ -903,7 +902,6 @@ static struct blk_queue_tag *__blk_queue_init_tags(struct request_queue *q,
        if (init_tag_map(q, tags, depth))
                goto fail;
 
-       INIT_LIST_HEAD(&tags->busy_list);
        tags->busy = 0;
        atomic_set(&tags->refcnt, 1);
        return tags;
@@ -954,6 +952,7 @@ int blk_queue_init_tags(struct request_queue *q, int depth,
         */
        q->queue_tags = tags;
        q->queue_flags |= (1 << QUEUE_FLAG_QUEUED);
+       INIT_LIST_HEAD(&q->tag_busy_list);
        return 0;
 fail:
        kfree(tags);
@@ -1057,18 +1056,16 @@ void blk_queue_end_tag(struct request_queue *q, struct request *rq)
 
        bqt->tag_index[tag] = NULL;
 
-       /*
-        * We use test_and_clear_bit's memory ordering properties here.
-        * The tag_map bit acts as a lock for tag_index[bit], so we need
-        * a barrer before clearing the bit (precisely: release semantics).
-        * Could use clear_bit_unlock when it is merged.
-        */
-       if (unlikely(!test_and_clear_bit(tag, bqt->tag_map))) {
+       if (unlikely(!test_bit(tag, bqt->tag_map))) {
                printk(KERN_ERR "%s: attempt to clear non-busy tag (%d)\n",
                       __FUNCTION__, tag);
                return;
        }
-
+       /*
+        * The tag_map bit acts as a lock for tag_index[bit], so we need
+        * unlock memory barrier semantics.
+        */
+       clear_bit_unlock(tag, bqt->tag_map);
        bqt->busy--;
 }
 
@@ -1114,17 +1111,17 @@ int blk_queue_start_tag(struct request_queue *q, struct request *rq)
                if (tag >= bqt->max_depth)
                        return 1;
 
-       } while (test_and_set_bit(tag, bqt->tag_map));
+       } while (test_and_set_bit_lock(tag, bqt->tag_map));
        /*
-        * We rely on test_and_set_bit providing lock memory ordering semantics
-        * (could use test_and_set_bit_lock when it is merged).
+        * We need lock ordering semantics given by test_and_set_bit_lock.
+        * See blk_queue_end_tag for details.
         */
 
        rq->cmd_flags |= REQ_QUEUED;
        rq->tag = tag;
        bqt->tag_index[tag] = rq;
        blkdev_dequeue_request(rq);
-       list_add(&rq->queuelist, &bqt->busy_list);
+       list_add(&rq->queuelist, &q->tag_busy_list);
        bqt->busy++;
        return 0;
 }
@@ -1145,11 +1142,10 @@ EXPORT_SYMBOL(blk_queue_start_tag);
  **/
 void blk_queue_invalidate_tags(struct request_queue *q)
 {
-       struct blk_queue_tag *bqt = q->queue_tags;
        struct list_head *tmp, *n;
        struct request *rq;
 
-       list_for_each_safe(tmp, n, &bqt->busy_list) {
+       list_for_each_safe(tmp, n, &q->tag_busy_list) {
                rq = list_entry_rq(tmp);
 
                if (rq->tag == -1) {
@@ -1738,6 +1734,7 @@ EXPORT_SYMBOL(blk_stop_queue);
 void blk_sync_queue(struct request_queue *q)
 {
        del_timer_sync(&q->unplug_timer);
+       kblockd_flush_work(&q->unplug_work);
 }
 EXPORT_SYMBOL(blk_sync_queue);
 
@@ -2341,7 +2338,7 @@ void blk_insert_request(struct request_queue *q, struct request *rq,
        if (blk_rq_tagged(rq))
                blk_queue_end_tag(q, rq);
 
-       drive_stat_acct(rq, rq->nr_sectors, 1);
+       drive_stat_acct(rq, 1);
        __elv_add_request(q, rq, where, 0);
        blk_start_queueing(q);
        spin_unlock_irqrestore(q->queue_lock, flags);
@@ -2736,7 +2733,7 @@ int blkdev_issue_flush(struct block_device *bdev, sector_t *error_sector)
 
 EXPORT_SYMBOL(blkdev_issue_flush);
 
-static void drive_stat_acct(struct request *rq, int nr_sectors, int new_io)
+static void drive_stat_acct(struct request *rq, int new_io)
 {
        int rw = rq_data_dir(rq);
 
@@ -2758,7 +2755,7 @@ static void drive_stat_acct(struct request *rq, int nr_sectors, int new_io)
  */
 static inline void add_request(struct request_queue * q, struct request * req)
 {
-       drive_stat_acct(req, req->nr_sectors, 1);
+       drive_stat_acct(req, 1);
 
        /*
         * elevator indicated where it wants this request to be
@@ -3015,7 +3012,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
                        req->biotail = bio;
                        req->nr_sectors = req->hard_nr_sectors += nr_sectors;
                        req->ioprio = ioprio_best(req->ioprio, prio);
-                       drive_stat_acct(req, nr_sectors, 0);
+                       drive_stat_acct(req, 0);
                        if (!attempt_back_merge(q, req))
                                elv_merged_request(q, req, el_ret);
                        goto out;
@@ -3042,7 +3039,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
                        req->sector = req->hard_sector = bio->bi_sector;
                        req->nr_sectors = req->hard_nr_sectors += nr_sectors;
                        req->ioprio = ioprio_best(req->ioprio, prio);
-                       drive_stat_acct(req, nr_sectors, 0);
+                       drive_stat_acct(req, 0);
                        if (!attempt_front_merge(q, req))
                                elv_merged_request(q, req, el_ret);
                        goto out;
index 081e3dfb64d485e9382d253add9ae07a03f4651e..7ef515b3382d5f662ff0267d48852622a1e48a08 100644 (file)
@@ -4689,6 +4689,7 @@ static int ata_sg_setup(struct ata_queued_cmd *qc)
                 * data in this function or read data in ata_sg_clean.
                 */
                offset = lsg->offset + lsg->length - qc->pad_len;
+               sg_init_table(psg, 1);
                sg_set_page(psg, nth_page(sg_page(lsg), offset >> PAGE_SHIFT),
                                qc->pad_len, offset_in_page(offset));
 
index 5a6fe17fc6382bec43217bb11ce8a316f20e804a..7d704968765f308ac87726e310c64242e96db8fc 100644 (file)
@@ -1,20 +1,20 @@
 /*
- *    Disk Array driver for HP SA 5xxx and 6xxx Controllers
- *    Copyright 2000, 2006 Hewlett-Packard Development Company, L.P.
+ *    Disk Array driver for HP Smart Array controllers.
+ *    (C) Copyright 2000, 2007 Hewlett-Packard Development Company, L.P.
  *
  *    This program is free software; you can redistribute it and/or modify
  *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 2 of the License, or
- *    (at your option) any later version.
+ *    the Free Software Foundation; version 2 of the License.
  *
  *    This program is distributed in the hope that it will be useful,
  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- *    NON INFRINGEMENT.  See the GNU General Public License for more details.
+ *    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *    General Public License for more details.
  *
  *    You should have received a copy of the GNU General Public License
  *    along with this program; if not, write to the Free Software
- *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ *    02111-1307, USA.
  *
  *    Questions/Comments/Bugfixes to iss_storagedev@hp.com
  *
index 4aca7ddfdddf9c242730d9cb625eb7b23486f4c3..63ee6c076cb3ec61771c05b2743998a9a4da1b49 100644 (file)
@@ -1,20 +1,20 @@
 /*
- *    Disk Array driver for Compaq SA53xx Controllers, SCSI Tape module
- *    Copyright 2001 Compaq Computer Corporation
+ *    Disk Array driver for HP Smart Array controllers, SCSI Tape module.
+ *    (C) Copyright 2001, 2007 Hewlett-Packard Development Company, L.P.
  *
  *    This program is free software; you can redistribute it and/or modify
  *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 2 of the License, or
- *    (at your option) any later version.
+ *    the Free Software Foundation; version 2 of the License.
  *
  *    This program is distributed in the hope that it will be useful,
  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- *    NON INFRINGEMENT.  See the GNU General Public License for more details.
+ *    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *    General Public License for more details.
  *
  *    You should have received a copy of the GNU General Public License
  *    along with this program; if not, write to the Free Software
- *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *    Foundation, Inc., 59 Temple Place, Suite 300, Boston, MA
+ *    02111-1307, USA.
  *
  *    Questions/Comments/Bugfixes to iss_storagedev@hp.com
  *    
index 5e7e06c07d6c8cfcbcc022072e2d3110b50b66a9..d9c2c586502fbc224d19bc3f4ddc2b075f7e9e02 100644 (file)
@@ -1,20 +1,20 @@
 /*
- *    Disk Array driver for Compaq SA53xx Controllers, SCSI Tape module
- *    Copyright 2001 Compaq Computer Corporation
+ *    Disk Array driver for HP Smart Array controllers, SCSI Tape module.
+ *    (C) Copyright 2001, 2007 Hewlett-Packard Development Company, L.P.
  *
  *    This program is free software; you can redistribute it and/or modify
  *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation; either version 2 of the License, or
- *    (at your option) any later version.
+ *    the Free Software Foundation; version 2 of the License.
  *
  *    This program is distributed in the hope that it will be useful,
  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- *    NON INFRINGEMENT.  See the GNU General Public License for more details.
+ *    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *    General Public License for more details.
  *
  *    You should have received a copy of the GNU General Public License
  *    along with this program; if not, write to the Free Software
- *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *    Foundation, Inc., 59 Temple Place, Suite 300, Boston, MA
+ *    02111-1307, USA.
  *
  *    Questions/Comments/Bugfixes to iss_storagedev@hp.com
  *
index 0e937f64a789f8cafe985236e1164f632de1589a..20070b7c573d0087416213cec1fd16bf6ba825d7 100644 (file)
@@ -41,7 +41,7 @@
  */
 static inline int uncached_access(struct file *file, unsigned long addr)
 {
-#if defined(__i386__)
+#if defined(__i386__) && !defined(__arch_um__)
        /*
         * On the PPro and successors, the MTRRs are used to set
         * memory types for physical addresses outside main memory,
@@ -57,7 +57,7 @@ static inline int uncached_access(struct file *file, unsigned long addr)
                  test_bit(X86_FEATURE_CYRIX_ARR, boot_cpu_data.x86_capability) ||
                  test_bit(X86_FEATURE_CENTAUR_MCR, boot_cpu_data.x86_capability) )
          && addr >= __pa(high_memory);
-#elif defined(__x86_64__)
+#elif defined(__x86_64__) && !defined(__arch_um__)
        /* 
         * This is broken because it can generate memory type aliases,
         * which can cause cache corruptions
index 926576156578b399ecd82e914c38bab94ae9bdd3..77a6e4bf503d2257ed754ea6072f84263f2654a8 100644 (file)
@@ -52,7 +52,7 @@ const struct raid6_calls * const raid6_algos[] = {
        &raid6_intx16,
        &raid6_intx32,
 #endif
-#if defined(__i386__)
+#if defined(__i386__) && !defined(__arch_um__)
        &raid6_mmxx1,
        &raid6_mmxx2,
        &raid6_sse1x1,
@@ -60,7 +60,7 @@ const struct raid6_calls * const raid6_algos[] = {
        &raid6_sse2x1,
        &raid6_sse2x2,
 #endif
-#if defined(__x86_64__)
+#if defined(__x86_64__) && !defined(__arch_um__)
        &raid6_sse2x1,
        &raid6_sse2x2,
        &raid6_sse2x4,
index 6181a5a3365a198d3aad83b52f6c7e09a4d5aad3..d4e4a1bd70ad2f0841a8dd4036a167dfd1e9a3c0 100644 (file)
@@ -16,7 +16,7 @@
  * MMX implementation of RAID-6 syndrome functions
  */
 
-#if defined(__i386__)
+#if defined(__i386__) && !defined(__arch_um__)
 
 #include "raid6.h"
 #include "raid6x86.h"
index f0a1ba8f40ba90c6b59fdc69073c4bb997b425b4..0666237276ff37283e06aacc8980340eada56840 100644 (file)
@@ -21,7 +21,7 @@
  * worthwhile as a separate implementation.
  */
 
-#if defined(__i386__)
+#if defined(__i386__) && !defined(__arch_um__)
 
 #include "raid6.h"
 #include "raid6x86.h"
index 0f019762a7c3cba42cba1ea68a99459465f17223..b034ad8680397e0ab62eff5d55ddf6f5820979eb 100644 (file)
@@ -17,7 +17,7 @@
  *
  */
 
-#if defined(__i386__) || defined(__x86_64__)
+#if (defined(__i386__) || defined(__x86_64__)) && !defined(__arch_um__)
 
 #include "raid6.h"
 #include "raid6x86.h"
@@ -161,7 +161,7 @@ const struct raid6_calls raid6_sse2x2 = {
 
 #endif
 
-#ifdef __x86_64__
+#if defined(__x86_64__) && !defined(__arch_um__)
 
 /*
  * Unrolled-by-4 SSE2 implementation
index 9111950414ff2d71c003591f2ad4c3503303de5c..99fea7a70ca70ace27cca159e039b0ab318368ae 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef LINUX_RAID_RAID6X86_H
 #define LINUX_RAID_RAID6X86_H
 
-#if defined(__i386__) || defined(__x86_64__)
+#if (defined(__i386__) || defined(__x86_64__)) && !defined(__arch_um__)
 
 #ifdef __KERNEL__ /* Real code */
 
index fc72e1fadb6adf291356e796d16cc3e036d764c5..f2070a19cfa77fe25ff57aad4d60d54a90864a27 100644 (file)
@@ -262,7 +262,7 @@ static void imxmci_setup_data(struct imxmci_host *host, struct mmc_data *data)
                }
 
                /* Convert back to virtual address */
-               host->data_ptr = (u16*)sg_virt(sg);
+               host->data_ptr = (u16*)sg_virt(data->sg);
                host->data_cnt = 0;
 
                clear_bit(IMXMCI_PEND_DMA_DATA_b, &host->pending_events);
index 0c4ab3b07274c466b157b9dd37b38e6e4ed8c0cd..9b35259eecfaed4dd2b00fa1f37cd0d4615b0175 100644 (file)
@@ -745,7 +745,7 @@ static char *fault_reason_strings[] =
        "non-zero reserved fields in PTE",
        "Unknown"
 };
-#define MAX_FAULT_REASON_IDX   ARRAY_SIZE(fault_reason_strings)
+#define MAX_FAULT_REASON_IDX   ARRAY_SIZE(fault_reason_strings) - 1
 
 char *dmar_get_fault_reason(u8 fault_reason)
 {
@@ -995,7 +995,6 @@ static struct intel_iommu *alloc_iommu(struct dmar_drhd_unit *drhd)
        return iommu;
 error_unmap:
        iounmap(iommu->reg);
-       iommu->reg = 0;
 error:
        kfree(iommu);
        return NULL;
@@ -1808,7 +1807,7 @@ get_valid_domain_for_dev(struct pci_dev *pdev)
        if (!domain) {
                printk(KERN_ERR
                        "Allocating domain for %s failed", pci_name(pdev));
-               return 0;
+               return NULL;
        }
 
        /* make sure context mapping is ok */
@@ -1818,7 +1817,7 @@ get_valid_domain_for_dev(struct pci_dev *pdev)
                        printk(KERN_ERR
                                "Domain context map for %s failed",
                                pci_name(pdev));
-                       return 0;
+                       return NULL;
                }
        }
 
index ee88dd2400cb83ad13eb2ba44beea4e22704281d..459ad1f9dc549f5d84635c93429a1dafdd44a978 100644 (file)
@@ -58,7 +58,7 @@
                hi = readl(dmar + reg + 4); \
                (((u64) hi) << 32) + lo; })
 */
-static inline u64 dmar_readq(void *addr)
+static inline u64 dmar_readq(void __iomem *addr)
 {
        u32 lo, hi;
        lo = readl(addr);
index 0754542978b68b91f92b1dcbd91ad7a8cac9e4f6..e268f79bdbd232de9f81edb5b8d6e291998051d2 100644 (file)
@@ -70,11 +70,12 @@ zfcp_sg_to_address(struct scatterlist *list)
  * zfcp_address_to_sg - set up struct scatterlist from kernel address
  * @address: kernel address
  * @list: struct scatterlist
+ * @size: buffer size
  */
 static inline void
-zfcp_address_to_sg(void *address, struct scatterlist *list)
+zfcp_address_to_sg(void *address, struct scatterlist *list, unsigned int size)
 {
-       sg_set_buf(list, address, 0);
+       sg_set_buf(list, address, size);
 }
 
 #define REQUEST_LIST_SIZE 128
index 72b0393b459675a0fbb9cc6c4ba0e1df07104183..1e6d7a9c75bfa28e2f62a5d45d4accd53f572925 100644 (file)
@@ -391,7 +391,7 @@ static int close_getadapter_fib(struct aac_dev * dev, void __user *arg)
                /*
                 *      Extract the fibctx from the input parameters
                 */
-               if (fibctx->unique == (u32)(ptrdiff_t)arg) /* We found a winner */
+               if (fibctx->unique == (u32)(uintptr_t)arg) /* We found a winner */
                        break;
                entry = entry->next;
                fibctx = NULL;
@@ -590,7 +590,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
                                }
                                addr = (u64)upsg->sg[i].addr[0];
                                addr += ((u64)upsg->sg[i].addr[1]) << 32;
-                               sg_user[i] = (void __user *)(ptrdiff_t)addr;
+                               sg_user[i] = (void __user *)(uintptr_t)addr;
                                sg_list[i] = p; // save so we can clean up later
                                sg_indx = i;
 
@@ -633,7 +633,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
                                        rcode = -ENOMEM;
                                        goto cleanup;
                                }
-                               sg_user[i] = (void __user *)(ptrdiff_t)usg->sg[i].addr;
+                               sg_user[i] = (void __user *)(uintptr_t)usg->sg[i].addr;
                                sg_list[i] = p; // save so we can clean up later
                                sg_indx = i;
 
@@ -664,7 +664,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
                if (actual_fibsize64 == fibsize) {
                        struct user_sgmap64* usg = (struct user_sgmap64 *)upsg;
                        for (i = 0; i < upsg->count; i++) {
-                               u64 addr;
+                               uintptr_t addr;
                                void* p;
                                /* Does this really need to be GFP_DMA? */
                                p = kmalloc(usg->sg[i].count,GFP_KERNEL|__GFP_DMA);
@@ -676,7 +676,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
                                }
                                addr = (u64)usg->sg[i].addr[0];
                                addr += ((u64)usg->sg[i].addr[1]) << 32;
-                               sg_user[i] = (void __user *)(ptrdiff_t)addr;
+                               sg_user[i] = (void __user *)addr;
                                sg_list[i] = p; // save so we can clean up later
                                sg_indx = i;
 
@@ -704,7 +704,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
                                        rcode = -ENOMEM;
                                        goto cleanup;
                                }
-                               sg_user[i] = (void __user *)(ptrdiff_t)upsg->sg[i].addr;
+                               sg_user[i] = (void __user *)(uintptr_t)upsg->sg[i].addr;
                                sg_list[i] = p; // save so we can clean up later
                                sg_indx = i;
 
index 3009ad8c407343d209e9b4d0a79639f0dbbfd4fe..8736813a029657b494d143b93f7b83f484523693 100644 (file)
@@ -110,7 +110,7 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
        /*
         *      Align the beginning of Headers to commalign
         */
-       align = (commalign - ((ptrdiff_t)(base) & (commalign - 1)));
+       align = (commalign - ((uintptr_t)(base) & (commalign - 1)));
        base = base + align;
        phys = phys + align;
        /*
index fcd25f7d0bc636252074d535338d3c9f9e2e81f0..e6032ffc66a693597b685c859fc994cac64eedc0 100644 (file)
@@ -254,7 +254,7 @@ unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index)
                        kfree (fib);
                        return 1;
                }
-               memcpy(hw_fib, (struct hw_fib *)(((ptrdiff_t)(dev->regs.sa)) +
+               memcpy(hw_fib, (struct hw_fib *)(((uintptr_t)(dev->regs.sa)) +
                  (index & ~0x00000002L)), sizeof(struct hw_fib));
                INIT_LIST_HEAD(&fib->fiblink);
                fib->type = FSAFS_NTC_FIB_CONTEXT;
index ace7a15b413e42ba499847b2e5912f0f2cc7b56f..a67e29f83ae5003cdcb8e65e75951d7fee3093b6 100644 (file)
@@ -141,14 +141,14 @@ struct CMD_MESSAGE_FIELD
 #define IS_SG64_ADDR                0x01000000 /* bit24 */
 struct  SG32ENTRY
 {
-       uint32_t                                        length;
-       uint32_t                                        address;
+       __le32                                  length;
+       __le32                                  address;
 };
 struct  SG64ENTRY
 {
-       uint32_t                                        length;
-       uint32_t                                        address;
-       uint32_t                                        addresshigh;
+       __le32                                  length;
+       __le32                                  address;
+       __le32                                  addresshigh;
 };
 struct SGENTRY_UNION
 {
@@ -339,23 +339,15 @@ struct MessageUnit_B
        uint32_t        done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE];
        uint32_t        postq_index;
        uint32_t        doneq_index;
-       uint32_t        *drv2iop_doorbell_reg;
-       uint32_t        *drv2iop_doorbell_mask_reg;
-       uint32_t        *iop2drv_doorbell_reg;
-       uint32_t        *iop2drv_doorbell_mask_reg;
-       uint32_t        *msgcode_rwbuffer_reg;
-       uint32_t        *ioctl_wbuffer_reg;
-       uint32_t        *ioctl_rbuffer_reg;
+       uint32_t        __iomem *drv2iop_doorbell_reg;
+       uint32_t        __iomem *drv2iop_doorbell_mask_reg;
+       uint32_t        __iomem *iop2drv_doorbell_reg;
+       uint32_t        __iomem *iop2drv_doorbell_mask_reg;
+       uint32_t        __iomem *msgcode_rwbuffer_reg;
+       uint32_t        __iomem *ioctl_wbuffer_reg;
+       uint32_t        __iomem *ioctl_rbuffer_reg;
 };
 
-struct MessageUnit
-{
-       union
-       {
-               struct MessageUnit_A    pmu_A;
-               struct MessageUnit_B    pmu_B;
-       } u;
-};
 /*
 *******************************************************************************
 **                 Adapter Control Block
@@ -374,7 +366,10 @@ struct AdapterControlBlock
        /* Offset is used in making arc cdb physical to virtual calculations */
        uint32_t                        outbound_int_enable;
 
-       struct MessageUnit *                    pmu;
+       union {
+               struct MessageUnit_A __iomem *  pmuA;
+               struct MessageUnit_B *          pmuB;
+       };
        /* message unit ATU inbound base address0 */
 
        uint32_t                        acb_flags;
@@ -558,7 +553,7 @@ struct SENSE_DATA
 
 extern void arcmsr_post_ioctldata2iop(struct AdapterControlBlock *);
 extern void arcmsr_iop_message_read(struct AdapterControlBlock *);
-extern struct QBUFFER *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *);
+extern struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *);
 extern struct class_device_attribute *arcmsr_host_attrs[];
 extern int arcmsr_alloc_sysfs_attr(struct AdapterControlBlock *);
 void arcmsr_free_sysfs_attr(struct AdapterControlBlock *acb);
index d04d1aa28fa4512c1196768ac3511be520584e71..7d7b0a5542766a23717c598d0231bb57b8612ca6 100644 (file)
@@ -85,13 +85,13 @@ static ssize_t arcmsr_sysfs_iop_message_read(struct kobject *kobj,
                allxfer_len++;
        }
        if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) {
-               struct QBUFFER *prbuffer;
-               uint8_t *iop_data;
+               struct QBUFFER __iomem *prbuffer;
+               uint8_t __iomem *iop_data;
                int32_t iop_len;
 
                acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
                prbuffer = arcmsr_get_iop_rqbuffer(acb);
-               iop_data = (uint8_t *)prbuffer->data;
+               iop_data = prbuffer->data;
                iop_len = readl(&prbuffer->data_len);
                while (iop_len > 0) {
                        acb->rqbuffer[acb->rqbuf_lastindex] = readb(iop_data);
index f7a252885a5c69855e3aa3595dd4d2070a365ef1..d466a2dac1dbcba2d5e28d44260408bfa6979792 100644 (file)
@@ -236,18 +236,22 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb)
                uint32_t intmask_org;
                int i, j;
 
-               acb->pmu = ioremap(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0));
-               if (!acb->pmu) {
+               acb->pmuA = ioremap(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0));
+               if (!acb->pmuA) {
                        printk(KERN_NOTICE "arcmsr%d: memory mapping region fail \n",
                                                        acb->host->host_no);
+                       return -ENOMEM;
                }
 
                dma_coherent = dma_alloc_coherent(&pdev->dev,
                        ARCMSR_MAX_FREECCB_NUM *
                        sizeof (struct CommandControlBlock) + 0x20,
                        &dma_coherent_handle, GFP_KERNEL);
-               if (!dma_coherent)
+
+               if (!dma_coherent) {
+                       iounmap(acb->pmuA);
                        return -ENOMEM;
+               }
 
                acb->dma_coherent = dma_coherent;
                acb->dma_coherent_handle = dma_coherent_handle;
@@ -287,7 +291,7 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb)
 
                struct pci_dev *pdev = acb->pdev;
                struct MessageUnit_B *reg;
-               void *mem_base0, *mem_base1;
+               void __iomem *mem_base0, *mem_base1;
                void *dma_coherent;
                dma_addr_t dma_coherent_handle, dma_addr;
                uint32_t intmask_org;
@@ -328,25 +332,28 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb)
 
                reg = (struct MessageUnit_B *)(dma_coherent +
                ARCMSR_MAX_FREECCB_NUM * sizeof(struct CommandControlBlock));
-               acb->pmu = (struct MessageUnit *)reg;
+               acb->pmuB = reg;
                mem_base0 = ioremap(pci_resource_start(pdev, 0),
                                        pci_resource_len(pdev, 0));
+               if (!mem_base0)
+                       goto out;
+
                mem_base1 = ioremap(pci_resource_start(pdev, 2),
                                        pci_resource_len(pdev, 2));
-               reg->drv2iop_doorbell_reg = (uint32_t *)((char *)mem_base0 +
-                                               ARCMSR_DRV2IOP_DOORBELL);
-               reg->drv2iop_doorbell_mask_reg = (uint32_t *)((char *)mem_base0 +
-                                               ARCMSR_DRV2IOP_DOORBELL_MASK);
-               reg->iop2drv_doorbell_reg = (uint32_t *)((char *)mem_base0 +
-                                                       ARCMSR_IOP2DRV_DOORBELL);
-               reg->iop2drv_doorbell_mask_reg = (uint32_t *)((char *)mem_base0 +
-                                               ARCMSR_IOP2DRV_DOORBELL_MASK);
-               reg->ioctl_wbuffer_reg = (uint32_t *)((char *)mem_base1 +
-                                                       ARCMSR_IOCTL_WBUFFER);
-               reg->ioctl_rbuffer_reg = (uint32_t *)((char *)mem_base1 +
-                                                       ARCMSR_IOCTL_RBUFFER);
-               reg->msgcode_rwbuffer_reg = (uint32_t *)((char *)mem_base1 +
-                                                       ARCMSR_MSGCODE_RWBUFFER);
+               if (!mem_base1) {
+                       iounmap(mem_base0);
+                       goto out;
+               }
+
+               reg->drv2iop_doorbell_reg = mem_base0 + ARCMSR_DRV2IOP_DOORBELL;
+               reg->drv2iop_doorbell_mask_reg = mem_base0 +
+                                               ARCMSR_DRV2IOP_DOORBELL_MASK;
+               reg->iop2drv_doorbell_reg = mem_base0 + ARCMSR_IOP2DRV_DOORBELL;
+               reg->iop2drv_doorbell_mask_reg = mem_base0 +
+                                               ARCMSR_IOP2DRV_DOORBELL_MASK;
+               reg->ioctl_wbuffer_reg = mem_base1 + ARCMSR_IOCTL_WBUFFER;
+               reg->ioctl_rbuffer_reg = mem_base1 + ARCMSR_IOCTL_RBUFFER;
+               reg->msgcode_rwbuffer_reg = mem_base1 + ARCMSR_MSGCODE_RWBUFFER;
 
                acb->vir2phy_offset = (unsigned long)ccb_tmp -(unsigned long)dma_addr;
                for (i = 0; i < ARCMSR_MAX_TARGETID; i++)
@@ -362,6 +369,12 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb)
                break;
        }
        return 0;
+
+out:
+       dma_free_coherent(&acb->pdev->dev,
+               ARCMSR_MAX_FREECCB_NUM * sizeof(struct CommandControlBlock) + 0x20,
+               acb->dma_coherent, acb->dma_coherent_handle);
+       return -ENOMEM;
 }
 
 static int arcmsr_probe(struct pci_dev *pdev,
@@ -454,7 +467,6 @@ static int arcmsr_probe(struct pci_dev *pdev,
        free_irq(pdev->irq, acb);
  out_free_ccb_pool:
        arcmsr_free_ccb_pool(acb);
-       iounmap(acb->pmu);
  out_release_regions:
        pci_release_regions(pdev);
  out_host_put:
@@ -467,7 +479,7 @@ static int arcmsr_probe(struct pci_dev *pdev,
 
 static uint8_t arcmsr_hba_wait_msgint_ready(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
        uint32_t Index;
        uint8_t Retries = 0x00;
 
@@ -488,7 +500,7 @@ static uint8_t arcmsr_hba_wait_msgint_ready(struct AdapterControlBlock *acb)
 
 static uint8_t arcmsr_hbb_wait_msgint_ready(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+       struct MessageUnit_B *reg = acb->pmuB;
        uint32_t Index;
        uint8_t Retries = 0x00;
 
@@ -509,7 +521,7 @@ static uint8_t arcmsr_hbb_wait_msgint_ready(struct AdapterControlBlock *acb)
 
 static void arcmsr_abort_hba_allcmd(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
 
        writel(ARCMSR_INBOUND_MESG0_ABORT_CMD, &reg->inbound_msgaddr0);
        if (arcmsr_hba_wait_msgint_ready(acb))
@@ -520,7 +532,7 @@ static void arcmsr_abort_hba_allcmd(struct AdapterControlBlock *acb)
 
 static void arcmsr_abort_hbb_allcmd(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+       struct MessageUnit_B *reg = acb->pmuB;
 
        writel(ARCMSR_MESSAGE_ABORT_CMD, reg->drv2iop_doorbell_reg);
        if (arcmsr_hbb_wait_msgint_ready(acb))
@@ -566,7 +578,7 @@ static void arcmsr_ccb_complete(struct CommandControlBlock *ccb, int stand_flag)
 
 static void arcmsr_flush_hba_cache(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
        int retry_count = 30;
 
        writel(ARCMSR_INBOUND_MESG0_FLUSH_CACHE, &reg->inbound_msgaddr0);
@@ -583,7 +595,7 @@ static void arcmsr_flush_hba_cache(struct AdapterControlBlock *acb)
 
 static void arcmsr_flush_hbb_cache(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+       struct MessageUnit_B *reg = acb->pmuB;
        int retry_count = 30;
 
        writel(ARCMSR_MESSAGE_FLUSH_CACHE, reg->drv2iop_doorbell_reg);
@@ -637,7 +649,7 @@ static u32 arcmsr_disable_outbound_ints(struct AdapterControlBlock *acb)
        switch (acb->adapter_type) {
 
        case ACB_ADAPTER_TYPE_A : {
-               struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
                orig_mask = readl(&reg->outbound_intmask)|\
                                ARCMSR_MU_OUTBOUND_MESSAGE0_INTMASKENABLE;
                writel(orig_mask|ARCMSR_MU_OUTBOUND_ALL_INTMASKENABLE, \
@@ -646,7 +658,7 @@ static u32 arcmsr_disable_outbound_ints(struct AdapterControlBlock *acb)
                break;
 
        case ACB_ADAPTER_TYPE_B : {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                orig_mask = readl(reg->iop2drv_doorbell_mask_reg) & \
                                        (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE);
                writel(0, reg->iop2drv_doorbell_mask_reg);
@@ -748,14 +760,13 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb)
        switch (acb->adapter_type) {
 
        case ACB_ADAPTER_TYPE_A: {
-               struct MessageUnit_A __iomem *reg = \
-                       (struct MessageUnit_A *)acb->pmu;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
                uint32_t outbound_intstatus;
-               outbound_intstatus = readl(&reg->outbound_intstatus) & \
+               outbound_intstatus = readl(&reg->outbound_intstatus) &
                                        acb->outbound_int_enable;
                /*clear and abort all outbound posted Q*/
                writel(outbound_intstatus, &reg->outbound_intstatus);/*clear interrupt*/
-               while (((flag_ccb = readl(&reg->outbound_queueport)) != 0xFFFFFFFF) \
+               while (((flag_ccb = readl(&reg->outbound_queueport)) != 0xFFFFFFFF)
                                && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) {
                        arcmsr_drain_donequeue(acb, flag_ccb);
                }
@@ -763,7 +774,7 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb)
                break;
 
        case ACB_ADAPTER_TYPE_B: {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                /*clear all outbound posted Q*/
                for (i = 0; i < ARCMSR_MAX_HBB_POSTQUEUE; i++) {
                        if ((flag_ccb = readl(&reg->done_qbuffer[i])) != 0) {
@@ -816,7 +827,6 @@ static void arcmsr_remove(struct pci_dev *pdev)
        }
 
        free_irq(pdev->irq, acb);
-       iounmap(acb->pmu);
        arcmsr_free_ccb_pool(acb);
        pci_release_regions(pdev);
 
@@ -859,7 +869,7 @@ static void arcmsr_enable_outbound_ints(struct AdapterControlBlock *acb, \
        switch (acb->adapter_type) {
 
        case ACB_ADAPTER_TYPE_A : {
-               struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
                mask = intmask_org & ~(ARCMSR_MU_OUTBOUND_POSTQUEUE_INTMASKENABLE |
                             ARCMSR_MU_OUTBOUND_DOORBELL_INTMASKENABLE);
                writel(mask, &reg->outbound_intmask);
@@ -868,7 +878,7 @@ static void arcmsr_enable_outbound_ints(struct AdapterControlBlock *acb, \
                break;
 
        case ACB_ADAPTER_TYPE_B : {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                mask = intmask_org | (ARCMSR_IOP2DRV_DATA_WRITE_OK | \
                        ARCMSR_IOP2DRV_DATA_READ_OK | ARCMSR_IOP2DRV_CDB_DONE);
                writel(mask, reg->iop2drv_doorbell_mask_reg);
@@ -882,7 +892,7 @@ static void arcmsr_build_ccb(struct AdapterControlBlock *acb,
 {
        struct ARCMSR_CDB *arcmsr_cdb = (struct ARCMSR_CDB *)&ccb->arcmsr_cdb;
        int8_t *psge = (int8_t *)&arcmsr_cdb->u;
-       uint32_t address_lo, address_hi;
+       __le32 address_lo, address_hi;
        int arccdbsize = 0x30;
        int nseg;
 
@@ -900,7 +910,8 @@ static void arcmsr_build_ccb(struct AdapterControlBlock *acb,
        BUG_ON(nseg < 0);
 
        if (nseg) {
-               int length, i, cdb_sgcount = 0;
+               __le32 length;
+               int i, cdb_sgcount = 0;
                struct scatterlist *sg;
 
                /* map stor port SG list to our iop SG List. */
@@ -921,7 +932,7 @@ static void arcmsr_build_ccb(struct AdapterControlBlock *acb,
 
                                pdma_sg->addresshigh = address_hi;
                                pdma_sg->address = address_lo;
-                               pdma_sg->length = length|IS_SG64_ADDR;
+                               pdma_sg->length = length|cpu_to_le32(IS_SG64_ADDR);
                                psge += sizeof (struct SG64ENTRY);
                                arccdbsize += sizeof (struct SG64ENTRY);
                        }
@@ -947,7 +958,7 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr
 
        switch (acb->adapter_type) {
        case ACB_ADAPTER_TYPE_A: {
-               struct MessageUnit_A *reg = (struct MessageUnit_A *)acb->pmu;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
 
                if (arcmsr_cdb->Flags & ARCMSR_CDB_FLAG_SGL_BSIZE)
                        writel(cdb_shifted_phyaddr | ARCMSR_CCBPOST_FLAG_SGL_BSIZE,
@@ -959,7 +970,7 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr
                break;
 
        case ACB_ADAPTER_TYPE_B: {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                uint32_t ending_index, index = reg->postq_index;
 
                ending_index = ((index + 1) % ARCMSR_MAX_HBB_POSTQUEUE);
@@ -982,7 +993,7 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr
 
 static void arcmsr_stop_hba_bgrb(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
        acb->acb_flags &= ~ACB_F_MSG_START_BGRB;
        writel(ARCMSR_INBOUND_MESG0_STOP_BGRB, &reg->inbound_msgaddr0);
 
@@ -995,7 +1006,7 @@ static void arcmsr_stop_hba_bgrb(struct AdapterControlBlock *acb)
 
 static void arcmsr_stop_hbb_bgrb(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+       struct MessageUnit_B *reg = acb->pmuB;
        acb->acb_flags &= ~ACB_F_MSG_START_BGRB;
        writel(ARCMSR_MESSAGE_STOP_BGRB, reg->drv2iop_doorbell_reg);
 
@@ -1023,6 +1034,17 @@ static void arcmsr_stop_adapter_bgrb(struct AdapterControlBlock *acb)
 
 static void arcmsr_free_ccb_pool(struct AdapterControlBlock *acb)
 {
+       switch (acb->adapter_type) {
+       case ACB_ADAPTER_TYPE_A: {
+               iounmap(acb->pmuA);
+               break;
+       }
+       case ACB_ADAPTER_TYPE_B: {
+               struct MessageUnit_B *reg = acb->pmuB;
+               iounmap(reg->drv2iop_doorbell_reg - ARCMSR_DRV2IOP_DOORBELL);
+               iounmap(reg->ioctl_wbuffer_reg - ARCMSR_IOCTL_WBUFFER);
+       }
+       }
        dma_free_coherent(&acb->pdev->dev,
                ARCMSR_MAX_FREECCB_NUM * sizeof (struct CommandControlBlock) + 0x20,
                acb->dma_coherent,
@@ -1033,13 +1055,13 @@ void arcmsr_iop_message_read(struct AdapterControlBlock *acb)
 {
        switch (acb->adapter_type) {
        case ACB_ADAPTER_TYPE_A: {
-               struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
                writel(ARCMSR_INBOUND_DRIVER_DATA_READ_OK, &reg->inbound_doorbell);
                }
                break;
 
        case ACB_ADAPTER_TYPE_B: {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                writel(ARCMSR_DRV2IOP_DATA_READ_OK, reg->drv2iop_doorbell_reg);
                }
                break;
@@ -1050,7 +1072,7 @@ static void arcmsr_iop_message_wrote(struct AdapterControlBlock *acb)
 {
        switch (acb->adapter_type) {
        case ACB_ADAPTER_TYPE_A: {
-               struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
                /*
                ** push inbound doorbell tell iop, driver data write ok
                ** and wait reply on next hwinterrupt for next Qbuffer post
@@ -1060,7 +1082,7 @@ static void arcmsr_iop_message_wrote(struct AdapterControlBlock *acb)
                break;
 
        case ACB_ADAPTER_TYPE_B: {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                /*
                ** push inbound doorbell tell iop, driver data write ok
                ** and wait reply on next hwinterrupt for next Qbuffer post
@@ -1071,41 +1093,41 @@ static void arcmsr_iop_message_wrote(struct AdapterControlBlock *acb)
        }
 }
 
-struct QBUFFER *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *acb)
+struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *acb)
 {
-       static struct QBUFFER *qbuffer;
+       struct QBUFFER __iomem *qbuffer = NULL;
 
        switch (acb->adapter_type) {
 
        case ACB_ADAPTER_TYPE_A: {
-               struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
-               qbuffer = (struct QBUFFER __iomem *) &reg->message_rbuffer;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
+               qbuffer = (struct QBUFFER __iomem *)&reg->message_rbuffer;
                }
                break;
 
        case ACB_ADAPTER_TYPE_B: {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
-               qbuffer = (struct QBUFFER __iomem *) reg->ioctl_rbuffer_reg;
+               struct MessageUnit_B *reg = acb->pmuB;
+               qbuffer = (struct QBUFFER __iomem *)reg->ioctl_rbuffer_reg;
                }
                break;
        }
        return qbuffer;
 }
 
-static struct QBUFFER *arcmsr_get_iop_wqbuffer(struct AdapterControlBlock *acb)
+static struct QBUFFER __iomem *arcmsr_get_iop_wqbuffer(struct AdapterControlBlock *acb)
 {
-       static struct QBUFFER *pqbuffer;
+       struct QBUFFER __iomem *pqbuffer = NULL;
 
        switch (acb->adapter_type) {
 
        case ACB_ADAPTER_TYPE_A: {
-               struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
-               pqbuffer = (struct QBUFFER *) &reg->message_wbuffer;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
+               pqbuffer = (struct QBUFFER __iomem *) &reg->message_wbuffer;
                }
                break;
 
        case ACB_ADAPTER_TYPE_B: {
-               struct MessageUnit_B  *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B  *reg = acb->pmuB;
                pqbuffer = (struct QBUFFER __iomem *)reg->ioctl_wbuffer_reg;
                }
                break;
@@ -1115,15 +1137,15 @@ static struct QBUFFER *arcmsr_get_iop_wqbuffer(struct AdapterControlBlock *acb)
 
 static void arcmsr_iop2drv_data_wrote_handle(struct AdapterControlBlock *acb)
 {
-       struct QBUFFER *prbuffer;
+       struct QBUFFER __iomem *prbuffer;
        struct QBUFFER *pQbuffer;
-       uint8_t *iop_data;
+       uint8_t __iomem *iop_data;
        int32_t my_empty_len, iop_len, rqbuf_firstindex, rqbuf_lastindex;
 
        rqbuf_lastindex = acb->rqbuf_lastindex;
        rqbuf_firstindex = acb->rqbuf_firstindex;
        prbuffer = arcmsr_get_iop_rqbuffer(acb);
-       iop_data = (uint8_t *)prbuffer->data;
+       iop_data = (uint8_t __iomem *)prbuffer->data;
        iop_len = prbuffer->data_len;
        my_empty_len = (rqbuf_firstindex - rqbuf_lastindex -1)&(ARCMSR_MAX_QBUFFER -1);
 
@@ -1151,8 +1173,8 @@ static void arcmsr_iop2drv_data_read_handle(struct AdapterControlBlock *acb)
        acb->acb_flags |= ACB_F_MESSAGE_WQBUFFER_READED;
        if (acb->wqbuf_firstindex != acb->wqbuf_lastindex) {
                uint8_t *pQbuffer;
-               struct QBUFFER *pwbuffer;
-               uint8_t *iop_data;
+               struct QBUFFER __iomem *pwbuffer;
+               uint8_t __iomem *iop_data;
                int32_t allxfer_len = 0;
 
                acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READED);
@@ -1181,7 +1203,7 @@ static void arcmsr_iop2drv_data_read_handle(struct AdapterControlBlock *acb)
 static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb)
 {
        uint32_t outbound_doorbell;
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
 
        outbound_doorbell = readl(&reg->outbound_doorbell);
        writel(outbound_doorbell, &reg->outbound_doorbell);
@@ -1197,7 +1219,7 @@ static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb)
 static void arcmsr_hba_postqueue_isr(struct AdapterControlBlock *acb)
 {
        uint32_t flag_ccb;
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
 
        while ((flag_ccb = readl(&reg->outbound_queueport)) != 0xFFFFFFFF) {
                arcmsr_drain_donequeue(acb, flag_ccb);
@@ -1208,7 +1230,7 @@ static void arcmsr_hbb_postqueue_isr(struct AdapterControlBlock *acb)
 {
        uint32_t index;
        uint32_t flag_ccb;
-       struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+       struct MessageUnit_B *reg = acb->pmuB;
 
        index = reg->doneq_index;
 
@@ -1224,7 +1246,7 @@ static void arcmsr_hbb_postqueue_isr(struct AdapterControlBlock *acb)
 static int arcmsr_handle_hba_isr(struct AdapterControlBlock *acb)
 {
        uint32_t outbound_intstatus;
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
 
        outbound_intstatus = readl(&reg->outbound_intstatus) & \
                                                        acb->outbound_int_enable;
@@ -1244,7 +1266,7 @@ static int arcmsr_handle_hba_isr(struct AdapterControlBlock *acb)
 static int arcmsr_handle_hbb_isr(struct AdapterControlBlock *acb)
 {
        uint32_t outbound_doorbell;
-       struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+       struct MessageUnit_B *reg = acb->pmuB;
 
        outbound_doorbell = readl(reg->iop2drv_doorbell_reg) & \
                                                        acb->outbound_int_enable;
@@ -1305,8 +1327,8 @@ void arcmsr_post_ioctldata2iop(struct AdapterControlBlock *acb)
 {
        int32_t wqbuf_firstindex, wqbuf_lastindex;
        uint8_t *pQbuffer;
-       struct QBUFFER *pwbuffer;
-       uint8_t *iop_data;
+       struct QBUFFER __iomem *pwbuffer;
+       uint8_t __iomem *iop_data;
        int32_t allxfer_len = 0;
 
        pwbuffer = arcmsr_get_iop_wqbuffer(acb);
@@ -1380,13 +1402,13 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, \
                }
                if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) {
 
-                       struct QBUFFER *prbuffer;
-                       uint8_t *iop_data;
+                       struct QBUFFER __iomem *prbuffer;
+                       uint8_t __iomem *iop_data;
                        int32_t iop_len;
 
                        acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
                        prbuffer = arcmsr_get_iop_rqbuffer(acb);
-                       iop_data = (uint8_t *)prbuffer->data;
+                       iop_data = prbuffer->data;
                        iop_len = readl(&prbuffer->data_len);
                        while (iop_len > 0) {
                                acb->rqbuffer[acb->rqbuf_lastindex] = readb(iop_data);
@@ -1669,11 +1691,11 @@ static int arcmsr_queue_command(struct scsi_cmnd *cmd,
 
 static void arcmsr_get_hba_config(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
        char *acb_firm_model = acb->firm_model;
        char *acb_firm_version = acb->firm_version;
-       char *iop_firm_model = (char *) (&reg->message_rwbuffer[15]);
-       char *iop_firm_version = (char *) (&reg->message_rwbuffer[17]);
+       char __iomem *iop_firm_model = (char __iomem *)(&reg->message_rwbuffer[15]);
+       char __iomem *iop_firm_version = (char __iomem *)(&reg->message_rwbuffer[17]);
        int count;
 
        writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, &reg->inbound_msgaddr0);
@@ -1710,13 +1732,13 @@ static void arcmsr_get_hba_config(struct AdapterControlBlock *acb)
 
 static void arcmsr_get_hbb_config(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
-       uint32_t *lrwbuffer = reg->msgcode_rwbuffer_reg;
+       struct MessageUnit_B *reg = acb->pmuB;
+       uint32_t __iomem *lrwbuffer = reg->msgcode_rwbuffer_reg;
        char *acb_firm_model = acb->firm_model;
        char *acb_firm_version = acb->firm_version;
-       char *iop_firm_model = (char *) (&lrwbuffer[15]);
+       char __iomem *iop_firm_model = (char __iomem *)(&lrwbuffer[15]);
        /*firm_model,15,60-67*/
-       char *iop_firm_version = (char *) (&lrwbuffer[17]);
+       char __iomem *iop_firm_version = (char __iomem *)(&lrwbuffer[17]);
        /*firm_version,17,68-83*/
        int count;
 
@@ -1777,7 +1799,7 @@ static void arcmsr_get_firmware_spec(struct AdapterControlBlock *acb)
 static void arcmsr_polling_hba_ccbdone(struct AdapterControlBlock *acb,
        struct CommandControlBlock *poll_ccb)
 {
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
        struct CommandControlBlock *ccb;
        uint32_t flag_ccb, outbound_intstatus, poll_ccb_done = 0, poll_count = 0;
 
@@ -1826,7 +1848,7 @@ static void arcmsr_polling_hba_ccbdone(struct AdapterControlBlock *acb,
 static void arcmsr_polling_hbb_ccbdone(struct AdapterControlBlock *acb, \
                                        struct CommandControlBlock *poll_ccb)
 {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                struct CommandControlBlock *ccb;
                uint32_t flag_ccb, poll_ccb_done = 0, poll_count = 0;
                int index;
@@ -1918,8 +1940,7 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb)
 
        case ACB_ADAPTER_TYPE_A: {
                if (ccb_phyaddr_hi32 != 0) {
-                       struct MessageUnit_A __iomem *reg = \
-                                       (struct MessageUnit_A *)acb->pmu;
+                       struct MessageUnit_A __iomem *reg = acb->pmuA;
                        uint32_t intmask_org;
                        intmask_org = arcmsr_disable_outbound_ints(acb);
                        writel(ARCMSR_SIGNATURE_SET_CONFIG, \
@@ -1940,9 +1961,9 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb)
 
        case ACB_ADAPTER_TYPE_B: {
                unsigned long post_queue_phyaddr;
-               uint32_t *rwbuffer;
+               uint32_t __iomem *rwbuffer;
 
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                uint32_t intmask_org;
                intmask_org = arcmsr_disable_outbound_ints(acb);
                reg->postq_index = 0;
@@ -1994,7 +2015,7 @@ static void arcmsr_wait_firmware_ready(struct AdapterControlBlock *acb)
        switch (acb->adapter_type) {
 
        case ACB_ADAPTER_TYPE_A: {
-               struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
                do {
                        firmware_state = readl(&reg->outbound_msgaddr1);
                } while ((firmware_state & ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK) == 0);
@@ -2002,7 +2023,7 @@ static void arcmsr_wait_firmware_ready(struct AdapterControlBlock *acb)
                break;
 
        case ACB_ADAPTER_TYPE_B: {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                do {
                        firmware_state = readl(reg->iop2drv_doorbell_reg);
                } while ((firmware_state & ARCMSR_MESSAGE_FIRMWARE_OK) == 0);
@@ -2013,7 +2034,7 @@ static void arcmsr_wait_firmware_ready(struct AdapterControlBlock *acb)
 
 static void arcmsr_start_hba_bgrb(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu;
+       struct MessageUnit_A __iomem *reg = acb->pmuA;
        acb->acb_flags |= ACB_F_MSG_START_BGRB;
        writel(ARCMSR_INBOUND_MESG0_START_BGRB, &reg->inbound_msgaddr0);
        if (arcmsr_hba_wait_msgint_ready(acb)) {
@@ -2024,7 +2045,7 @@ static void arcmsr_start_hba_bgrb(struct AdapterControlBlock *acb)
 
 static void arcmsr_start_hbb_bgrb(struct AdapterControlBlock *acb)
 {
-       struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+       struct MessageUnit_B *reg = acb->pmuB;
        acb->acb_flags |= ACB_F_MSG_START_BGRB;
        writel(ARCMSR_MESSAGE_START_BGRB, reg->drv2iop_doorbell_reg);
        if (arcmsr_hbb_wait_msgint_ready(acb)) {
@@ -2049,7 +2070,7 @@ static void arcmsr_clear_doorbell_queue_buffer(struct AdapterControlBlock *acb)
 {
        switch (acb->adapter_type) {
        case ACB_ADAPTER_TYPE_A: {
-               struct MessageUnit_A *reg = (struct MessageUnit_A *)acb->pmu;
+               struct MessageUnit_A __iomem *reg = acb->pmuA;
                uint32_t outbound_doorbell;
                /* empty doorbell Qbuffer if door bell ringed */
                outbound_doorbell = readl(&reg->outbound_doorbell);
@@ -2060,7 +2081,7 @@ static void arcmsr_clear_doorbell_queue_buffer(struct AdapterControlBlock *acb)
                break;
 
        case ACB_ADAPTER_TYPE_B: {
-               struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu;
+               struct MessageUnit_B *reg = acb->pmuB;
                /*clear interrupt and message state*/
                writel(ARCMSR_MESSAGE_INT_CLEAR_PATTERN, reg->iop2drv_doorbell_reg);
                writel(ARCMSR_DRV2IOP_DATA_READ_OK, reg->drv2iop_doorbell_reg);
index b5fa4f091387eb83cdc9009e2050d0062fa9201f..f1871ea0404573e610ef439e8d377d0b4a7a1419 100644 (file)
@@ -1652,6 +1652,7 @@ sg_build_sgat(Sg_scatter_hold * schp, const Sg_fd * sfp, int tablesize)
        schp->buffer = kzalloc(sg_bufflen, gfp_flags);
        if (!schp->buffer)
                return -ENOMEM;
+       sg_init_table(schp->buffer, tablesize);
        schp->sglist_len = sg_bufflen;
        return tablesize;       /* number of scat_gath elements allocated */
 }
index c55459c592b855f04bd2aeb180d06df04ae0a4d8..b3518ca9f04e01b0d3115908988f9e4ccd8d2aed 100644 (file)
@@ -184,14 +184,14 @@ static int spidev_message(struct spidev_data *spidev,
                if (u_tmp->rx_buf) {
                        k_tmp->rx_buf = buf;
                        if (!access_ok(VERIFY_WRITE, (u8 __user *)
-                                               (ptrdiff_t) u_tmp->rx_buf,
+                                               (uintptr_t) u_tmp->rx_buf,
                                                u_tmp->len))
                                goto done;
                }
                if (u_tmp->tx_buf) {
                        k_tmp->tx_buf = buf;
                        if (copy_from_user(buf, (const u8 __user *)
-                                               (ptrdiff_t) u_tmp->tx_buf,
+                                               (uintptr_t) u_tmp->tx_buf,
                                        u_tmp->len))
                                goto done;
                }
@@ -224,7 +224,7 @@ static int spidev_message(struct spidev_data *spidev,
        for (n = n_xfers, u_tmp = u_xfers; n; n--, u_tmp++) {
                if (u_tmp->rx_buf) {
                        if (__copy_to_user((u8 __user *)
-                                       (ptrdiff_t) u_tmp->rx_buf, buf,
+                                       (uintptr_t) u_tmp->rx_buf, buf,
                                        u_tmp->len)) {
                                status = -EFAULT;
                                goto done;
index 732c83f04c3d29d71071b80a1061542db3023d22..38bd9d94ee4647dcddee216875f9e5b4a51907a7 100644 (file)
@@ -14,7 +14,6 @@ extern int um_execve(const char *file, char *const argv[], char *const env[]);
 
 #ifdef __KERNEL__
 /* We get __ARCH_WANT_OLD_STAT and __ARCH_WANT_STAT64 from the base arch */
-#define __ARCH_WANT_IPC_PARSE_VERSION
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_SYS_ALARM
 #define __ARCH_WANT_SYS_GETHOSTNAME
index bbf906a0b419f95d536a9fae2d325ec04c2f5944..8396db24d01902d9502016776bc9685c3ccea9f1 100644 (file)
@@ -341,7 +341,6 @@ enum blk_queue_state {
 struct blk_queue_tag {
        struct request **tag_index;     /* map of busy tags */
        unsigned long *tag_map;         /* bit map of free/busy tags */
-       struct list_head busy_list;     /* fifo list of busy tags */
        int busy;                       /* current depth */
        int max_depth;                  /* what we will send to device */
        int real_max_depth;             /* what the array can hold */
@@ -435,6 +434,7 @@ struct request_queue
        unsigned int            dma_alignment;
 
        struct blk_queue_tag    *queue_tags;
+       struct list_head        tag_busy_list;
 
        unsigned int            nr_sorted;
        unsigned int            in_flight;
index d2a96cbf4f0eeac7b9d01ae11a7553a3be4f0d92..cf79853967ffb25b839e7c77c3bf8ef9956d95e8 100644 (file)
  * On x86-64 make the 64bit structure have the same alignment as the
  * 32bit structure. This makes 32bit emulation easier.
  *
- * UML/x86_64 needs the same packing as x86_64 - UML + UML_X86 +
- * 64_BIT adds up to UML/x86_64.
+ * UML/x86_64 needs the same packing as x86_64
  */
 #ifdef __x86_64__
 #define EPOLL_PACKED __attribute__((packed))
 #else
-#if defined(CONFIG_UML) && defined(CONFIG_UML_X86) && defined(CONFIG_64BIT)
-#define EPOLL_PACKED __attribute__((packed))
-#else
 #define EPOLL_PACKED
 #endif
-#endif
 
 struct epoll_event {
        __u32 events;
index 45712317138973ad8147ed0567c30bb4d62da55a..32326c293d7bfbd0c9fe318ce4f5143258bed65a 100644 (file)
@@ -150,7 +150,7 @@ static inline struct scatterlist *sg_last(struct scatterlist *sgl,
        struct scatterlist *ret = &sgl[nents - 1];
 #else
        struct scatterlist *sg, *ret = NULL;
-       int i;
+       unsigned int i;
 
        for_each_sg(sgl, sg, nents, i)
                ret = sg;
@@ -179,7 +179,11 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
 #ifndef ARCH_HAS_SG_CHAIN
        BUG();
 #endif
-       prv[prv_nents - 1].page_link = (unsigned long) sgl | 0x01;
+       /*
+        * Set lowest bit to indicate a link pointer, and make sure to clear
+        * the termination bit if it happens to be set.
+        */
+       prv[prv_nents - 1].page_link = ((unsigned long) sgl | 0x01) & ~0x02;
 }
 
 /**
@@ -239,7 +243,7 @@ static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents)
        sg_mark_end(sgl, nents);
 #ifdef CONFIG_DEBUG_SG
        {
-               int i;
+               unsigned int i;
                for (i = 0; i < nents; i++)
                        sgl[i].sg_magic = SG_MAGIC;
        }
index 0013a0d8dc6b5620fb7d4add4ae7d1d5ce9f2c8d..87b895d5c786eb0256eae604e9d1efa9979e3756 100644 (file)
 #define _LINUX_SUNRPC_RPC_RDMA_H
 
 struct rpcrdma_segment {
-       uint32_t rs_handle;     /* Registered memory handle */
-       uint32_t rs_length;     /* Length of the chunk in bytes */
-       uint64_t rs_offset;     /* Chunk virtual address or offset */
+       __be32 rs_handle;       /* Registered memory handle */
+       __be32 rs_length;       /* Length of the chunk in bytes */
+       __be64 rs_offset;       /* Chunk virtual address or offset */
 };
 
 /*
  * read chunk(s), encoded as a linked list.
  */
 struct rpcrdma_read_chunk {
-       uint32_t rc_discrim;    /* 1 indicates presence */
-       uint32_t rc_position;   /* Position in XDR stream */
+       __be32 rc_discrim;      /* 1 indicates presence */
+       __be32 rc_position;     /* Position in XDR stream */
        struct rpcrdma_segment rc_target;
 };
 
@@ -66,29 +66,29 @@ struct rpcrdma_write_chunk {
  * write chunk(s), encoded as a counted array.
  */
 struct rpcrdma_write_array {
-       uint32_t wc_discrim;    /* 1 indicates presence */
-       uint32_t wc_nchunks;    /* Array count */
+       __be32 wc_discrim;      /* 1 indicates presence */
+       __be32 wc_nchunks;      /* Array count */
        struct rpcrdma_write_chunk wc_array[0];
 };
 
 struct rpcrdma_msg {
-       uint32_t rm_xid;        /* Mirrors the RPC header xid */
-       uint32_t rm_vers;       /* Version of this protocol */
-       uint32_t rm_credit;     /* Buffers requested/granted */
-       uint32_t rm_type;       /* Type of message (enum rpcrdma_proc) */
+       __be32 rm_xid;  /* Mirrors the RPC header xid */
+       __be32 rm_vers; /* Version of this protocol */
+       __be32 rm_credit;       /* Buffers requested/granted */
+       __be32 rm_type; /* Type of message (enum rpcrdma_proc) */
        union {
 
                struct {                        /* no chunks */
-                       uint32_t rm_empty[3];   /* 3 empty chunk lists */
+                       __be32 rm_empty[3];     /* 3 empty chunk lists */
                } rm_nochunks;
 
                struct {                        /* no chunks and padded */
-                       uint32_t rm_align;      /* Padding alignment */
-                       uint32_t rm_thresh;     /* Padding threshold */
-                       uint32_t rm_pempty[3];  /* 3 empty chunk lists */
+                       __be32 rm_align;        /* Padding alignment */
+                       __be32 rm_thresh;       /* Padding threshold */
+                       __be32 rm_pempty[3];    /* 3 empty chunk lists */
                } rm_padded;
 
-               uint32_t rm_chunks[0];  /* read, write and reply chunks */
+               __be32 rm_chunks[0];    /* read, write and reply chunks */
 
        } rm_body;
 };
index 4f0dad21c91702a86acdcd22ca1b556e84ed1203..f4f8d19158e4bb80d7ef39080ec1fabf4584cf7a 100644 (file)
@@ -37,6 +37,8 @@ typedef __kernel_gid32_t      gid_t;
 typedef __kernel_uid16_t        uid16_t;
 typedef __kernel_gid16_t        gid16_t;
 
+typedef unsigned long          uintptr_t;
+
 #ifdef CONFIG_UID16
 /* This is defined by include/asm-{arch}/posix_types.h */
 typedef __kernel_old_uid_t     old_uid_t;
index 9e8f13b7da5ae148e24c585c532f8940351a9c98..5db261a1e85e671bcbf907325e68ab5b4e3aeddf 100644 (file)
@@ -103,7 +103,7 @@ struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc);
 void sctp_auth_asoc_set_default_hmac(struct sctp_association *asoc,
                                     struct sctp_hmac_algo_param *hmacs);
 int sctp_auth_asoc_verify_hmac_id(const struct sctp_association *asoc,
-                                   __u16 hmac_id);
+                                   __be16 hmac_id);
 int sctp_auth_send_cid(sctp_cid_t chunk, const struct sctp_association *asoc);
 int sctp_auth_recv_cid(sctp_cid_t chunk, const struct sctp_association *asoc);
 void sctp_auth_calculate_hmac(const struct sctp_association *asoc,
index b6d2ff7e37ee280d266ecc98ed63cb2d8f48d0f9..22a25142e4cf923967d770ef23a7992d1b19ff42 100644 (file)
@@ -602,7 +602,7 @@ static int hrtimer_switch_to_hres(void)
        /* "Retrigger" the interrupt to get things going */
        retrigger_next_event(NULL);
        local_irq_restore(flags);
-       printk(KERN_INFO "Switched to high resolution mode on CPU %d\n",
+       printk(KERN_DEBUG "Switched to high resolution mode on CPU %d\n",
               smp_processor_id());
        return 1;
 }
index 12006308c7eba5f920ba417bcff27a42312399af..4537bdda1ebfa5c67f1ae8a8aec435c8b01a73b9 100644 (file)
@@ -732,7 +732,7 @@ static void print_fatal_signal(struct pt_regs *regs, int signr)
        printk("%s/%d: potentially unexpected fatal signal %d.\n",
                current->comm, task_pid_nr(current), signr);
 
-#ifdef __i386__
+#if defined(__i386__) && !defined(__arch_um__)
        printk("code at %08lx: ", regs->eip);
        {
                int i;
index 10a1347597fd394fec309d1ae74663ae2d9ae05c..5997456ebbc913f30d922587feb0c0d9818e62f6 100644 (file)
@@ -320,8 +320,6 @@ ktime_t tick_nohz_get_sleep_length(void)
        return ts->sleep_length;
 }
 
-EXPORT_SYMBOL_GPL(tick_nohz_get_sleep_length);
-
 /**
  * nohz_restart_sched_tick - restart the idle tick from the idle task
  *
index fdb2e03d4fe0d40943b72a11050fafefefbf81d9..12c5f4cb6b8c67bd9d04bc8784989a2be9185fc1 100644 (file)
@@ -129,7 +129,8 @@ static void print_cpu(struct seq_file *m, int cpu, u64 now)
        struct hrtimer_cpu_base *cpu_base = &per_cpu(hrtimer_bases, cpu);
        int i;
 
-       SEQ_printf(m, "\ncpu: %d\n", cpu);
+       SEQ_printf(m, "\n");
+       SEQ_printf(m, "cpu: %d\n", cpu);
        for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
                SEQ_printf(m, " clock %d:\n", i);
                print_base(m, cpu_base->clock_base + i, now);
@@ -184,7 +185,8 @@ print_tickdevice(struct seq_file *m, struct tick_device *td)
 {
        struct clock_event_device *dev = td->evtdev;
 
-       SEQ_printf(m, "\nTick Device: mode:     %d\n", td->mode);
+       SEQ_printf(m, "\n");
+       SEQ_printf(m, "Tick Device: mode:     %d\n", td->mode);
 
        SEQ_printf(m, "Clock Event Device: ");
        if (!dev) {
index 5209e47b7fe39dba855e84ee9ca4d89283fd3d80..7c8643630023d239f099335f4a80480d5bde0a02 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/backing-dev.h>
 #include <linux/pagevec.h>
 #include <linux/blkdev.h>
+#include <linux/backing-dev.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
 #include <linux/cpuset.h>
index 8f09333f78e1d63dbe1a5d24c9ba240ce683dbc6..35622c59092546b9fd91d1aa31eceb3504bae41d 100644 (file)
@@ -12,6 +12,7 @@
  *  Copyright (c) 2002      Greg Ungerer <gerg@snapgear.com>
  */
 
+#include <linux/module.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
 #include <linux/swap.h>
index aac1dd3c657d1de350c5e7615a31d0c8021abb55..bcdb2c8941a5fcb428d4d3d256106f29e921debd 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2734,7 +2734,7 @@ static void slab_mem_offline_callback(void *arg)
                         * and offline_pages() function shoudn't call this
                         * callback. So, we must fail.
                         */
-                       BUG_ON(atomic_read(&n->nr_slabs));
+                       BUG_ON(atomic_long_read(&n->nr_slabs));
 
                        s->node[offline_node] = NULL;
                        kmem_cache_free(kmalloc_caches, n);
index 8af1004abefeb885a6ee10f4a12c2c939551e468..6d5fa6bb371b0ce2d85a77093092ac440d93684a 100644 (file)
@@ -556,7 +556,7 @@ struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc)
        return &sctp_hmac_list[id];
 }
 
-static int __sctp_auth_find_hmacid(__u16 *hmacs, int n_elts, __u16 hmac_id)
+static int __sctp_auth_find_hmacid(__be16 *hmacs, int n_elts, __be16 hmac_id)
 {
        int  found = 0;
        int  i;
@@ -573,7 +573,7 @@ static int __sctp_auth_find_hmacid(__u16 *hmacs, int n_elts, __u16 hmac_id)
 
 /* See if the HMAC_ID is one that we claim as supported */
 int sctp_auth_asoc_verify_hmac_id(const struct sctp_association *asoc,
-                                   __u16 hmac_id)
+                                   __be16 hmac_id)
 {
        struct sctp_hmac_algo_param *hmacs;
        __u16 n_elt;
index 12db63580427805fb68856b7f310dfa17ffc91f9..f877b88091ce99423d86bea79bdca2af7d6c750c 100644 (file)
@@ -181,7 +181,7 @@ rpcrdma_create_chunks(struct rpc_rqst *rqst, struct xdr_buf *target,
        struct rpcrdma_read_chunk *cur_rchunk = NULL;
        struct rpcrdma_write_array *warray = NULL;
        struct rpcrdma_write_chunk *cur_wchunk = NULL;
-       u32 *iptr = headerp->rm_body.rm_chunks;
+       __be32 *iptr = headerp->rm_body.rm_chunks;
 
        if (type == rpcrdma_readch || type == rpcrdma_areadch) {
                /* a read chunk - server will RDMA Read our memory */
@@ -217,7 +217,7 @@ rpcrdma_create_chunks(struct rpc_rqst *rqst, struct xdr_buf *target,
                        cur_rchunk->rc_target.rs_handle = htonl(seg->mr_rkey);
                        cur_rchunk->rc_target.rs_length = htonl(seg->mr_len);
                        xdr_encode_hyper(
-                                       (u32 *)&cur_rchunk->rc_target.rs_offset,
+                                       (__be32 *)&cur_rchunk->rc_target.rs_offset,
                                        seg->mr_base);
                        dprintk("RPC:       %s: read chunk "
                                "elem %d@0x%llx:0x%x pos %d (%s)\n", __func__,
@@ -229,7 +229,7 @@ rpcrdma_create_chunks(struct rpc_rqst *rqst, struct xdr_buf *target,
                        cur_wchunk->wc_target.rs_handle = htonl(seg->mr_rkey);
                        cur_wchunk->wc_target.rs_length = htonl(seg->mr_len);
                        xdr_encode_hyper(
-                                       (u32 *)&cur_wchunk->wc_target.rs_offset,
+                                       (__be32 *)&cur_wchunk->wc_target.rs_offset,
                                        seg->mr_base);
                        dprintk("RPC:       %s: %s chunk "
                                "elem %d@0x%llx:0x%x (%s)\n", __func__,
@@ -257,14 +257,14 @@ rpcrdma_create_chunks(struct rpc_rqst *rqst, struct xdr_buf *target,
         * finish off header. If write, marshal discrim and nchunks.
         */
        if (cur_rchunk) {
-               iptr = (u32 *) cur_rchunk;
+               iptr = (__be32 *) cur_rchunk;
                *iptr++ = xdr_zero;     /* finish the read chunk list */
                *iptr++ = xdr_zero;     /* encode a NULL write chunk list */
                *iptr++ = xdr_zero;     /* encode a NULL reply chunk */
        } else {
                warray->wc_discrim = xdr_one;
                warray->wc_nchunks = htonl(nchunks);
-               iptr = (u32 *) cur_wchunk;
+               iptr = (__be32 *) cur_wchunk;
                if (type == rpcrdma_writech) {
                        *iptr++ = xdr_zero; /* finish the write chunk list */
                        *iptr++ = xdr_zero; /* encode a NULL reply chunk */
@@ -559,7 +559,7 @@ rpcrdma_marshal_req(struct rpc_rqst *rqst)
  * RDMA'd by server. See map at rpcrdma_create_chunks()! :-)
  */
 static int
-rpcrdma_count_chunks(struct rpcrdma_rep *rep, int max, int wrchunk, u32 **iptrp)
+rpcrdma_count_chunks(struct rpcrdma_rep *rep, int max, int wrchunk, __be32 **iptrp)
 {
        unsigned int i, total_len;
        struct rpcrdma_write_chunk *cur_wchunk;
@@ -573,7 +573,7 @@ rpcrdma_count_chunks(struct rpcrdma_rep *rep, int max, int wrchunk, u32 **iptrp)
                struct rpcrdma_segment *seg = &cur_wchunk->wc_target;
                ifdebug(FACILITY) {
                        u64 off;
-                       xdr_decode_hyper((u32 *)&seg->rs_offset, &off);
+                       xdr_decode_hyper((__be32 *)&seg->rs_offset, &off);
                        dprintk("RPC:       %s: chunk %d@0x%llx:0x%x\n",
                                __func__,
                                ntohl(seg->rs_length),
@@ -585,7 +585,7 @@ rpcrdma_count_chunks(struct rpcrdma_rep *rep, int max, int wrchunk, u32 **iptrp)
        }
        /* check and adjust for properly terminated write chunk */
        if (wrchunk) {
-               u32 *w = (u32 *) cur_wchunk;
+               __be32 *w = (__be32 *) cur_wchunk;
                if (*w++ != xdr_zero)
                        return -1;
                cur_wchunk = (struct rpcrdma_write_chunk *) w;
@@ -593,7 +593,7 @@ rpcrdma_count_chunks(struct rpcrdma_rep *rep, int max, int wrchunk, u32 **iptrp)
        if ((char *) cur_wchunk > rep->rr_base + rep->rr_len)
                return -1;
 
-       *iptrp = (u32 *) cur_wchunk;
+       *iptrp = (__be32 *) cur_wchunk;
        return total_len;
 }
 
@@ -721,7 +721,7 @@ rpcrdma_reply_handler(struct rpcrdma_rep *rep)
        struct rpc_rqst *rqst;
        struct rpc_xprt *xprt = rep->rr_xprt;
        struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt);
-       u32 *iptr;
+       __be32 *iptr;
        int i, rdmalen, status;
 
        /* Check status. If bad, signal disconnect and return rep to pool */
@@ -801,7 +801,7 @@ repost:
                        r_xprt->rx_stats.total_rdma_reply += rdmalen;
                } else {
                        /* else ordinary inline */
-                       iptr = (u32 *)((unsigned char *)headerp + 28);
+                       iptr = (__be32 *)((unsigned char *)headerp + 28);
                        rep->rr_len -= 28; /*sizeof *headerp;*/
                        status = rep->rr_len;
                }
@@ -816,7 +816,7 @@ repost:
                    headerp->rm_body.rm_chunks[2] != xdr_one ||
                    req->rl_nchunks == 0)
                        goto badheader;
-               iptr = (u32 *)((unsigned char *)headerp + 28);
+               iptr = (__be32 *)((unsigned char *)headerp + 28);
                rdmalen = rpcrdma_count_chunks(rep, req->rl_nchunks, 0, &iptr);
                if (rdmalen < 0)
                        goto badheader;
This page took 0.069312 seconds and 5 git commands to generate.