aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2012-08-02 22:23:15 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2012-08-20 04:28:12 -0400
commit33b58b01ac2b7aadbd5143c74b029aee0ce9ac33 (patch)
treed8753c31600bf01cf9d452eba3a9d0a128ba3989
parent023af608254add7ba037cd634cc5f2fb21ff6420 (diff)
crypto: nx - Remove virt_to_abs() usage in nx-842.c
virt_to_abs() is just a wrapper around __pa(), use __pa() directly. We should be including <asm/page.h> to get __pa(). abs_addr.h will be removed shortly so drop that. We were getting of.h via abs_addr.h so we need to include that directly. Having done all that, clean up the ordering of the includes. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Acked-by: Seth Jennings <sjenning@linux.vnet.ibm.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/nx/nx-842.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/drivers/crypto/nx/nx-842.c b/drivers/crypto/nx/nx-842.c
index 9da0fb2d3f64..0ce625738677 100644
--- a/drivers/crypto/nx/nx-842.c
+++ b/drivers/crypto/nx/nx-842.c
@@ -21,13 +21,15 @@
21 * Seth Jennings <sjenning@linux.vnet.ibm.com> 21 * Seth Jennings <sjenning@linux.vnet.ibm.com>
22 */ 22 */
23 23
24#include <linux/kernel.h>
24#include <linux/module.h> 25#include <linux/module.h>
25#include <asm/vio.h>
26#include <asm/pSeries_reconfig.h>
27#include <linux/slab.h>
28#include <asm/abs_addr.h>
29#include <linux/nx842.h> 26#include <linux/nx842.h>
30#include <linux/kernel.h> 27#include <linux/of.h>
28#include <linux/slab.h>
29
30#include <asm/page.h>
31#include <asm/pSeries_reconfig.h>
32#include <asm/vio.h>
31 33
32#include "nx_csbcpb.h" /* struct nx_csbcpb */ 34#include "nx_csbcpb.h" /* struct nx_csbcpb */
33 35
@@ -140,7 +142,7 @@ static unsigned long nx842_get_desired_dma(struct vio_dev *viodev)
140} 142}
141 143
142struct nx842_slentry { 144struct nx842_slentry {
143 unsigned long ptr; /* Absolute address (use virt_to_abs()) */ 145 unsigned long ptr; /* Real address (use __pa()) */
144 unsigned long len; 146 unsigned long len;
145}; 147};
146 148
@@ -167,7 +169,7 @@ static int nx842_build_scatterlist(unsigned long buf, int len,
167 169
168 entry = sl->entries; 170 entry = sl->entries;
169 while (len) { 171 while (len) {
170 entry->ptr = virt_to_abs(buf); 172 entry->ptr = __pa(buf);
171 nextpage = ALIGN(buf + 1, NX842_HW_PAGE_SIZE); 173 nextpage = ALIGN(buf + 1, NX842_HW_PAGE_SIZE);
172 if (nextpage < buf + len) { 174 if (nextpage < buf + len) {
173 /* we aren't at the end yet */ 175 /* we aren't at the end yet */
@@ -369,8 +371,8 @@ int nx842_compress(const unsigned char *in, unsigned int inlen,
369 op.flags = NX842_OP_COMPRESS; 371 op.flags = NX842_OP_COMPRESS;
370 csbcpb = &workmem->csbcpb; 372 csbcpb = &workmem->csbcpb;
371 memset(csbcpb, 0, sizeof(*csbcpb)); 373 memset(csbcpb, 0, sizeof(*csbcpb));
372 op.csbcpb = virt_to_abs(csbcpb); 374 op.csbcpb = __pa(csbcpb);
373 op.out = virt_to_abs(slout.entries); 375 op.out = __pa(slout.entries);
374 376
375 for (i = 0; i < hdr->blocks_nr; i++) { 377 for (i = 0; i < hdr->blocks_nr; i++) {
376 /* 378 /*
@@ -400,13 +402,13 @@ int nx842_compress(const unsigned char *in, unsigned int inlen,
400 */ 402 */
401 if (likely(max_sync_size == NX842_HW_PAGE_SIZE)) { 403 if (likely(max_sync_size == NX842_HW_PAGE_SIZE)) {
402 /* Create direct DDE */ 404 /* Create direct DDE */
403 op.in = virt_to_abs(inbuf); 405 op.in = __pa(inbuf);
404 op.inlen = max_sync_size; 406 op.inlen = max_sync_size;
405 407
406 } else { 408 } else {
407 /* Create indirect DDE (scatterlist) */ 409 /* Create indirect DDE (scatterlist) */
408 nx842_build_scatterlist(inbuf, max_sync_size, &slin); 410 nx842_build_scatterlist(inbuf, max_sync_size, &slin);
409 op.in = virt_to_abs(slin.entries); 411 op.in = __pa(slin.entries);
410 op.inlen = -nx842_get_scatterlist_size(&slin); 412 op.inlen = -nx842_get_scatterlist_size(&slin);
411 } 413 }
412 414
@@ -564,7 +566,7 @@ int nx842_decompress(const unsigned char *in, unsigned int inlen,
564 op.flags = NX842_OP_DECOMPRESS; 566 op.flags = NX842_OP_DECOMPRESS;
565 csbcpb = &workmem->csbcpb; 567 csbcpb = &workmem->csbcpb;
566 memset(csbcpb, 0, sizeof(*csbcpb)); 568 memset(csbcpb, 0, sizeof(*csbcpb));
567 op.csbcpb = virt_to_abs(csbcpb); 569 op.csbcpb = __pa(csbcpb);
568 570
569 /* 571 /*
570 * max_sync_size may have changed since compression, 572 * max_sync_size may have changed since compression,
@@ -596,12 +598,12 @@ int nx842_decompress(const unsigned char *in, unsigned int inlen,
596 if (likely((inbuf & NX842_HW_PAGE_MASK) == 598 if (likely((inbuf & NX842_HW_PAGE_MASK) ==
597 ((inbuf + hdr->sizes[i] - 1) & NX842_HW_PAGE_MASK))) { 599 ((inbuf + hdr->sizes[i] - 1) & NX842_HW_PAGE_MASK))) {
598 /* Create direct DDE */ 600 /* Create direct DDE */
599 op.in = virt_to_abs(inbuf); 601 op.in = __pa(inbuf);
600 op.inlen = hdr->sizes[i]; 602 op.inlen = hdr->sizes[i];
601 } else { 603 } else {
602 /* Create indirect DDE (scatterlist) */ 604 /* Create indirect DDE (scatterlist) */
603 nx842_build_scatterlist(inbuf, hdr->sizes[i] , &slin); 605 nx842_build_scatterlist(inbuf, hdr->sizes[i] , &slin);
604 op.in = virt_to_abs(slin.entries); 606 op.in = __pa(slin.entries);
605 op.inlen = -nx842_get_scatterlist_size(&slin); 607 op.inlen = -nx842_get_scatterlist_size(&slin);
606 } 608 }
607 609
@@ -612,12 +614,12 @@ int nx842_decompress(const unsigned char *in, unsigned int inlen,
612 */ 614 */
613 if (likely(max_sync_size == NX842_HW_PAGE_SIZE)) { 615 if (likely(max_sync_size == NX842_HW_PAGE_SIZE)) {
614 /* Create direct DDE */ 616 /* Create direct DDE */
615 op.out = virt_to_abs(outbuf); 617 op.out = __pa(outbuf);
616 op.outlen = max_sync_size; 618 op.outlen = max_sync_size;
617 } else { 619 } else {
618 /* Create indirect DDE (scatterlist) */ 620 /* Create indirect DDE (scatterlist) */
619 nx842_build_scatterlist(outbuf, max_sync_size, &slout); 621 nx842_build_scatterlist(outbuf, max_sync_size, &slout);
620 op.out = virt_to_abs(slout.entries); 622 op.out = __pa(slout.entries);
621 op.outlen = -nx842_get_scatterlist_size(&slout); 623 op.outlen = -nx842_get_scatterlist_size(&slout);
622 } 624 }
623 625