Commit efa402d5 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by Bartlomiej Zolnierkiewicz

ide-cd: use the new object_is_in_stack() helper

Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Borislav Petkov <petkovbb@gmail.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 1a7809e3
...@@ -1164,13 +1164,12 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq) ...@@ -1164,13 +1164,12 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
if (rq->bio || ((rq->cmd_type == REQ_TYPE_ATA_PC) && rq->data_len)) { if (rq->bio || ((rq->cmd_type == REQ_TYPE_ATA_PC) && rq->data_len)) {
struct request_queue *q = drive->queue; struct request_queue *q = drive->queue;
unsigned int alignment; unsigned int alignment;
unsigned long addr; char *buf;
unsigned long stack_mask = ~(THREAD_SIZE - 1);
if (rq->bio) if (rq->bio)
addr = (unsigned long)bio_data(rq->bio); buf = bio_data(rq->bio);
else else
addr = (unsigned long)rq->data; buf = rq->data;
info->dma = drive->using_dma; info->dma = drive->using_dma;
...@@ -1181,11 +1180,8 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq) ...@@ -1181,11 +1180,8 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
* separate masks. * separate masks.
*/ */
alignment = queue_dma_alignment(q) | q->dma_pad_mask; alignment = queue_dma_alignment(q) | q->dma_pad_mask;
if (addr & alignment || rq->data_len & alignment) if ((unsigned long)buf & alignment || rq->data_len & alignment
info->dma = 0; || object_is_on_stack(buf))
if (!((addr & stack_mask) ^
((unsigned long)current->stack & stack_mask)))
info->dma = 0; info->dma = 0;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment