aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/nx/nx-842.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/crypto/nx/nx-842.h')
-rw-r--r--drivers/crypto/nx/nx-842.h3
1 files changed, 2 insertions, 1 deletions
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)
{