From 1123b02c901849c3b24cc173971463a51bcb1732 Mon Sep 17 00:00:00 2001 From: "Stephen M. Cameron" Date: Thu, 26 Aug 2010 13:56:10 -0500 Subject: [PATCH] --- yaml --- r: 213083 b: refs/heads/master c: 8a4f7fbfdd76a304c8f04dde6b8fd0e5c50bbe76 h: refs/heads/master i: 213081: 2ef4ef771227d8c9a9743a2cbe07e3925b5816a5 213079: c16c3e14c5429b9d6bd47952c47e5256164c6e02 v: v3 --- [refs] | 2 +- trunk/drivers/block/cciss.c | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index ba6a7df3126e..b5bd95303c25 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d18dfad4e2bf6c2d2c5c104d882b14b9fee71b14 +refs/heads/master: 8a4f7fbfdd76a304c8f04dde6b8fd0e5c50bbe76 diff --git a/trunk/drivers/block/cciss.c b/trunk/drivers/block/cciss.c index e7b650b7f548..c47e601f601c 100644 --- a/trunk/drivers/block/cciss.c +++ b/trunk/drivers/block/cciss.c @@ -1357,6 +1357,20 @@ static int cciss_getbustypes(ctlr_info_t *h, void __user *argp) return 0; } +static int cciss_getfirmver(ctlr_info_t *h, void __user *argp) +{ + FirmwareVer_type firmware; + + if (!argp) + return -EINVAL; + memcpy(firmware, h->firm_ver, 4); + + if (copy_to_user + (argp, firmware, sizeof(FirmwareVer_type))) + return -EFAULT; + return 0; +} + static int cciss_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg) { @@ -1383,18 +1397,7 @@ static int cciss_ioctl(struct block_device *bdev, fmode_t mode, case CCISS_GETBUSTYPES: return cciss_getbustypes(h, argp); case CCISS_GETFIRMVER: - { - FirmwareVer_type firmware; - - if (!arg) - return -EINVAL; - memcpy(firmware, h->firm_ver, 4); - - if (copy_to_user - (argp, firmware, sizeof(FirmwareVer_type))) - return -EFAULT; - return 0; - } + return cciss_getfirmver(h, argp); case CCISS_GETDRIVVER: { DriverVer_type DriverVer = DRIVER_VERSION;