]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/staging/ccree/cc_crypto_ctx.h
staging: ccree: replace bit shift with BIT macro
[karo-tx-linux.git] / drivers / staging / ccree / cc_crypto_ctx.h
index e9023bd6507c169e9ba8545e0293b777156d5245..20f3f9fa0b56c274dbf388fcf287780a1c282d3f 100644 (file)
@@ -27,7 +27,7 @@
 #define CC_CTX_SIZE_LOG2 7
 #endif
 #endif
-#define CC_CTX_SIZE (1 << CC_CTX_SIZE_LOG2)
+#define CC_CTX_SIZE BIT(CC_CTX_SIZE_LOG2)
 #define CC_DRV_CTX_SIZE_WORDS (CC_CTX_SIZE >> 2)
 
 #define CC_DRV_DES_IV_SIZE 8
@@ -84,7 +84,8 @@
 
 #define CC_MULTI2_SYSTEM_KEY_SIZE              32
 #define CC_MULTI2_DATA_KEY_SIZE                8
-#define CC_MULTI2_SYSTEM_N_DATA_KEY_SIZE       (CC_MULTI2_SYSTEM_KEY_SIZE + CC_MULTI2_DATA_KEY_SIZE)
+#define CC_MULTI2_SYSTEM_N_DATA_KEY_SIZE \
+               (CC_MULTI2_SYSTEM_KEY_SIZE + CC_MULTI2_DATA_KEY_SIZE)
 #define        CC_MULTI2_BLOCK_SIZE                                    8
 #define        CC_MULTI2_IV_SIZE                                       8
 #define        CC_MULTI2_MIN_NUM_ROUNDS                                8
@@ -213,8 +214,9 @@ struct drv_ctx_hash {
                        CC_DIGEST_SIZE_MAX];
 };
 
-/* !!!! drv_ctx_hmac should have the same structure as drv_ctx_hash except
-   k0, k0_size fields */
+/* NOTE! drv_ctx_hmac should have the same structure as drv_ctx_hash except
+ * k0, k0_size fields
+ */
 struct drv_ctx_hmac {
        enum drv_crypto_alg alg; /* DRV_CRYPTO_ALG_HMAC */
        enum drv_hash_mode mode;
@@ -235,9 +237,10 @@ struct drv_ctx_cipher {
        u32 key_size; /* numeric value in bytes   */
        u32 data_unit_size; /* required for XTS */
        /* block_state is the AES engine block state.
-       *  It is used by the host to pass IV or counter at initialization.
-       *  It is used by SeP for intermediate block chaining state and for
-       *  returning MAC algorithms results.           */
+        * It is used by the host to pass IV or counter at initialization.
+        * It is used by SeP for intermediate block chaining state and for
+        * returning MAC algorithms results.
+        */
        u8 block_state[CC_AES_BLOCK_SIZE];
        u8 key[CC_AES_KEY_SIZE_MAX];
        u8 xex_key[CC_AES_KEY_SIZE_MAX];
@@ -273,10 +276,11 @@ struct drv_ctx_aead {
 /*******************************************************************/
 
 /* Get the address of a @member within a given @ctx address
-   @ctx: The context address
-   @type: Type of context structure
-   @member: Associated context field */
-#define GET_CTX_FIELD_ADDR(ctx, type, member) (ctx + offsetof(type, member))
+ * @ctx: The context address
+ * @type: Type of context structure
+ * @member: Associated context field
+ */
+#define GET_CTX_FIELD_ADDR(ctx, type, member) ((ctx) + offsetof(type, member))
 
 #endif /* _CC_CRYPTO_CTX_H_ */