Skip to contentSkip to conversation

staging: exfat: Improve line continuation and alignment

PATCH In review Frank A. Cancio Bello 2 participants 5 messages Nov 2, 2019 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover staging: exfat: Improve line continuation and alignment

Minor code cleanup consisting of putting the logical operator at the end of the line instead of at the beginning. Besides there are some alignment improvements include too.

The code now is more complying with the preferred coding style for the linux kernel. Issues found by checkpatch.

Changes in v2 by Julia Lawall suggestion:
- Improves log messages on all of the patches.
- Avoid repeating checkpatch messages.

Frank A. Cancio Bello (2):
staging: exfat: Fix parameter alignment issues
staging: exfat: Fix logical operation continuation

 drivers/staging/exfat/exfat_core.c  | 5 +++--
 drivers/staging/exfat/exfat_super.c | 8 ++++----
 2 files changed, 7 insertions(+), 6 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/2 staging: exfat: Fix parameter alignment issues

Fix alignment to match open parenthesis to comply in that way with the preferred coding style for the linux kernel. Issue found by checkpatch.

---
 drivers/staging/exfat/exfat_core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/staging/exfat/exfat_core.c +3 -2
index f4f82aecc05d..b23fbf3ebaa5 100644
@@ -1503,7 +1503,7 @@ void fat_delete_dir_entry(struct super_block *sb, struct chain_t *p_dir,
 }
 
 void exfat_delete_dir_entry(struct super_block *sb, struct chain_t *p_dir,
-		s32 entry, s32 order, s32 num_entries)
+			    s32 entry, s32 order, s32 num_entries)
 {
 	int i;
 	sector_t sector;
@@ -1919,7 +1919,8 @@ s32 write_whole_entry_set(struct super_block *sb, struct entry_set_cache_t *es)
 
 /* write back some entries in entry set */
 s32 write_partial_entries_in_entry_set(struct super_block *sb,
-	struct entry_set_cache_t *es, struct dentry_t *ep, u32 count)
+				       struct entry_set_cache_t *es,
+				       struct dentry_t *ep, u32 count)
 {
 	s32 ret, byte_offset, off;
 	u32 clu = 0;
Signature · 1 line
2.17.1
#3 lore raw

PATCH v2 2/2 staging: exfat: Fix logical operation continuation

In reply to Frank A. Cancio Bello

Operators inside a multiline logical expression should be at the end of the line not at the beginning. This patch fixes two of those cases and remove an unnecessary parenthesis too, to comply in that way with the preferred coding style for the linux kernel.

---
 drivers/staging/exfat/exfat_super.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/exfat/exfat_super.c +4 -4
index 77984a73ba6e..5f972588669c 100644
@@ -2980,8 +2980,8 @@ static int exfat_setattr(struct dentry *dentry, struct iattr *attr)
 
 	pr_debug("%s entered\n", __func__);
 
-	if ((attr->ia_valid & ATTR_SIZE)
-		&& (attr->ia_size > i_size_read(inode))) {
+	if ((attr->ia_valid & ATTR_SIZE) &&
+	    attr->ia_size > i_size_read(inode)) {
 		error = exfat_cont_expand(inode, attr->ia_size);
 		if (error || attr->ia_valid == ATTR_SIZE)
 			return error;
@@ -2990,8 +2990,8 @@ static int exfat_setattr(struct dentry *dentry, struct iattr *attr)
 
 	ia_valid = attr->ia_valid;
 
-	if ((ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET | ATTR_TIMES_SET))
-		&& exfat_allow_set_time(sbi, inode)) {
+	if ((ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET | ATTR_TIMES_SET)) &&
+	    exfat_allow_set_time(sbi, inode)) {
 		attr->ia_valid &= ~(ATTR_MTIME_SET |
 				    ATTR_ATIME_SET |
 				    ATTR_TIMES_SET);
Signature · 1 line
2.17.1
Acked-by on v2 2/2
#4 lore raw

Re: [Outreachy kernel] [PATCH v2 2/2] staging: exfat: Fix logical operation continuation

Quoted 7 lines · Frank A. Cancio Bello

Operators inside a multiline logical expression should be at the end of the line not at the beginning. This patch fixes two of those cases and remove an unnecessary parenthesis too, to comply in that way with the preferred coding style for the linux kernel.

Quoted 38 lines
---
 drivers/staging/exfat/exfat_super.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/exfat/exfat_super.c +4 -5
index 77984a73ba6e..5f972588669c 100644
@@ -2980,8 +2980,8 @@ static int exfat_setattr(struct dentry *dentry, struct iattr *attr)
 
 	pr_debug("%s entered\n", __func__);
 
-	if ((attr->ia_valid & ATTR_SIZE)
-		&& (attr->ia_size > i_size_read(inode))) {
+	if ((attr->ia_valid & ATTR_SIZE) &&
+	    attr->ia_size > i_size_read(inode)) {
 		error = exfat_cont_expand(inode, attr->ia_size);
 		if (error || attr->ia_valid == ATTR_SIZE)
 			return error;
@@ -2990,8 +2990,8 @@ static int exfat_setattr(struct dentry *dentry, struct iattr *attr)
 
 	ia_valid = attr->ia_valid;
 
-	if ((ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET | ATTR_TIMES_SET))
-		&& exfat_allow_set_time(sbi, inode)) {
+	if ((ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET | ATTR_TIMES_SET)) &&
+	    exfat_allow_set_time(sbi, inode)) {
 		attr->ia_valid &= ~(ATTR_MTIME_SET |
 				    ATTR_ATIME_SET |
 				    ATTR_TIMES_SET);
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/ace2cbd5e4c03751fb522e7bbd60149e7ed969ae.1572666556.git.frank%40generalsoftwareinc.com.

Acked-by on v2 1/2
#2 lore raw

Re: [Outreachy kernel] [PATCH v2 1/2] staging: exfat: Fix parameter alignment issues

In reply to Frank A. Cancio Bello
Quoted 6 lines · Frank A. Cancio Bello

Fix alignment to match open parenthesis to comply in that way with the preferred coding style for the linux kernel. Issue found by checkpatch.

Quoted 35 lines
---
 drivers/staging/exfat/exfat_core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/staging/exfat/exfat_core.c +3 -3
index f4f82aecc05d..b23fbf3ebaa5 100644
@@ -1503,7 +1503,7 @@ void fat_delete_dir_entry(struct super_block *sb, struct chain_t *p_dir,
 }
 
 void exfat_delete_dir_entry(struct super_block *sb, struct chain_t *p_dir,
-		s32 entry, s32 order, s32 num_entries)
+			    s32 entry, s32 order, s32 num_entries)
 {
 	int i;
 	sector_t sector;
@@ -1919,7 +1919,8 @@ s32 write_whole_entry_set(struct super_block *sb, struct entry_set_cache_t *es)
 
 /* write back some entries in entry set */
 s32 write_partial_entries_in_entry_set(struct super_block *sb,
-	struct entry_set_cache_t *es, struct dentry_t *ep, u32 count)
+				       struct entry_set_cache_t *es,
+				       struct dentry_t *ep, u32 count)
 {
 	s32 ret, byte_offset, off;
 	u32 clu = 0;
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/fe316e694ea9c4aa370d3a8166a3680feb342682.1572666556.git.frank%40generalsoftwareinc.com.