[PATCH 02/13] cciss: factor out cciss_getintinfo

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Stephen M. Cameron
Date: Thursday, August 26, 2010 - 11:55 am

From: Stephen M. Cameron <scameron@beardog.cce.hp.com>

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
---
 drivers/block/cciss.c |   28 +++++++++++++++-------------
 1 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index c1eca37..14380c4 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1248,6 +1248,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)
 {
@@ -1262,19 +1276,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;

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/13] cciss: clean up cciss_ioctl(), Stephen M. Cameron, (Thu Aug 26, 11:55 am)
[PATCH 01/13] cciss: factor out cciss_getpciinfo, Stephen M. Cameron, (Thu Aug 26, 11:55 am)
[PATCH 02/13] cciss: factor out cciss_getintinfo, Stephen M. Cameron, (Thu Aug 26, 11:55 am)
[PATCH 03/13] cciss: factor out cciss_setintinfo, Stephen M. Cameron, (Thu Aug 26, 11:55 am)
[PATCH 04/13] cciss: factor out cciss_getnodename, Stephen M. Cameron, (Thu Aug 26, 11:55 am)
[PATCH 05/13] cciss: factor out cciss_setnodename, Stephen M. Cameron, (Thu Aug 26, 11:55 am)
[PATCH 06/13] cciss: factor out cciss_getheartbeat, Stephen M. Cameron, (Thu Aug 26, 11:55 am)
[PATCH 07/13] cciss: factor out cciss_getbustypes, Stephen M. Cameron, (Thu Aug 26, 11:56 am)
[PATCH 08/13] cciss: factor out cciss_getfirmver, Stephen M. Cameron, (Thu Aug 26, 11:56 am)
[PATCH 09/13] cciss: factor out cciss_getdrivver, Stephen M. Cameron, (Thu Aug 26, 11:56 am)
[PATCH 10/13] cciss: factor out cciss_getluninfo, Stephen M. Cameron, (Thu Aug 26, 11:56 am)
[PATCH 11/13] cciss: factor out cciss_passthru, Stephen M. Cameron, (Thu Aug 26, 11:56 am)
[PATCH 12/13] cciss: factor out cciss_big_passthru, Stephen M. Cameron, (Thu Aug 26, 11:56 am)
[PATCH 13/13] cciss: remove some superfluous tests from cc ..., Stephen M. Cameron, (Thu Aug 26, 11:56 am)
Re: [PATCH 00/13] cciss: clean up cciss_ioctl(), Jens Axboe, (Fri Sep 10, 3:13 am)