public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/4] ubd_kern: make it 'struct hd_driveid'-free
@ 2008-07-23 18:32 Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; only message in thread
From: Bartlomiej Zolnierkiewicz @ 2008-07-23 18:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jeff Dike

* 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@linux.intel.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-23 18:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-23 18:32 [PATCH 2/4] ubd_kern: make it 'struct hd_driveid'-free Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox