cciss: factor out cciss_getintinfo
authorStephen M. Cameron <scameron@beardog.cce.hp.com>
Thu, 26 Aug 2010 18:55:39 +0000 (13:55 -0500)
committerJens Axboe <jaxboe@fusionio.com>
Fri, 10 Sep 2010 10:12:29 +0000 (12:12 +0200)
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
drivers/block/cciss.c

index 4fe5e427c4804555cd9507264ca123da5f8a1bbd..fc761404cef78f302a84dde83e6814faf3e5baff 100644 (file)
@@ -1246,6 +1246,20 @@ static int cciss_getpciinfo(ctlr_info_t *h, void __user *argp)
        return 0;
 }
 
+static int cciss_getintinfo(ctlr_info_t *h, void __user *argp)
+{
+       cciss_coalint_struct intinfo;
+
+       if (!argp)
+               return -EINVAL;
+       intinfo.delay = readl(&h->cfgtable->HostWrite.CoalIntDelay);
+       intinfo.count = readl(&h->cfgtable->HostWrite.CoalIntCount);
+       if (copy_to_user
+           (argp, &intinfo, sizeof(cciss_coalint_struct)))
+               return -EFAULT;
+       return 0;
+}
+
 static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
                       unsigned int cmd, unsigned long arg)
 {
@@ -1260,19 +1274,7 @@ static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
        case CCISS_GETPCIINFO:
                return cciss_getpciinfo(h, argp);
        case CCISS_GETINTINFO:
-               {
-                       cciss_coalint_struct intinfo;
-                       if (!arg)
-                               return -EINVAL;
-                       intinfo.delay =
-                           readl(&h->cfgtable->HostWrite.CoalIntDelay);
-                       intinfo.count =
-                           readl(&h->cfgtable->HostWrite.CoalIntCount);
-                       if (copy_to_user
-                           (argp, &intinfo, sizeof(cciss_coalint_struct)))
-                               return -EFAULT;
-                       return 0;
-               }
+               return cciss_getintinfo(h, argp);
        case CCISS_SETINTINFO:
                {
                        cciss_coalint_struct intinfo;