Skip to content

Commit 7451c54

Browse files
Hariprasad Kelamtyhicks
authored andcommitted
ecryptfs: Change return type of ecryptfs_process_flags
Change return type of ecryptfs_process_flags from int to void as it never fails. fixes below issue reported by coccicheck s/ecryptfs/crypto.c:870:5-7: Unneeded variable: "rc". Return "0" on line 883 Signed-off-by: Hariprasad Kelam <[email protected]> [tyhicks: Remove the return value line from the function documentation] Signed-off-by: Tyler Hicks <[email protected]>
1 parent c036061 commit 7451c54

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

fs/ecryptfs/crypto.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -875,13 +875,10 @@ static struct ecryptfs_flag_map_elem ecryptfs_flag_map[] = {
875875
* @crypt_stat: The cryptographic context
876876
* @page_virt: Source data to be parsed
877877
* @bytes_read: Updated with the number of bytes read
878-
*
879-
* Returns zero on success; non-zero if the flag set is invalid
880878
*/
881-
static int ecryptfs_process_flags(struct ecryptfs_crypt_stat *crypt_stat,
879+
static void ecryptfs_process_flags(struct ecryptfs_crypt_stat *crypt_stat,
882880
char *page_virt, int *bytes_read)
883881
{
884-
int rc = 0;
885882
int i;
886883
u32 flags;
887884

@@ -894,7 +891,6 @@ static int ecryptfs_process_flags(struct ecryptfs_crypt_stat *crypt_stat,
894891
/* Version is in top 8 bits of the 32-bit flag vector */
895892
crypt_stat->file_version = ((flags >> 24) & 0xFF);
896893
(*bytes_read) = 4;
897-
return rc;
898894
}
899895

900896
/**
@@ -1320,12 +1316,7 @@ static int ecryptfs_read_headers_virt(char *page_virt,
13201316
if (!(crypt_stat->flags & ECRYPTFS_I_SIZE_INITIALIZED))
13211317
ecryptfs_i_size_init(page_virt, d_inode(ecryptfs_dentry));
13221318
offset += MAGIC_ECRYPTFS_MARKER_SIZE_BYTES;
1323-
rc = ecryptfs_process_flags(crypt_stat, (page_virt + offset),
1324-
&bytes_read);
1325-
if (rc) {
1326-
ecryptfs_printk(KERN_WARNING, "Error processing flags\n");
1327-
goto out;
1328-
}
1319+
ecryptfs_process_flags(crypt_stat, (page_virt + offset), &bytes_read);
13291320
if (crypt_stat->file_version > ECRYPTFS_SUPPORTED_FILE_VERSION) {
13301321
ecryptfs_printk(KERN_WARNING, "File version is [%d]; only "
13311322
"file version [%d] is supported by this "

0 commit comments

Comments
 (0)