Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6956622ybx; Mon, 11 Nov 2019 18:12:02 -0800 (PST) X-Google-Smtp-Source: APXvYqzuzsRtxXw8koAciWAMhe/dZ5NAUzYpsVzZMMy5A5IKQXqvgZ1Nmp1l7mJvELh3/Ry2CGSS X-Received: by 2002:a17:907:205b:: with SMTP id pg27mr24963059ejb.144.1573524722450; Mon, 11 Nov 2019 18:12:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573524722; cv=none; d=google.com; s=arc-20160816; b=YdRHFr1J/hyStSuQJKlamlWbvQHd6zQZ4ToqbSxYDHv4yXkwIrrDXr2XSifiXTCyKf KkgFAF7K1aPaxW7Q6G/F71bcKna0pFZC1IjtUlZghhN4tn5DuoMNk8cSoz8INeytNiYm iF55xHuAOCINhCuUVuQ1oTOQWn8SkMcHjhbCuDW/6mUejRxH+Cd32cqoLSlGO4xMJoOH oX3W7MH9rp0xKrxpA1P0cXmxV+MZVjLiLXyAlwHgQp3SePQoKShMdEo0hNMKd2KYEw26 mjj5n7+CY60V2ccoAGetKNtHS1NXLmRC7aFjESVTAGIghMAl6z5e9asPLZdsoVvs+SYx wyNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=tfeIwuZlARKtMiR++Mo+2NVCZ5X6OlyhQI7+5iHKuUE=; b=V1UYZHWIm0XjYdNxOt8efl6jX1GhccLpw8W2ooT3g0AfxlP8XbKPhqFoIZp4gQb6F8 NeO95xyfkfNMKQuwPpS9PhflVj3Spr88Yt4nGxKHEtCmc0mVFHu35cJd+en10Ik20rG6 EU/2k99FTsDrN3AO92iAIcqBfO9zKVE3x3djZ+EMhDOYOgtUR0cqmjPTd9/q+BRM6de7 Arha2dkcguxDFUyj1WtQyu9329YMjSHHwnW7nvGypGK0FankXPmtn1I+/oXQ8E9m9cUH bFT5CkDBJR8vOuDfck+eA3R7+85R8lcU+rg1YeLuFIxhzYru/U7tESBe691BQ8wiYXGB 20lw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vt.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ot13si7781614ejb.199.2019.11.11.18.11.38; Mon, 11 Nov 2019 18:12:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vt.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727149AbfKLCKq (ORCPT + 99 others); Mon, 11 Nov 2019 21:10:46 -0500 Received: from outbound.smtp.vt.edu ([198.82.183.121]:48016 "EHLO omr1.cc.vt.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727132AbfKLCKo (ORCPT ); Mon, 11 Nov 2019 21:10:44 -0500 Received: from mr4.cc.vt.edu (inbound.smtp.ipv6.vt.edu [IPv6:2607:b400:92:9:0:9d:8fcb:4116]) by omr1.cc.vt.edu (8.14.4/8.14.4) with ESMTP id xAC2Ah8B011513 for ; Mon, 11 Nov 2019 21:10:43 -0500 Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mr4.cc.vt.edu (8.14.7/8.14.7) with ESMTP id xAC2Ace4015944 for ; Mon, 11 Nov 2019 21:10:43 -0500 Received: by mail-qt1-f197.google.com with SMTP id k9so19184529qtg.2 for ; Mon, 11 Nov 2019 18:10:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=tfeIwuZlARKtMiR++Mo+2NVCZ5X6OlyhQI7+5iHKuUE=; b=cvTmreTWSQR4jd2DW3+D6bfPSA4WW0bsjh5Y8pQW0UKXJDVazb0txMuxTwPHtnuoRg z18g3zD4ui0K7pRpR4FXwdK7q82y1NKJYuXgGjarNNRMZzKLm3jPw8bmi4NYttawVfnw TKmZeS5TxgSfNJESp18iJO21f6Tnw4gdON0eQrG8XvPeBFlID/PpQBway3ifxCv8+vkh n7+SaS2+TDbuFg6WSS6k+bBswsg7Y0dgo2w26dVQFQkRVS6X/dl422fddLwpzDZLk19s scxrx6Jaow2ku4O/NXyBeW598xaEwaek8hdexbAr7OajP1rSeAwExSUgOvsOdC0fqxvu K0YQ== X-Gm-Message-State: APjAAAVMcXcdrUuEprDVy56L2piTVUYzuU7B7fsKZtqCVg8JFggvvseP 88zTo2FhaDqP3GUQH5Qr0bjaDACwJHKFdoRge8HTf67S5Al2MjslQ+DBU2Y1cNGZy8OJNN4W6m2 AurDr9/Kt/XorGmMQOP1Wv0yfvI8TfGN7TKc= X-Received: by 2002:a0c:b0fa:: with SMTP id p55mr27418878qvc.239.1573524638272; Mon, 11 Nov 2019 18:10:38 -0800 (PST) X-Received: by 2002:a0c:b0fa:: with SMTP id p55mr27418857qvc.239.1573524637930; Mon, 11 Nov 2019 18:10:37 -0800 (PST) Received: from turing-police.lan ([2601:5c0:c001:c9e1::359]) by smtp.gmail.com with ESMTPSA id o195sm8004767qke.35.2019.11.11.18.10.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 18:10:36 -0800 (PST) From: Valdis Kletnieks X-Google-Original-From: Valdis Kletnieks To: gregkh@linuxfoundation.org Cc: Valdis Kletnieks , Valdis Kletnieks , linux-fsdevel@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 5/9] staging: exfat: Clean up return codes - FFS_ERROR Date: Mon, 11 Nov 2019 21:09:53 -0500 Message-Id: <20191112021000.42091-6-Valdis.Kletnieks@vt.edu> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191112021000.42091-1-Valdis.Kletnieks@vt.edu> References: <20191112021000.42091-1-Valdis.Kletnieks@vt.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert FFS_ERROR to -EINVAL Signed-off-by: Valdis Kletnieks --- drivers/staging/exfat/exfat.h | 1 - drivers/staging/exfat/exfat_core.c | 10 +++++----- drivers/staging/exfat/exfat_super.c | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h index 7a817405c624..443fafe1d89d 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 2f6e9d724625..ffcad6867ecb 100644 --- a/drivers/staging/exfat/exfat_core.c +++ b/drivers/staging/exfat/exfat_core.c @@ -699,7 +699,7 @@ void sync_alloc_bitmap(struct super_block *sb) 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); @@ -774,7 +774,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); @@ -784,7 +784,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); @@ -1906,7 +1906,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 */ @@ -1931,7 +1931,7 @@ s32 write_partial_entries_in_entry_set(struct super_block *sb, /* vaidity check */ if (ep + count > ((struct dentry_t *)&es->__buf) + es->num_entries) - return FFS_ERROR; + return -EINVAL; dir.dir = GET_CLUSTER_FROM_SECTOR(es->sector); dir.flags = es->alloc_flag; diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c index dd6530aef63a..daded767182a 100644 --- a/drivers/staging/exfat/exfat_super.c +++ b/drivers/staging/exfat/exfat_super.c @@ -498,7 +498,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 */ mutex_lock(&p_fs->v_mutex); @@ -561,7 +561,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 */ mutex_lock(&p_fs->v_mutex); @@ -654,7 +654,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 */ mutex_lock(&p_fs->v_mutex); @@ -703,7 +703,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 */ mutex_lock(&p_fs->v_mutex); @@ -835,7 +835,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 */ mutex_lock(&p_fs->v_mutex); @@ -1241,7 +1241,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 */ mutex_lock(&p_fs->v_mutex); @@ -1464,7 +1464,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); @@ -1756,7 +1756,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 */ mutex_lock(&p_fs->v_mutex); @@ -1908,7 +1908,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 */ mutex_lock(&p_fs->v_mutex); @@ -1954,7 +1954,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.24.0