From 4a4a5c77ce795228cfaa3c08806d336309d57047 Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Fri, 3 Aug 2012 12:23:15 +1000 Subject: [PATCH] --- yaml --- r: 329723 b: refs/heads/master c: 33b58b01ac2b7aadbd5143c74b029aee0ce9ac33 h: refs/heads/master i: 329721: 8a424cae1908aa3184fc5b1f90a00f73b1c83374 329719: f3811f8373238f4a51c72382465d0cc4d5fe6f58 v: v3 --- [refs] | 2 +- trunk/drivers/crypto/nx/nx-842.c | 34 +++++++++++++++++--------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index 681f48ca215a..9e90434c400d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 023af608254add7ba037cd634cc5f2fb21ff6420 +refs/heads/master: 33b58b01ac2b7aadbd5143c74b029aee0ce9ac33 diff --git a/trunk/drivers/crypto/nx/nx-842.c b/trunk/drivers/crypto/nx/nx-842.c index 9da0fb2d3f64..0ce625738677 100644 --- a/trunk/drivers/crypto/nx/nx-842.c +++ b/trunk/drivers/crypto/nx/nx-842.c @@ -21,13 +21,15 @@ * Seth Jennings */ +#include #include -#include -#include -#include -#include #include -#include +#include +#include + +#include +#include +#include #include "nx_csbcpb.h" /* struct nx_csbcpb */ @@ -140,7 +142,7 @@ static unsigned long nx842_get_desired_dma(struct vio_dev *viodev) } struct nx842_slentry { - unsigned long ptr; /* Absolute address (use virt_to_abs()) */ + unsigned long ptr; /* Real address (use __pa()) */ unsigned long len; }; @@ -167,7 +169,7 @@ static int nx842_build_scatterlist(unsigned long buf, int len, entry = sl->entries; while (len) { - entry->ptr = virt_to_abs(buf); + entry->ptr = __pa(buf); nextpage = ALIGN(buf + 1, NX842_HW_PAGE_SIZE); if (nextpage < buf + len) { /* we aren't at the end yet */ @@ -369,8 +371,8 @@ int nx842_compress(const unsigned char *in, unsigned int inlen, op.flags = NX842_OP_COMPRESS; csbcpb = &workmem->csbcpb; memset(csbcpb, 0, sizeof(*csbcpb)); - op.csbcpb = virt_to_abs(csbcpb); - op.out = virt_to_abs(slout.entries); + op.csbcpb = __pa(csbcpb); + op.out = __pa(slout.entries); for (i = 0; i < hdr->blocks_nr; i++) { /* @@ -400,13 +402,13 @@ int nx842_compress(const unsigned char *in, unsigned int inlen, */ if (likely(max_sync_size == NX842_HW_PAGE_SIZE)) { /* Create direct DDE */ - op.in = virt_to_abs(inbuf); + op.in = __pa(inbuf); op.inlen = max_sync_size; } else { /* Create indirect DDE (scatterlist) */ nx842_build_scatterlist(inbuf, max_sync_size, &slin); - op.in = virt_to_abs(slin.entries); + op.in = __pa(slin.entries); op.inlen = -nx842_get_scatterlist_size(&slin); } @@ -564,7 +566,7 @@ int nx842_decompress(const unsigned char *in, unsigned int inlen, op.flags = NX842_OP_DECOMPRESS; csbcpb = &workmem->csbcpb; memset(csbcpb, 0, sizeof(*csbcpb)); - op.csbcpb = virt_to_abs(csbcpb); + op.csbcpb = __pa(csbcpb); /* * max_sync_size may have changed since compression, @@ -596,12 +598,12 @@ int nx842_decompress(const unsigned char *in, unsigned int inlen, if (likely((inbuf & NX842_HW_PAGE_MASK) == ((inbuf + hdr->sizes[i] - 1) & NX842_HW_PAGE_MASK))) { /* Create direct DDE */ - op.in = virt_to_abs(inbuf); + op.in = __pa(inbuf); op.inlen = hdr->sizes[i]; } else { /* Create indirect DDE (scatterlist) */ nx842_build_scatterlist(inbuf, hdr->sizes[i] , &slin); - op.in = virt_to_abs(slin.entries); + op.in = __pa(slin.entries); op.inlen = -nx842_get_scatterlist_size(&slin); } @@ -612,12 +614,12 @@ int nx842_decompress(const unsigned char *in, unsigned int inlen, */ if (likely(max_sync_size == NX842_HW_PAGE_SIZE)) { /* Create direct DDE */ - op.out = virt_to_abs(outbuf); + op.out = __pa(outbuf); op.outlen = max_sync_size; } else { /* Create indirect DDE (scatterlist) */ nx842_build_scatterlist(outbuf, max_sync_size, &slout); - op.out = virt_to_abs(slout.entries); + op.out = __pa(slout.entries); op.outlen = -nx842_get_scatterlist_size(&slout); }