ntfs3.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] fs/ntfs3: Fix various styling issues
@ 2021-09-07  8:34 Kari Argillander
  2021-09-07  8:34 ` [PATCH v2 1/4] fs/ntfs3: Remove '+' before constant in ni_insert_resident() Kari Argillander
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Kari Argillander @ 2021-09-07  8:34 UTC (permalink / raw)
  To: Konstantin Komarov, ntfs3; +Cc: Kari Argillander, linux-kernel, Joe Perches

Fix various checkpatch warnings. There will still be some but they
will be addressed in different patch sets.

v2:
	- Remove + sign completly in 1/4 (Thanks Joe)
	- I dropped one patch as it addressed else were [1]. (Thanks Joe)
	- Drop newline in 3/4

[1]: lore.kernel.org/ntfs3/20210902154050.5075-1-kari.argillander@gmail.com

Kari Argillander (4):
  fs/ntfs3: Remove '+' before constant in ni_insert_resident()
  fs/ntfs3: Place Comparisons constant right side of the test
  fs/ntfs3: Remove braces from single statment block
  fs/ntfs3: Remove tabs before spaces from comment

 fs/ntfs3/frecord.c | 7 +++----
 fs/ntfs3/lznt.c    | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)


base-commit: d3624466b56dd5b1886c1dff500525b544c19c83
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/4] fs/ntfs3: Remove '+' before constant in ni_insert_resident()
  2021-09-07  8:34 [PATCH v2 0/4] fs/ntfs3: Fix various styling issues Kari Argillander
@ 2021-09-07  8:34 ` Kari Argillander
  2021-09-07  8:34 ` [PATCH v2 2/4] fs/ntfs3: Place Comparisons constant right side of the test Kari Argillander
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kari Argillander @ 2021-09-07  8:34 UTC (permalink / raw)
  To: Konstantin Komarov, ntfs3; +Cc: Kari Argillander, linux-kernel, Joe Perches

No need for plus sign here. So remove it. Checkpatch will also be happy.

Signed-off-by: Kari Argillander <kari.argillander@gmail.com>
---
 fs/ntfs3/frecord.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 938b12d56ca6..d1477cabe3c7 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -1451,7 +1451,7 @@ int ni_insert_resident(struct ntfs_inode *ni, u32 data_size,
 		attr->res.flags = RESIDENT_FLAG_INDEXED;
 
 		/* is_attr_indexed(attr)) == true */
-		le16_add_cpu(&ni->mi.mrec->hard_links, +1);
+		le16_add_cpu(&ni->mi.mrec->hard_links, 1);
 		ni->mi.dirty = true;
 	}
 	attr->res.res = 0;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/4] fs/ntfs3: Place Comparisons constant right side of the test
  2021-09-07  8:34 [PATCH v2 0/4] fs/ntfs3: Fix various styling issues Kari Argillander
  2021-09-07  8:34 ` [PATCH v2 1/4] fs/ntfs3: Remove '+' before constant in ni_insert_resident() Kari Argillander
@ 2021-09-07  8:34 ` Kari Argillander
  2021-09-07  8:34 ` [PATCH v2 3/4] fs/ntfs3: Remove braces from single statment block Kari Argillander
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kari Argillander @ 2021-09-07  8:34 UTC (permalink / raw)
  To: Konstantin Komarov, ntfs3; +Cc: Kari Argillander, linux-kernel, Joe Perches

For better code readability place constant always right side of the
test. This will also address checkpatch warning.

Signed-off-by: Kari Argillander <kari.argillander@gmail.com>
---
 fs/ntfs3/frecord.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index d1477cabe3c7..d3c1c46cfb0a 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -1606,7 +1606,7 @@ struct ATTR_FILE_NAME *ni_fname_type(struct ntfs_inode *ni, u8 name_type,
 
 	*le = NULL;
 
-	if (FILE_NAME_POSIX == name_type)
+	if (name_type == FILE_NAME_POSIX)
 		return NULL;
 
 	/* Enumerate all names. */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 3/4] fs/ntfs3: Remove braces from single statment block
  2021-09-07  8:34 [PATCH v2 0/4] fs/ntfs3: Fix various styling issues Kari Argillander
  2021-09-07  8:34 ` [PATCH v2 1/4] fs/ntfs3: Remove '+' before constant in ni_insert_resident() Kari Argillander
  2021-09-07  8:34 ` [PATCH v2 2/4] fs/ntfs3: Place Comparisons constant right side of the test Kari Argillander
