From 78c344f3da94f34938dcc1a95512f16a2ba6ae8f Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Tue, 25 Jul 2006 19:06:54 +0000 Subject: [PATCH] Modify PADLOCK_ALIGN() macro, so when the given address is already 16 bytes aligned, it will be used directly, not 'address + 16'. --- sys/crypto/via/padlock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/crypto/via/padlock.h b/sys/crypto/via/padlock.h index 97bb8b035bbf..9b326dd656ed 100644 --- a/sys/crypto/via/padlock.h +++ b/sys/crypto/via/padlock.h @@ -72,7 +72,7 @@ struct padlock_session { TAILQ_ENTRY(padlock_session) ses_next; }; -#define PADLOCK_ALIGN(p) (void *)((char *)(p) - ((uintptr_t)(p) % 16) + 16) +#define PADLOCK_ALIGN(p) (void *)((uintptr_t)(p) - (((uintptr_t)(p) - 1) % 16) + 15) int padlock_cipher_setup(struct padlock_session *ses, struct cryptoini *encini);