Commit 81acbcd6 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

ecryptfs: printk warning fixes

fs/ecryptfs/keystore.c: In function 'parse_tag_1_packet':
fs/ecryptfs/keystore.c:557: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'
fs/ecryptfs/keystore.c: In function 'parse_tag_3_packet':
fs/ecryptfs/keystore.c:690: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'
fs/ecryptfs/keystore.c: In function 'parse_tag_11_packet':
fs/ecryptfs/keystore.c:836: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'
fs/ecryptfs/keystore.c: In function 'write_tag_1_packet':
fs/ecryptfs/keystore.c:1413: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'
fs/ecryptfs/keystore.c:1413: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
fs/ecryptfs/keystore.c: In function 'write_tag_11_packet':
fs/ecryptfs/keystore.c:1472: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'
fs/ecryptfs/keystore.c: In function 'write_tag_3_packet':
fs/ecryptfs/keystore.c:1663: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'
fs/ecryptfs/keystore.c:1663: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
fs/ecryptfs/keystore.c: In function 'ecryptfs_generate_key_packet_set':
fs/ecryptfs/keystore.c:1778: warning: passing argument 2 of 'write_tag_11_packet' from incompatible pointer type
fs/ecryptfs/main.c: In function 'ecryptfs_parse_options':
fs/ecryptfs/main.c:363: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'

Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ca939e79
...@@ -554,7 +554,7 @@ parse_tag_1_packet(struct ecryptfs_crypt_stat *crypt_stat, ...@@ -554,7 +554,7 @@ parse_tag_1_packet(struct ecryptfs_crypt_stat *crypt_stat,
goto out_free; goto out_free;
} }
if (unlikely(body_size < (ECRYPTFS_SIG_SIZE + 2))) { if (unlikely(body_size < (ECRYPTFS_SIG_SIZE + 2))) {
printk(KERN_WARNING "Invalid body size ([%d])\n", body_size); printk(KERN_WARNING "Invalid body size ([%td])\n", body_size);
rc = -EINVAL; rc = -EINVAL;
goto out_free; goto out_free;
} }
...@@ -687,7 +687,7 @@ parse_tag_3_packet(struct ecryptfs_crypt_stat *crypt_stat, ...@@ -687,7 +687,7 @@ parse_tag_3_packet(struct ecryptfs_crypt_stat *crypt_stat,
goto out_free; goto out_free;
} }
if (unlikely(body_size < (ECRYPTFS_SALT_SIZE + 5))) { if (unlikely(body_size < (ECRYPTFS_SALT_SIZE + 5))) {
printk(KERN_WARNING "Invalid body size ([%d])\n", body_size); printk(KERN_WARNING "Invalid body size ([%td])\n", body_size);
rc = -EINVAL; rc = -EINVAL;
goto out_free; goto out_free;
} }
...@@ -833,7 +833,7 @@ parse_tag_11_packet(unsigned char *data, unsigned char *contents, ...@@ -833,7 +833,7 @@ parse_tag_11_packet(unsigned char *data, unsigned char *contents,
goto out; goto out;
} }
if (body_size < 14) { if (body_size < 14) {
printk(KERN_WARNING "Invalid body size ([%d])\n", body_size); printk(KERN_WARNING "Invalid body size ([%td])\n", body_size);
rc = -EINVAL; rc = -EINVAL;
goto out; goto out;
} }
...@@ -1409,7 +1409,7 @@ write_tag_1_packet(char *dest, size_t *remaining_bytes, ...@@ -1409,7 +1409,7 @@ write_tag_1_packet(char *dest, size_t *remaining_bytes,
+ key_rec->enc_key_size); /* Encrypted key size */ + key_rec->enc_key_size); /* Encrypted key size */
if (max_packet_size > (*remaining_bytes)) { if (max_packet_size > (*remaining_bytes)) {
printk(KERN_ERR "Packet length larger than maximum allowable; " printk(KERN_ERR "Packet length larger than maximum allowable; "
"need up to [%d] bytes, but there are only [%d] " "need up to [%td] bytes, but there are only [%td] "
"available\n", max_packet_size, (*remaining_bytes)); "available\n", max_packet_size, (*remaining_bytes));
rc = -EINVAL; rc = -EINVAL;
goto out; goto out;
...@@ -1449,7 +1449,7 @@ write_tag_1_packet(char *dest, size_t *remaining_bytes, ...@@ -1449,7 +1449,7 @@ write_tag_1_packet(char *dest, size_t *remaining_bytes,
* Returns zero on success; non-zero on error. * Returns zero on success; non-zero on error.
*/ */
static int static int
write_tag_11_packet(char *dest, int *remaining_bytes, char *contents, write_tag_11_packet(char *dest, size_t *remaining_bytes, char *contents,
size_t contents_length, size_t *packet_length) size_t contents_length, size_t *packet_length)
{ {
size_t packet_size_length; size_t packet_size_length;
...@@ -1468,7 +1468,7 @@ write_tag_11_packet(char *dest, int *remaining_bytes, char *contents, ...@@ -1468,7 +1468,7 @@ write_tag_11_packet(char *dest, int *remaining_bytes, char *contents,
+ contents_length); /* Literal data */ + contents_length); /* Literal data */
if (max_packet_size > (*remaining_bytes)) { if (max_packet_size > (*remaining_bytes)) {
printk(KERN_ERR "Packet length larger than maximum allowable; " printk(KERN_ERR "Packet length larger than maximum allowable; "
"need up to [%d] bytes, but there are only [%d] " "need up to [%td] bytes, but there are only [%td] "
"available\n", max_packet_size, (*remaining_bytes)); "available\n", max_packet_size, (*remaining_bytes));
rc = -EINVAL; rc = -EINVAL;
goto out; goto out;
...@@ -1658,8 +1658,8 @@ write_tag_3_packet(char *dest, size_t *remaining_bytes, ...@@ -1658,8 +1658,8 @@ write_tag_3_packet(char *dest, size_t *remaining_bytes,
+ 1 /* Hash iterations */ + 1 /* Hash iterations */
+ key_rec->enc_key_size); /* Encrypted key size */ + key_rec->enc_key_size); /* Encrypted key size */
if (max_packet_size > (*remaining_bytes)) { if (max_packet_size > (*remaining_bytes)) {
printk(KERN_ERR "Packet too large; need up to [%d] bytes, but " printk(KERN_ERR "Packet too large; need up to [%td] bytes, but "
"there are only [%d] available\n", max_packet_size, "there are only [%td] available\n", max_packet_size,
(*remaining_bytes)); (*remaining_bytes));
rc = -EINVAL; rc = -EINVAL;
goto out; goto out;
......
...@@ -359,7 +359,7 @@ static int ecryptfs_parse_options(struct super_block *sb, char *options) ...@@ -359,7 +359,7 @@ static int ecryptfs_parse_options(struct super_block *sb, char *options)
NULL, mount_crypt_stat->global_default_cipher_name, NULL, mount_crypt_stat->global_default_cipher_name,
mount_crypt_stat->global_default_cipher_key_size))) { mount_crypt_stat->global_default_cipher_key_size))) {
printk(KERN_ERR "Error attempting to initialize cipher with " printk(KERN_ERR "Error attempting to initialize cipher with "
"name = [%s] and key size = [%d]; rc = [%d]\n", "name = [%s] and key size = [%td]; rc = [%d]\n",
mount_crypt_stat->global_default_cipher_name, mount_crypt_stat->global_default_cipher_name,
mount_crypt_stat->global_default_cipher_key_size, rc); mount_crypt_stat->global_default_cipher_key_size, rc);
rc = -EINVAL; rc = -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment