linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Valdis Kletnieks <valdis.kletnieks@vt.edu>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>,
	Valdis Kletnieks <valdis.kletnieks@vt.edu>,
	linux-fsdevel@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 13/15] staging: exfat: Clean up return codes - FFS_ERROR
Date: Thu, 24 Oct 2019 11:53:24 -0400	[thread overview]
Message-ID: <20191024155327.1095907-14-Valdis.Kletnieks@vt.edu> (raw)
In-Reply-To: <20191024155327.1095907-1-Valdis.Kletnieks@vt.edu>

Convert FFS_ERROR to -EINVAL

Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
---
 drivers/staging/exfat/exfat.h       |  1 -
 drivers/staging/exfat/exfat_core.c  |  8 ++++----
 drivers/staging/exfat/exfat_super.c | 20 ++++++++++----------
 3 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h
index 505751bf1817..2ca2710601ae 100644
--- a/drivers/staging/exfat/exfat.h
+++ b/drivers/staging/exfat/exfat.h
@@ -216,7 +216,6 @@ static inline u16 get_row_index(u16 i)
 #define FFS_SEMAPHOREERR        6
 #define FFS_NOTOPENED           12
 #define FFS_MAXOPENED           13
-#define FFS_ERROR               19
 
 #define NUM_UPCASE              2918
 
diff --git a/drivers/staging/exfat/exfat_core.c b/drivers/staging/exfat/exfat_core.c
index 7e637a8e19d3..7efc5d08cada 100644
--- a/drivers/staging/exfat/exfat_core.c
+++ b/drivers/staging/exfat/exfat_core.c
@@ -587,7 +587,7 @@ void exfat_chain_cont_cluster(struct super_block *sb, u32 chain, s32 len)
 static s32 __load_upcase_table(struct super_block *sb, sector_t sector,
 			       u32 num_sectors, u32 utbl_checksum)
 {
-	int i, ret = FFS_ERROR;
+	int i, ret = -EINVAL;
 	u32 j;
 	struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info);
 	struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info);
@@ -662,7 +662,7 @@ static s32 __load_upcase_table(struct super_block *sb, sector_t sector,
 			brelse(tmp_bh);
 		return FFS_SUCCESS;
 	}
-	ret = FFS_ERROR;
+	ret = -EINVAL;
 error:
 	if (tmp_bh)
 		brelse(tmp_bh);
@@ -672,7 +672,7 @@ static s32 __load_upcase_table(struct super_block *sb, sector_t sector,
 
 static s32 __load_default_upcase_table(struct super_block *sb)
 {
-	int i, ret = FFS_ERROR;
+	int i, ret = -EINVAL;
 	u32 j;
 	struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info);
 
@@ -847,7 +847,7 @@ static s32 __write_partial_entries_in_entry_set(struct super_block *sb,
 	return FFS_SUCCESS;
 err_out:
 	pr_debug("%s failed\n", __func__);
-	return FFS_ERROR;
+	return -EINVAL;
 }
 
 /* write back all entries in entry set */
diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c
index 485297974ae7..0ce27a6babee 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -492,7 +492,7 @@ static int ffsGetVolInfo(struct super_block *sb, struct vol_info_t *info)
 
 	/* check the validity of pointer parameters */
 	if (!info)
-		return FFS_ERROR;
+		return -EINVAL;
 
 	/* acquire the lock for file system critical section */
 	down(&p_fs->v_sem);
@@ -555,7 +555,7 @@ static int ffsLookupFile(struct inode *inode, char *path, struct file_id_t *fid)
 
 	/* check the validity of pointer parameters */
 	if (!fid || !path || (*path == '\0'))
-		return FFS_ERROR;
+		return -EINVAL;
 
 	/* acquire the lock for file system critical section */
 	down(&p_fs->v_sem);
@@ -648,7 +648,7 @@ static int ffsCreateFile(struct inode *inode, char *path, u8 mode,
 
 	/* check the validity of pointer parameters */
 	if (!fid || !path || (*path == '\0'))
-		return FFS_ERROR;
+		return -EINVAL;
 
 	/* acquire the lock for file system critical section */
 	down(&p_fs->v_sem);
@@ -697,7 +697,7 @@ static int ffsReadFile(struct inode *inode, struct file_id_t *fid, void *buffer,
 
 	/* check the validity of pointer parameters */
 	if (!buffer)
-		return FFS_ERROR;
+		return -EINVAL;
 
 	/* acquire the lock for file system critical section */
 	down(&p_fs->v_sem);
@@ -827,7 +827,7 @@ static int ffsWriteFile(struct inode *inode, struct file_id_t *fid,
 
 	/* check the validity of pointer parameters */
 	if (!buffer)
-		return FFS_ERROR;
+		return -EINVAL;
 
 	/* acquire the lock for file system critical section */
 	down(&p_fs->v_sem);
@@ -1232,7 +1232,7 @@ static int ffsMoveFile(struct inode *old_parent_inode, struct file_id_t *fid,
 
 	/* check the validity of pointer parameters */
 	if (!new_path || (*new_path == '\0'))
-		return FFS_ERROR;
+		return -EINVAL;
 
 	/* acquire the lock for file system critical section */
 	down(&p_fs->v_sem);
@@ -1455,7 +1455,7 @@ static int ffsSetAttr(struct inode *inode, u32 attr)
 		if (p_fs->dev_ejected)
 			ret = -EIO;
 		else
-			ret = FFS_ERROR;
+			ret = -EINVAL;
 
 		if (p_fs->vol_type == EXFAT)
 			release_entry_set(es);
@@ -1747,7 +1747,7 @@ static int ffsMapCluster(struct inode *inode, s32 clu_offset, u32 *clu)
 
 	/* check the validity of pointer parameters */
 	if (!clu)
-		return FFS_ERROR;
+		return -EINVAL;
 
 	/* acquire the lock for file system critical section */
 	down(&p_fs->v_sem);
@@ -1899,7 +1899,7 @@ static int ffsCreateDir(struct inode *inode, char *path, struct file_id_t *fid)
 
 	/* check the validity of pointer parameters */
 	if (!fid || !path || (*path == '\0'))
-		return FFS_ERROR;
+		return -EINVAL;
 
 	/* acquire the lock for file system critical section */
 	down(&p_fs->v_sem);
@@ -1945,7 +1945,7 @@ static int ffsReadDir(struct inode *inode, struct dir_entry_t *dir_entry)
 
 	/* check the validity of pointer parameters */
 	if (!dir_entry)
-		return FFS_ERROR;
+		return -EINVAL;
 
 	/* check if the given file ID is opened */
 	if (fid->type != TYPE_DIR)
-- 
2.23.0


  parent reply	other threads:[~2019-10-24 15:55 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24 15:53 [PATCH 00/15] staging: exfat: Clean up return codes Valdis Kletnieks
2019-10-24 15:53 ` [PATCH 01/15] staging: exfat: Clean up return codes - FFS_FULL Valdis Kletnieks
2019-10-24 17:59   ` Matthew Wilcox
2019-10-24 18:39     ` Valdis Klētnieks
2019-10-24 15:53 ` [PATCH 02/15] staging: exfat: Clean up return codes - FFS_NOTFOUND Valdis Kletnieks
2019-10-24 15:53 ` [PATCH 03/15] staging: exfat: Clean up return codes - FFS_DIRBUSY Valdis Kletnieks
2019-10-24 15:53 ` [PATCH 04/15] staging: exfat: Clean up return codes - FFS_PERMISSIONERR Valdis Kletnieks
2019-10-24 16:23   ` Joe Perches
2019-10-24 16:27     ` Valdis Klētnieks
2019-10-25 10:14       ` Dan Carpenter
2019-10-24 15:53 ` [PATCH 05/15] staging: exfat: Clean up return codes - FFS_NAMETOOLONG Valdis Kletnieks
2019-10-24 15:53 ` [PATCH 06/15] staging: exfat: Clean up return codes - FFS_FILEEXIST Valdis Kletnieks
2019-10-24 15:53 ` [PATCH 07/15] staging: exfat: Clean up return codes - FFS_INVALIDPATH Valdis Kletnieks
2019-10-24 15:53 ` [PATCH 08/15] staging: exfat: Clean up return code - FFS_MEMORYERR Valdis Kletnieks
2019-10-24 15:53 ` [PATCH 09/15] staging: exfat: Clean up return codes - FFS_FORMATERR Valdis Kletnieks
2019-10-25  2:56   ` Greg Kroah-Hartman
2019-10-24 15:53 ` [PATCH 10/15] staging: exfat: Clean up return codes - FFS_MEDIAERR Valdis Kletnieks
2019-10-24 15:53 ` [PATCH 11/15] staging: exfat: Clean up return codes - FFS_EOF Valdis Kletnieks
2019-10-24 15:53 ` [PATCH 12/15] staging: exfat: Clean up return codes - FFS_INVALIDFID Valdis Kletnieks
2019-10-24 15:53 ` Valdis Kletnieks [this message]
2019-10-24 15:53 ` [PATCH 14/15] staging: exfat: Clean up return codes - remove unused codes Valdis Kletnieks
2019-10-24 15:53 ` [PATCH 15/15] staging: exfat: Clean up return codes - FFS_SUCCESS Valdis Kletnieks
2019-10-24 16:29   ` Joe Perches
2019-10-24 16:46     ` Valdis Klētnieks
2019-10-24 16:23 ` [PATCH 00/15] staging: exfat: Clean up return codes Joe Perches
2019-10-24 16:45   ` Valdis Klētnieks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191024155327.1095907-14-Valdis.Kletnieks@vt.edu \
    --to=valdis.kletnieks@vt.edu \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).