[<prev] [next>] [day] [month] [year] [list]
Message-Id: <200807232032.31212.bzolnier@gmail.com>
Date: Wed, 23 Jul 2008 20:32:31 +0200
From: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Jeff Dike <jdike@...ux.intel.com>
Subject: [PATCH 2/4] ubd_kern: make it 'struct hd_driveid'-free
* Change ubd_id in ubd_ioctl() from 'struct hd_driveid *id'
to 'u16 *id' and update driver accordingly.
* Include <linux/ata.h> directly instead of through <linux/hdreg.h>.
There should be no functional changes caused by this patch.
Cc: Jeff Dike <jdike@...ux.intel.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
---
depends on 'ata: add missing ATA_ID_* defines (take 2)' patch
posted earlier (http://lkml.org/lkml/2008/7/22/469)
arch/um/drivers/ubd_kern.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Index: b/arch/um/drivers/ubd_kern.c
===================================================================
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -23,6 +23,7 @@
#include "linux/kernel.h"
#include "linux/module.h"
#include "linux/blkdev.h"
+#include "linux/ata.h"
#include "linux/hdreg.h"
#include "linux/init.h"
#include "linux/cdrom.h"
@@ -1310,16 +1311,15 @@ static int ubd_ioctl(struct inode * inod
unsigned int cmd, unsigned long arg)
{
struct ubd *ubd_dev = inode->i_bdev->bd_disk->private_data;
- struct hd_driveid ubd_id = {
- .cyls = 0,
- .heads = 128,
- .sectors = 32,
- };
+ u16 ubd_id[ATA_ID_WORDS];
switch (cmd) {
struct cdrom_volctrl volume;
case HDIO_GET_IDENTITY:
- ubd_id.cyls = ubd_dev->size / (128 * 32 * 512);
+ memset(&ubd_id, 0, ATA_ID_WORDS * 2);
+ ubd_id[ATA_ID_CYLS] = ubd_dev->size / (128 * 32 * 512);
+ ubd_id[ATA_ID_HEADS] = 128;
+ ubd_id[ATA_ID_SECTORS] = 32;
if(copy_to_user((char __user *) arg, (char *) &ubd_id,
sizeof(ubd_id)))
return -EFAULT;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists