Skip to content

Commit 69f7599

Browse files
Linus Walleijstorulf
authored andcommitted
mmc: block: Anonymize the drv op data pointer
We have a data pointer for the ioctl() data, but we need to pass other data along with the DRV_OP:s, so make this a void * so it can be reused. Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent a814a14 commit 69f7599

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

drivers/mmc/core/block.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
596596
__GFP_RECLAIM);
597597
idatas[0] = idata;
598598
req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_IOCTL;
599-
req_to_mmc_queue_req(req)->idata = idatas;
599+
req_to_mmc_queue_req(req)->drv_op_data = idatas;
600600
req_to_mmc_queue_req(req)->ioc_count = 1;
601601
blk_execute_rq(mq->queue, NULL, req, 0);
602602
ioc_err = req_to_mmc_queue_req(req)->drv_op_result;
@@ -675,7 +675,7 @@ static int mmc_blk_ioctl_multi_cmd(struct block_device *bdev,
675675
idata[0]->ic.write_flag ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN,
676676
__GFP_RECLAIM);
677677
req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_IOCTL;
678-
req_to_mmc_queue_req(req)->idata = idata;
678+
req_to_mmc_queue_req(req)->drv_op_data = idata;
679679
req_to_mmc_queue_req(req)->ioc_count = num_of_cmds;
680680
blk_execute_rq(mq->queue, NULL, req, 0);
681681
ioc_err = req_to_mmc_queue_req(req)->drv_op_result;
@@ -1176,15 +1176,17 @@ static void mmc_blk_issue_drv_op(struct mmc_queue *mq, struct request *req)
11761176
struct mmc_queue_req *mq_rq;
11771177
struct mmc_card *card = mq->card;
11781178
struct mmc_blk_data *md = mq->blkdata;
1179+
struct mmc_blk_ioc_data **idata;
11791180
int ret;
11801181
int i;
11811182

11821183
mq_rq = req_to_mmc_queue_req(req);
11831184

11841185
switch (mq_rq->drv_op) {
11851186
case MMC_DRV_OP_IOCTL:
1187+
idata = mq_rq->drv_op_data;
11861188
for (i = 0, ret = 0; i < mq_rq->ioc_count; i++) {
1187-
ret = __mmc_blk_ioctl_cmd(card, md, mq_rq->idata[i]);
1189+
ret = __mmc_blk_ioctl_cmd(card, md, idata[i]);
11881190
if (ret)
11891191
break;
11901192
}

drivers/mmc/core/queue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct mmc_queue_req {
5151
struct mmc_async_req areq;
5252
enum mmc_drv_op drv_op;
5353
int drv_op_result;
54-
struct mmc_blk_ioc_data **idata;
54+
void *drv_op_data;
5555
unsigned int ioc_count;
5656
};
5757

0 commit comments

Comments
 (0)