driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
From: Valentin Vidic <vvidic@valentin-vidic.from.hr>
To: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Cc: devel@driverdev.osuosl.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org,
	Valentin Vidic <vvidic@valentin-vidic.from.hr>
Subject: [PATCH] staging: exfat: cleanup braces for if/else statements
Date: Tue,  3 Sep 2019 18:47:32 +0200	[thread overview]
Message-ID: <20190903164732.14194-1-vvidic@valentin-vidic.from.hr> (raw)

Fixes checkpatch.pl warnings:

  CHECK: Unbalanced braces around else statement
  CHECK: braces {} should be used on all arms of this statement

Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr>
---
 drivers/staging/exfat/exfat_core.c  | 12 ++++++------
 drivers/staging/exfat/exfat_super.c | 16 +++++++++-------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/exfat/exfat_core.c b/drivers/staging/exfat/exfat_core.c
index 46b9f4455da1..1246afcffb8d 100644
--- a/drivers/staging/exfat/exfat_core.c
+++ b/drivers/staging/exfat/exfat_core.c
@@ -743,11 +743,11 @@ static s32 __load_upcase_table(struct super_block *sb, sector_t sector,
 				pr_debug("to 0x%X (amount of 0x%X)\n",
 					 index, uni);
 				skip = FALSE;
-			} else if (uni == index)
+			} else if (uni == index) {
 				index++;
-			else if (uni == 0xFFFF)
+			} else if (uni == 0xFFFF) {
 				skip = TRUE;
-			else { /* uni != index , uni != 0xFFFF */
+			} else { /* uni != index , uni != 0xFFFF */
 				u16 col_index = get_col_index(index);
 
 				if (upcase_table[col_index] == NULL) {
@@ -805,11 +805,11 @@ static s32 __load_default_upcase_table(struct super_block *sb)
 			index += uni;
 			pr_debug("to 0x%X (amount of 0x%X)\n", index, uni);
 			skip = FALSE;
-		} else if (uni == index)
+		} else if (uni == index) {
 			index++;
-		else if (uni == 0xFFFF)
+		} else if (uni == 0xFFFF) {
 			skip = TRUE;
-		else { /* uni != index , uni != 0xFFFF */
+		} else { /* uni != index , uni != 0xFFFF */
 			u16 col_index = get_col_index(index);
 
 			if (upcase_table[col_index] == NULL) {
diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c
index 881cd85cf677..e44b860e35e8 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -344,8 +344,10 @@ static int exfat_cmpi(const struct dentry *dentry, unsigned int len,
 		if (t == NULL) {
 			if (strncasecmp(name->name, str, alen) == 0)
 				return 0;
-		} else if (nls_strnicmp(t, name->name, str, alen) == 0)
-			return 0;
+		} else {
+			if (nls_strnicmp(t, name->name, str, alen) == 0)
+				return 0;
+		}
 	}
 	return 1;
 }
@@ -999,7 +1001,7 @@ static int ffsWriteFile(struct inode *inode, struct file_id_t *fid,
 								   &new_clu);
 			if (num_alloced == 0)
 				break;
-			else if (num_alloced < 0) {
+			if (num_alloced < 0) {
 				ret = FFS_MEDIAERR;
 				goto out;
 			}
@@ -1248,9 +1250,9 @@ static int ffsTruncateFile(struct inode *inode, u64 old_size, u64 new_size)
 		p_fs->fs_func->set_entry_clu0(ep2, CLUSTER_32(0));
 	}
 
-	if (p_fs->vol_type != EXFAT)
+	if (p_fs->vol_type != EXFAT) {
 		buf_modify(sb, sector);
-	else {
+	} else {
 		update_dir_checksum_with_entry_set(sb, es);
 		release_entry_set(es);
 	}
@@ -1561,9 +1563,9 @@ static int ffsSetAttr(struct inode *inode, u32 attr)
 	fid->attr = attr;
 	p_fs->fs_func->set_entry_attr(ep, attr);
 
-	if (p_fs->vol_type != EXFAT)
+	if (p_fs->vol_type != EXFAT) {
 		buf_modify(sb, sector);
-	else {
+	} else {
 		update_dir_checksum_with_entry_set(sb, es);
 		release_entry_set(es);
 	}
-- 
2.20.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

             reply	other threads:[~2019-09-03 16:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 16:47 Valentin Vidic [this message]
2019-09-03 17:32 ` [PATCH] staging: exfat: cleanup braces for if/else statements Al Viro
2019-09-03 18:12   ` Valentin Vidić
2019-09-04  9:38     ` David Laight
2019-09-04 17:05       ` Valentin Vidić
2019-09-03 18:19   ` Greg Kroah-Hartman
2019-09-03 18:55     ` [PATCH] staging: exfat: drop local TRUE/FALSE defines Valentin Vidic

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=20190903164732.14194-1-vvidic@valentin-vidic.from.hr \
    --to=vvidic@valentin-vidic.from.hr \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=valdis.kletnieks@vt.edu \
    /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).