Skip to contentSkip to conversation

Fix alignment and logical operation continuation

PATCH Superseded Frank A. Cancio Bello 2 participants 4 messages Nov 1, 2019 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Fix alignment and logical operation continuation

This is a simple patchset that improves alignment and readability of multiline logical expression.

Frank A. Cancio Bello (2):
staging: exfat: Fix parameters 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 1/2 staging: exfat: Fix parameters alignment issues

checkpatch message:
CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

---
 drivers/staging/exfat/exfat_core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/staging/exfat/exfat_core.c +3 -2
index f71235c6a338..8e4df399d91b 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
#2 lore raw

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

In reply to Frank A. Cancio Bello

checkpatch.pl message:
"CHECK:LOGICAL_CONTINUATIONS: Logical continuations should be on the previous line"

---
 drivers/staging/exfat/exfat_super.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/exfat/exfat_super.c +4 -4
index 3a7a10dbded4..3e19d5d7ef20 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
#3 lore raw

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

Quoted 3 lines · Frank A. Cancio Bello

checkpatch.pl message:
"CHECK:LOGICAL_CONTINUATIONS: Logical continuations should be on the previous line"

Actually, in general, your commit message should not just repeat the checkpatch message. You should say what you do and why. It is good to also acknowledge checkpatch if checkpatch helped find the problem.

This partch also drops an unnecessary pair of parentheses, which would be worth mentioning as well.

julia

Quoted 40 lines
---
 drivers/staging/exfat/exfat_super.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/exfat/exfat_super.c +4 -5
index 3a7a10dbded4..3e19d5d7ef20 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/4c1e92802ad82567fb312bce096386d3285196c1.1572586238.git.frank%40generalsoftwareinc.com.