diff options
author | Gideon Israel Dsouza <gidisrael@gmail.com> | 2016-12-31 10:56:23 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-01-12 11:24:39 -0500 |
commit | d8c34b949d8c9f61e099e00f22770e400adf2b76 (patch) | |
tree | 748dafb61696c949ed7c885aef4eb68610f543b4 /crypto/cts.c | |
parent | d2110224a66779fc2c833d2c16caa73e2e23591e (diff) |
crypto: Replaced gcc specific attributes with macros from compiler.h
Continuing from this commit: 52f5684c8e1e
("kernel: use macros from compiler.h instead of __attribute__((...))")
I submitted 4 total patches. They are part of task I've taken up to
increase compiler portability in the kernel. I've cleaned up the
subsystems under /kernel /mm /block and /security, this patch targets
/crypto.
There is <linux/compiler.h> which provides macros for various gcc specific
constructs. Eg: __weak for __attribute__((weak)). I've cleaned all
instances of gcc specific attributes with the right macros for the crypto
subsystem.
I had to make one additional change into compiler-gcc.h for the case when
one wants to use this: __attribute__((aligned) and not specify an alignment
factor. From the gcc docs, this will result in the largest alignment for
that data type on the target machine so I've named the macro
__aligned_largest. Please advise if another name is more appropriate.
Signed-off-by: Gideon Israel Dsouza <gidisrael@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/cts.c')
-rw-r--r-- | crypto/cts.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/cts.c b/crypto/cts.c index 00254d76b21b..a1335d6c35fb 100644 --- a/crypto/cts.c +++ b/crypto/cts.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <linux/scatterlist.h> | 49 | #include <linux/scatterlist.h> |
50 | #include <crypto/scatterwalk.h> | 50 | #include <crypto/scatterwalk.h> |
51 | #include <linux/slab.h> | 51 | #include <linux/slab.h> |
52 | #include <linux/compiler.h> | ||
52 | 53 | ||
53 | struct crypto_cts_ctx { | 54 | struct crypto_cts_ctx { |
54 | struct crypto_skcipher *child; | 55 | struct crypto_skcipher *child; |
@@ -103,7 +104,7 @@ static int cts_cbc_encrypt(struct skcipher_request *req) | |||
103 | struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); | 104 | struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); |
104 | struct skcipher_request *subreq = &rctx->subreq; | 105 | struct skcipher_request *subreq = &rctx->subreq; |
105 | int bsize = crypto_skcipher_blocksize(tfm); | 106 | int bsize = crypto_skcipher_blocksize(tfm); |
106 | u8 d[bsize * 2] __attribute__ ((aligned(__alignof__(u32)))); | 107 | u8 d[bsize * 2] __aligned(__alignof__(u32)); |
107 | struct scatterlist *sg; | 108 | struct scatterlist *sg; |
108 | unsigned int offset; | 109 | unsigned int offset; |
109 | int lastn; | 110 | int lastn; |
@@ -183,7 +184,7 @@ static int cts_cbc_decrypt(struct skcipher_request *req) | |||
183 | struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); | 184 | struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); |
184 | struct skcipher_request *subreq = &rctx->subreq; | 185 | struct skcipher_request *subreq = &rctx->subreq; |
185 | int bsize = crypto_skcipher_blocksize(tfm); | 186 | int bsize = crypto_skcipher_blocksize(tfm); |
186 | u8 d[bsize * 2] __attribute__ ((aligned(__alignof__(u32)))); | 187 | u8 d[bsize * 2] __aligned(__alignof__(u32)); |
187 | struct scatterlist *sg; | 188 | struct scatterlist *sg; |
188 | unsigned int offset; | 189 | unsigned int offset; |
189 | u8 *space; | 190 | u8 *space; |