Skip to contentSkip to conversation

btrfs: backref: Fixed checkpatch warning of over 80 characters

PATCH In review Simon Quigley 3 participants 11 messages Feb 20, 2016 – Feb 22, 2016 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: backref: Fixed checkpatch warning of over 80 characters

checkpatch.pl reported a warning of over 80 characters on line 1833

Fixed by splitting up into multiple lines, no build errors afterwards

---
 fs/btrfs/backref.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
fs/btrfs/backref.c +5 -1
index f6dac40..d097777 100644
@@ -1830,7 +1830,11 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root,
 	unsigned long ptr;
 
 	while (1) {
-		ret = btrfs_find_one_extref(fs_root, inum, offset, path, &extref,
+		ret = btrfs_find_one_extref(fs_root,
+						inum,
+						offset,
+						path,
+						&extref,
 					    &offset);
 		if (ret < 0)
 			break;
Signature · 1 line
2.7.0
#1 lore raw
Quoted 1 line · Simon Quigley

checkpatch.pl reported a warning of over 80 characters on line 1833

[]

fs/btrfs/backref.c

Quoted 1 line
fs/btrfs/backref.c +0 -0

[]

Quoted 11 lines
fs/btrfs/backref.c +0 -0
@@ -1830,7 +1830,11 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root,
  	unsigned long ptr;


  while (1) {

fs/btrfs/backref.c +5 -1
-		ret = btrfs_find_one_extref(fs_root, inum, offset, path, &extref,
+		ret = btrfs_find_one_extref(fs_root,
+						inum,
+						offset,
+						path,
+						&extref,

      &offset);

I think this is poor because all the arguments aren't aligned.

It'd be nicer like:

		ret = btrfs_find_one_extref(fs_root, inum, offset, path,
					    &extref, &offset);
#2 lore raw

PATCH 1/1 btrfs: backref: Fixed checkpatch warning of over 80

In reply to Simon Quigley

checkpatch.pl reported a warning of over 80 characters on line 1833

Adjusted to put &extref and &offset on a different line

---
 fs/btrfs/backref.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/backref.c +2 -2
index f6dac40..956fffa 100644
@@ -1830,8 +1830,8 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root,
 	unsigned long ptr;
 
 	while (1) {
-		ret = btrfs_find_one_extref(fs_root, inum, offset, path, &extref,
-					    &offset);
+		ret = btrfs_find_one_extref(fs_root, inum, offset, path,
+							&extref, &offset);
 		if (ret < 0)
 			break;
 		if (ret) {
Signature · 1 line
2.7.0
#3 lore raw

Re: [PATCH] btrfs: backref: Fixed checkpatch warning of over 80

Better?

Quoted 25 lines · Simon Quigley

checkpatch.pl reported a warning of over 80 characters on line 1833

Adjusted to put &extref and &offset on a different line

---
  fs/btrfs/backref.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/backref.c +2 -2
index f6dac40..956fffa 100644
@@ -1830,8 +1830,8 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root,
  	unsigned long ptr;
 
  	while (1) {
-		ret = btrfs_find_one_extref(fs_root, inum, offset, path, &extref,
-					    &offset);
+		ret = btrfs_find_one_extref(fs_root, inum, offset, path,
+							&extref, &offset);
  		if (ret < 0)
  			break;
  		if (ret) {
#4 lore raw

Re: [PATCH] btrfs: backref: Fixed checkpatch warning of over 80

Quoted 1 line · Simon Quigley

Better?

No, not really.

The alignment should be to the open parenthesis
as I wrote in the first reply.

Quoted 30 lines · Simon Quigley
Quoted 29 lines

checkpatch.pl reported a warning of over 80 characters on line 1833

Adjusted to put &extref and &offset on a different line

---
  fs/btrfs/backref.c | 4 ++--

  1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/backref.c +2 -2
index f6dac40..956fffa 100644
@@ -1830,8 +1830,8 @@ static int iterate_inode_extrefs(u64 inum,
 struct btrfs_root *fs_root,
   	unsigned long ptr;
 
   	while (1) {
-		ret = btrfs_find_one_extref(fs_root, inum, offset,
 path, &extref,
-					    &offset);
+		ret = btrfs_find_one_extref(fs_root, inum, offset,
 path,
+							&extref,

&offset);
   if (ret < 0)
   break;
   if (ret) {

#5 lore raw

PATCH 1/1 btrfs: backref: Fixed checkpatch warning of over 80 characters

In reply to Simon Quigley

checkpatch.pl reported a warning of over 80 characters on line 1833

Adjusted to put &extref and &offset on a different line

---
 fs/btrfs/backref.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/backref.c +2 -2
index f6dac40..81b0863 100644
@@ -1830,8 +1830,8 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root,
 	unsigned long ptr;
 
 	while (1) {
-		ret = btrfs_find_one_extref(fs_root, inum, offset, path, &extref,
-					    &offset);
+		ret = btrfs_find_one_extref(fs_root, inum, offset, path,
+					    &extref, &offset);
 		if (ret < 0)
 			break;
 		if (ret) {
Signature · 1 line
2.7.0
#6 lore raw

I apologize, I had my text editor set to a 4 space tab instead of 8 so I couldn't see this clearly. That's fixed now, and it won't happen again. Is this what you wanted? It seems to line up exactly like you proposed.

Quoted 25 lines · Simon Quigley

checkpatch.pl reported a warning of over 80 characters on line 1833

Adjusted to put &extref and &offset on a different line

---
  fs/btrfs/backref.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/backref.c +2 -2
index f6dac40..81b0863 100644
@@ -1830,8 +1830,8 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root,
  	unsigned long ptr;
 
  	while (1) {
-		ret = btrfs_find_one_extref(fs_root, inum, offset, path, &extref,
-					    &offset);
+		ret = btrfs_find_one_extref(fs_root, inum, offset, path,
+					    &extref, &offset);
  		if (ret < 0)
  			break;
  		if (ret) {
#8 lore raw
Quoted 1 line

in short, whitespace-only changes do not help too much.

But they are encouraged for people who would like to get started with kernel programming, Linus himself says so. In the future I plan on giving more, but I wanted to get familiarized with the process. So I still think this should be accepted although it's just a whitespace change.

#9 lore raw
Quoted 5 lines · Simon Quigley
Quoted 1 line

in short, whitespace-only changes do not help too much.

But they are encouraged for people who would like to get started with kernel programming, Linus himself says so. In the future I plan on giving more, but I wanted to get familiarized with the process. So I still think this should be accepted although it's just a whitespace change.

But you are getting familiarized, you sent a patch, got feedback, defend your patches. That's a great start, but it does not mean that the patches end up merged. The decision is up to the maintainer(s) of the subsystem.

Nobody will bite your head off if you do some trivial formal mistakes in your first patch submissions. The mistakes will be pointed out, you will be asked to resend. Sometimes, when the mistakes or formalities are not worth the email roundtrip, the maintainers fix it at commit time.

#10 lore raw
Quoted 9 lines

But you are getting familiarized, you sent a patch, got feedback, defend your patches.  That's a great start, but it does not mean that the patches end up merged. The decision is up to the maintainer(s) of the subsystem.

Nobody will bite your head off if you do some trivial formal mistakes in your first patch submissions. The mistakes will be pointed out, you will be asked to resend.  Sometimes, when the mistakes or formalities are not worth the email roundtrip, the maintainers fix it at commit time.

So let's wait for a response from Chris. :)