Skip to content

Commit 73855e1

Browse files
committed
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@linux.intel.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
1 parent d8881cd commit 73855e1

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎arch/um/drivers/ubd_kern.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "linux/kernel.h"
2323
#include "linux/module.h"
2424
#include "linux/blkdev.h"
25+
#include "linux/ata.h"
2526
#include "linux/hdreg.h"
2627
#include "linux/init.h"
2728
#include "linux/cdrom.h"
@@ -1308,16 +1309,15 @@ static int ubd_ioctl(struct block_device *bdev, fmode_t mode,
13081309
unsigned int cmd, unsigned long arg)
13091310
{
13101311
struct ubd *ubd_dev = bdev->bd_disk->private_data;
1311-
struct hd_driveid ubd_id = {
1312-
.cyls = 0,
1313-
.heads = 128,
1314-
.sectors = 32,
1315-
};
1312+
u16 ubd_id[ATA_ID_WORDS];
13161313

13171314
switch (cmd) {
13181315
struct cdrom_volctrl volume;
13191316
case HDIO_GET_IDENTITY:
1320-
ubd_id.cyls = ubd_dev->size / (128 * 32 * 512);
1317+
memset(&ubd_id, 0, ATA_ID_WORDS * 2);
1318+
ubd_id[ATA_ID_CYLS] = ubd_dev->size / (128 * 32 * 512);
1319+
ubd_id[ATA_ID_HEADS] = 128;
1320+
ubd_id[ATA_ID_SECTORS] = 32;
13211321
if(copy_to_user((char __user *) arg, (char *) &ubd_id,
13221322
sizeof(ubd_id)))
13231323
return -EFAULT;

0 commit comments

Comments
 (0)