* [PATCH 1/1 linux-next] mmc: omap: use for_each_sg() for scatterlist parsing
@ 2015-06-16 19:15 Fabian Frederick
2015-07-20 14:20 ` Ulf Hansson
0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2015-06-16 19:15 UTC (permalink / raw)
To: linux-kernel
Cc: Fabian Frederick, Jarkko Lavinen, Ulf Hansson, linux-omap,
linux-mmc
See Documentation/DMA-API.txt - Part Id
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
This is untested.
drivers/mmc/host/omap.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 68dd6c7..70dcf07 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -948,6 +948,7 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req)
{
struct mmc_data *data = req->data;
int i, use_dma = 1, block_size;
+ struct scatterlist *sg;
unsigned sg_len;
host->data = data;
@@ -972,8 +973,8 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req)
sg_len = (data->blocks == 1) ? 1 : data->sg_len;
/* Only do DMA for entire blocks */
- for (i = 0; i < sg_len; i++) {
- if ((data->sg[i].length % block_size) != 0) {
+ for_each_sg(data->sg, sg, sg_len, i) {
+ if ((sg->length % block_size) != 0) {
use_dma = 0;
break;
}
--
2.4.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1 linux-next] mmc: omap: use for_each_sg() for scatterlist parsing
2015-06-16 19:15 [PATCH 1/1 linux-next] mmc: omap: use for_each_sg() for scatterlist parsing Fabian Frederick
@ 2015-07-20 14:20 ` Ulf Hansson
0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2015-07-20 14:20 UTC (permalink / raw)
To: Fabian Frederick
Cc: linux-kernel@vger.kernel.org, Jarkko Lavinen, linux-omap,
linux-mmc
On 16 June 2015 at 21:15, Fabian Frederick <fabf@skynet.be> wrote:
> See Documentation/DMA-API.txt - Part Id
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Thanks, applied!
Kind regards
Uffe
> ---
> This is untested.
>
> drivers/mmc/host/omap.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
> index 68dd6c7..70dcf07 100644
> --- a/drivers/mmc/host/omap.c
> +++ b/drivers/mmc/host/omap.c
> @@ -948,6 +948,7 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req)
> {
> struct mmc_data *data = req->data;
> int i, use_dma = 1, block_size;
> + struct scatterlist *sg;
> unsigned sg_len;
>
> host->data = data;
> @@ -972,8 +973,8 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req)
> sg_len = (data->blocks == 1) ? 1 : data->sg_len;
>
> /* Only do DMA for entire blocks */
> - for (i = 0; i < sg_len; i++) {
> - if ((data->sg[i].length % block_size) != 0) {
> + for_each_sg(data->sg, sg, sg_len, i) {
> + if ((sg->length % block_size) != 0) {
> use_dma = 0;
> break;
> }
> --
> 2.4.2
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-20 14:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-16 19:15 [PATCH 1/1 linux-next] mmc: omap: use for_each_sg() for scatterlist parsing Fabian Frederick
2015-07-20 14:20 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).