@ 2021-09-07  8:34 ` Kari Argillander
  2021-09-07  8:34 ` [PATCH v2 4/4] fs/ntfs3: Remove tabs before spaces from comment Kari Argillander
  2021-09-16 14:07 ` [PATCH v2 0/4] fs/ntfs3: Fix various styling issues Konstantin Komarov
  4 siblings, 0 replies; 6+ messages in thread
From: Kari Argillander @ 2021-09-07  8:34 UTC (permalink / raw)
  To: Konstantin Komarov, ntfs3; +Cc: Kari Argillander, linux-kernel, Joe Perches

Remove braces from single statment block as they are not needed. Also
Linux kernel coding style guide recommend this and checkpatch warn about
this.

Signed-off-by: Kari Argillander <kari.argillander@gmail.com>
---
 fs/ntfs3/frecord.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index d3c1c46cfb0a..549ad245269a 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -2906,9 +2906,8 @@ bool ni_remove_name_undo(struct ntfs_inode *dir_ni, struct ntfs_inode *ni,
 		memcpy(Add2Ptr(attr, SIZEOF_RESIDENT), de + 1, de_key_size);
 		mi_get_ref(&ni->mi, &de->ref);
 
-		if (indx_insert_entry(&dir_ni->dir, dir_ni, de, sbi, NULL, 1)) {
+		if (indx_insert_entry(&dir_ni->dir, dir_ni, de, sbi, NULL, 1))
 			return false;
-		}
 	}
 
 	return true;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 4/4] fs/ntfs3: Remove tabs before spaces from comment
  2021-09-07  8:34 [PATCH v2 0/4] fs/ntfs3: Fix various styling issues Kari Argillander
                   ` (2 preceding siblings ...)
  2021-09-07  8:34 ` [PATCH v2 3/4] fs/ntfs3: Remove braces from single statment block Kari Argillander
@ 2021-09-07  8:34 ` Kari Argillander
  2021-09-16 14:07 ` [PATCH v2 0/4] fs/ntfs3: Fix various styling issues Konstantin Komarov
  4 siblings, 0 replies; 6+ messages in thread
From: Kari Argillander @ 2021-09-07  8:34 UTC (permalink / raw)
  To: Konstantin Komarov, ntfs3; +Cc: Kari Argillander, linux-kernel, Joe Perches

Remove tabs before spaces from comment as recommended by kernel coding
style. Checkpatch also warn about these.

Signed-off-by: Kari Argillander <kari.argillander@gmail.com>
---
 fs/ntfs3/lznt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ntfs3/lznt.c b/fs/ntfs3/lznt.c
index f1f691a67cc4..734a251deae9 100644
--- a/fs/ntfs3/lznt.c
+++ b/fs/ntfs3/lznt.c
@@ -292,7 +292,7 @@ static inline ssize_t decompress_chunk(u8 *unc, u8 *unc_end, const u8 *cmpr,
 /*
  * get_lznt_ctx
  * @level: 0 - Standard compression.
- * 	   !0 - Best compression, requires a lot of cpu.
+ *	   !0 - Best compression, requires a lot of cpu.
  */
 struct lznt *get_lznt_ctx(int level)
 {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/4] fs/ntfs3: Fix various styling issues
  2021-09-07  8:34 [PATCH v2 0/4] fs/ntfs3: Fix various styling issues Kari Argillander
                   ` (3 preceding siblings ...)
  2021-09-07  8:34 ` [PATCH v2 4/4] fs/ntfs3: Remove tabs before spaces from comment Kari Argillander
@ 2021-09-16 14:07 ` Konstantin Komarov
  4 siblings, 0 replies; 6+ messages in thread
From: Konstantin Komarov @ 2021-09-16 14:07 UTC (permalink / raw)
  To: Kari Argillander, ntfs3; +Cc: linux-kernel, Joe Perches



On 07.09.2021 11:34, Kari Argillander wrote:
> Fix various checkpatch warnings. There will still be some but they
> will be addressed in different patch sets.
> 
> v2:
> 	- Remove + sign completly in 1/4 (Thanks Joe)
> 	- I dropped one patch as it addressed else were [1]. (Thanks Joe)
> 	- Drop newline in 3/4
> 
> [1]: lore.kernel.org/ntfs3/20210902154050.5075-1-kari.argillander@gmail.com
> 
> Kari Argillander (4):
>   fs/ntfs3: Remove '+' before constant in ni_insert_resident()
>   fs/ntfs3: Place Comparisons constant right side of the test
>   fs/ntfs3: Remove braces from single statment block
>   fs/ntfs3: Remove tabs before spaces from comment
> 
>  fs/ntfs3/frecord.c | 7 +++----
>  fs/ntfs3/lznt.c    | 2 +-
>  2 files changed, 4 insertions(+), 5 deletions(-)
> 
> 
> base-commit: d3624466b56dd5b1886c1dff500525b544c19c83
> 

Hi, Kari, Joe!
Applied, thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-16 14:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07  8:34 [PATCH v2 0/4] fs/ntfs3: Fix various styling issues Kari Argillander
2021-09-07  8:34 ` [PATCH v2 1/4] fs/ntfs3: Remove '+' before constant in ni_insert_resident() Kari Argillander
2021-09-07  8:34 ` [PATCH v2 2/4] fs/ntfs3: Place Comparisons constant right side of the test Kari Argillander
2021-09-07  8:34 ` [PATCH v2 3/4] fs/ntfs3: Remove braces from single statment block Kari Argillander
2021-09-07  8:34 ` [PATCH v2 4/4] fs/ntfs3: Remove tabs before spaces from comment Kari Argillander
2021-09-16 14:07 ` [PATCH v2 0/4] fs/ntfs3: Fix various styling issues Konstantin Komarov

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).