From patchwork Thu Jun 8 08:53:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9774225 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6965D60350 for ; Thu, 8 Jun 2017 08:54:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5770328536 for ; Thu, 8 Jun 2017 08:54:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C4C428548; Thu, 8 Jun 2017 08:54:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E978B28536 for ; Thu, 8 Jun 2017 08:54:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751835AbdFHIyR (ORCPT ); Thu, 8 Jun 2017 04:54:17 -0400 Received: from mail-lf0-f48.google.com ([209.85.215.48]:35274 "EHLO mail-lf0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751825AbdFHIyQ (ORCPT ); Thu, 8 Jun 2017 04:54:16 -0400 Received: by mail-lf0-f48.google.com with SMTP id p189so15242591lfe.2 for ; Thu, 08 Jun 2017 01:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WN3g4G88XruYuHJ30jQQ5zCB7Z/GZ5CsckYopLkcYjI=; b=f6a+ieh7fDuQQl6AS2NKpJXuzkqTUBwsb+50XKQ414EDcAeiUXO8lpW2wSHE4w8IiW Up6G6ZKm86eY9pDPh1XdVf5kxDACYw9kiRmZZ8X3U8kk/Nnhyl3faYppTLnnH06CPZ9O A8geoslz7XF6V6dJjrIeEf9pM71hm0n5iucOg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WN3g4G88XruYuHJ30jQQ5zCB7Z/GZ5CsckYopLkcYjI=; b=BdcH5eOHJ/CrIi5/a81f2GoIZe2Aq3G7fTYu8xsgbt6kuZ1xeG9sd7LhC7e36GhyYT qqvGR8EDCO2BMvgHRpQVxRnXAqGeVZMJJRUJ2WASeEq/FtJuZD3oBEMcZG+zPHPbe2ZA aX1EiaN1lZM++FMFNkAzJMmISXqAgjTWA5UPC3Log2VYRWTWczpdwdLOYmN5AMQgqX2k Txv75i+ZQvEd6kb17AJsZuOdQltwtGlMy/rZTpqqM6SomGSlNZRA5XP40q28ksYWQPrT zeNbPZj5mNjA3OQrPT1rg2Y7mS/RUXK92HYXfXhj392hAFLP8wzV1x+Z+eOFLCpopLIK MRag== X-Gm-Message-State: AODbwcCwcrovvcC4DqsrBQKkVdXXaeCEmQ1Tjvgy6Rfpb/Dl0K+CqfyK 889Qdp8NrPglHfm0Qg9MEg== X-Received: by 10.46.87.13 with SMTP id l13mr8717573ljb.1.1496912054721; Thu, 08 Jun 2017 01:54:14 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id n71sm878356lje.14.2017.06.08.01.54.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 01:54:13 -0700 (PDT) From: Linus Walleij To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter Cc: Linus Walleij Subject: [PATCH 1/6 v3] mmc: block: Anonymize the drv op data pointer Date: Thu, 8 Jun 2017 10:53:58 +0200 Message-Id: <20170608085403.11795-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170608085403.11795-1-linus.walleij@linaro.org> References: <20170608085403.11795-1-linus.walleij@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- ChangeLog v2->v3: - No changes just resending --- drivers/mmc/core/block.c | 8 +++++--- drivers/mmc/core/queue.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 64f9fda92229..7a365d7641b5 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -598,7 +598,7 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev, __GFP_RECLAIM); idatas[0] = idata; req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_IOCTL; - req_to_mmc_queue_req(req)->idata = idatas; + req_to_mmc_queue_req(req)->drv_op_data = idatas; req_to_mmc_queue_req(req)->ioc_count = 1; blk_execute_rq(mq->queue, NULL, req, 0); ioc_err = req_to_mmc_queue_req(req)->drv_op_result; @@ -674,7 +674,7 @@ static int mmc_blk_ioctl_multi_cmd(struct block_device *bdev, idata[0]->ic.write_flag ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN, __GFP_RECLAIM); req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_IOCTL; - req_to_mmc_queue_req(req)->idata = idata; + req_to_mmc_queue_req(req)->drv_op_data = idata; req_to_mmc_queue_req(req)->ioc_count = num_of_cmds; blk_execute_rq(mq->queue, NULL, req, 0); ioc_err = req_to_mmc_queue_req(req)->drv_op_result; @@ -1175,6 +1175,7 @@ static void mmc_blk_issue_drv_op(struct mmc_queue *mq, struct request *req) struct mmc_queue_req *mq_rq; struct mmc_card *card = mq->card; struct mmc_blk_data *md = mq->blkdata; + struct mmc_blk_ioc_data **idata; int ret; int i; @@ -1182,8 +1183,9 @@ static void mmc_blk_issue_drv_op(struct mmc_queue *mq, struct request *req) switch (mq_rq->drv_op) { case MMC_DRV_OP_IOCTL: + idata = mq_rq->drv_op_data; for (i = 0; i < mq_rq->ioc_count; i++) { - ret = __mmc_blk_ioctl_cmd(card, md, mq_rq->idata[i]); + ret = __mmc_blk_ioctl_cmd(card, md, idata[i]); if (ret) break; } diff --git a/drivers/mmc/core/queue.h b/drivers/mmc/core/queue.h index 361b46408e0f..cf26a15a64bf 100644 --- a/drivers/mmc/core/queue.h +++ b/drivers/mmc/core/queue.h @@ -51,7 +51,7 @@ struct mmc_queue_req { struct mmc_async_req areq; enum mmc_drv_op drv_op; int drv_op_result; - struct mmc_blk_ioc_data **idata; + void *drv_op_data; unsigned int ioc_count; };