Skip to contentSkip to conversation

tools: net: bpf_dbg.c fixed keyboard typo

PATCH In review Ozgur Karatas 4 participants 7 messages Dec 16, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: net: bpf_dbg.c fixed keyboard typo

This patch fixed to keyboard typo, brackets not closed. I think, it should be close to parenthes.

---
 tools/net/bpf_dbg.c       | 2 +-
 1 files changed, 1 insertion(+), 1 deletions(-)
tools/net/bpf_dbg.c +1 -1
index 4f254bc..f715f46 100644
@@ -1213,7 +1213,7 @@ static int cmd_disassemble(char *line_string)
 
 	if (!bpf_prog_loaded())
 		return CMD_ERR;
-	if (strlen(line_string) > 0 &&
+	if (strlen(line_string) > 0 &&)
 	    (line = strtoul(line_string, NULL, 10)) < bpf_prog_len)
 		single_line = true;
 	if (single_line)
Signature · 1 line
2.1.4
#1 lore raw
Quoted 2 lines · Ozgur Karatas

This patch fixed to keyboard typo, brackets not closed. I think, it should be close to parenthes.

No.

Please compile and test your patches on your own system before you send them.

#2 lore raw

16.12.2016, 20:35, "Joe Perches" <[email protected]>:

Quoted 8 lines · Ozgur Karatas
Quoted 2 lines

 This patch fixed to keyboard typo, brackets not closed. I think, it should be close to parenthes.

No.

Please compile and test your patches on your own system before you send them.

Dear Perches,

I have already tested and it was not a part of the code anyway. if there is no parentheses, the code works incorrectly and give a error. I'm sorry, have a little problem with my english but "line_string" variables would not equal NULL, 10. So the code it skips it and runs to "bpf_prog_len". If it should be equal "0 &&" and already be completed (>) right?

if (strlen(line_string) > 0 &&

            (line = strtoul(line_string, NULL, 10)) < bpf_prog_len)

Testing:

$ make M=tools/
tools//Makefile:6: scripts/Makefile.include: No such file or directory
$ cp tools/scripts/Makefile.include scripts/Makefile
$ make M=tools/
  Building modules, stage 2.
  MODPOST 0 modules

I try to module (insmod) and worked.

Regards,

~Ozgur

#3 lore raw
In reply to Joe Perches

16.12.2016, 20:35, "Joe Perches" <[email protected]>:

Quoted 8 lines · Ozgur Karatas
Quoted 2 lines

 This patch fixed to keyboard typo, brackets not closed. I think, it should be close to parenthes.

No.

Please compile and test your patches on your own system before you send them.

Also, checkpatch script give a error, it should not forget.

$ ./scripts/checkpatch.pl --file --terse tools/net/bpf_dbg.c
tools/net/bpf_dbg.c:1216: ERROR: do not use assignment in if condition

After fix:

$ ./scripts/checkpatch.pl --file --terse tools/net/bpf_dbg.c 
total: 0 errors, 6 warnings, 1395 lines checked

Regards,

~Ozgur

#4 lore raw
In reply to Ozgur Karatas

Hello.

Quoted 13 lines · Ozgur Karatas

This patch fixed to keyboard typo, brackets not closed. I think, it should be close to parenthes.

---
 tools/net/bpf_dbg.c       | 2 +-
 1 files changed, 1 insertion(+), 1 deletions(-)
tools/net/bpf_dbg.c +0 -0
index 4f254bc..f715f46 100644

tools/net/bpf_dbg.c static int cmd_disassemble(char *line_string) · line 1216

Quoted 5 lines
tools/net/bpf_dbg.c +1 -1
@@ -1213,7 +1213,7 @@ static int cmd_disassemble(char *line_string)
 
 	if (!bpf_prog_loaded())
 		return CMD_ERR;
-	if (strlen(line_string) > 0 &&
+	if (strlen(line_string) > 0 &&)

Have tried to you compile that? :-/

tools/net/bpf_dbg.c static int cmd_disassemble(char *line_string) · line 1217

Quoted 1 line
tools/net/bpf_dbg.c +0 -0
 	    (line = strtoul(line_string, NULL, 10)) < bpf_prog_len)

I think the code was correct before your patch...

tools/net/bpf_dbg.c static int cmd_disassemble(char *line_string) · line 1219

Quoted 2 lines
tools/net/bpf_dbg.c +0 -0
 		single_line = true;
 	if (single_line)

MBR, Sergei

#5 lore raw

16.12.2016, 21:08, "Sergei Shtylyov" <[email protected]>:

Quoted 1 line

Hello.

Hi

Quoted 16 lines · Ozgur Karatas
Quoted 15 lines

 This patch fixed to keyboard typo, brackets not closed. I think, it should be close to parenthes.

 ---
  tools/net/bpf_dbg.c | 2 +-

  1 files changed, 1 insertion(+), 1 deletions(-)

 diff --git a/tools/net/bpf_dbg.c b/tools/net/bpf_dbg.c index 4f254bc..f715f46 100644
 --- a/tools/net/bpf_dbg.c
 +++ b/tools/net/bpf_dbg.c
 @@ -1213,7 +1213,7 @@ static int cmd_disassemble(char *line_string)

Quoted 6 lines
Quoted 4 lines

          if (!bpf_prog_loaded())
                  return CMD_ERR;
 - if (strlen(line_string) > 0 &&
 + if (strlen(line_string) > 0 &&)

    Have tried to you compile that? :-/

Yes, i compiled but I apologize if there was NAK.
Also, checkpatch give a error.

I could be wrong, will review again.

Best Regards!

Quoted 8 lines
Quoted 1 line

              (line = strtoul(line_string, NULL, 10)) < bpf_prog_len)

    I think the code was correct before your patch...

Quoted 2 lines

                  single_line = true;
          if (single_line)

MBR, Sergei

~Ozgur

#6 lore raw
In reply to Ozgur Karatas
Quoted 5 lines · Ozgur Karatas

This patch fixed to keyboard typo, brackets not closed. I think, it should be close to parenthes.

NAK for obvious reasons ...

Quoted 18 lines
---
  tools/net/bpf_dbg.c       | 2 +-
  1 files changed, 1 insertion(+), 1 deletions(-)
tools/net/bpf_dbg.c +1 -1
index 4f254bc..f715f46 100644
@@ -1213,7 +1213,7 @@ static int cmd_disassemble(char *line_string)
 
  	if (!bpf_prog_loaded())
  		return CMD_ERR;
-	if (strlen(line_string) > 0 &&
+	if (strlen(line_string) > 0 &&)
  	    (line = strtoul(line_string, NULL, 10)) < bpf_prog_len)
  		single_line = true;
  	if (single_line)