From c47d63020c03659e584673f78f24f2e5de3e6b9b Mon Sep 17 00:00:00 2001 From: Dan Streetman Date: Thu, 18 Jun 2015 12:05:30 -0400 Subject: crypto: nx - add LE support to pSeries platform driver Add support to the nx-842-pseries.c driver for running in little endian mode. The pSeries platform NX 842 driver currently only works as big endian. This adds cpu_to_be*() and be*_to_cpu() in the appropriate places to work in LE mode also. Signed-off-by: Dan Streetman Signed-off-by: Herbert Xu --- drivers/crypto/nx/nx-842.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/crypto/nx/nx-842.h') diff --git a/drivers/crypto/nx/nx-842.h b/drivers/crypto/nx/nx-842.h index f6821b65b7ce..ac0ea79d0f8b 100644 --- a/drivers/crypto/nx/nx-842.h +++ b/drivers/crypto/nx/nx-842.h @@ -88,7 +88,8 @@ #define CCB_CM_EXTRA_WRITE (CCB_CM0_ALL_COMPLETIONS & CCB_CM12_STORE) #define CCB_CM_INTERRUPT (CCB_CM0_ALL_COMPLETIONS & CCB_CM12_INTERRUPT) -#define LEN_ON_PAGE(pa) (PAGE_SIZE - ((pa) & ~PAGE_MASK)) +#define LEN_ON_SIZE(pa, size) ((size) - ((pa) & ((size) - 1))) +#define LEN_ON_PAGE(pa) LEN_ON_SIZE(pa, PAGE_SIZE) static inline unsigned long nx842_get_pa(void *addr) { -- cgit v1.2.3