[ovs-dev,v2] checkpatch: Reset line counter.

Message ID 1507217523-18282-1-git-send-email-i.maximets@samsung.com
State Accepted
Headers show
Series
  • [ovs-dev,v2] checkpatch: Reset line counter.
Related show

Commit Message

Ilya Maximets Oct. 5, 2017, 3:32 p.m.
Lines should be counted for each file separately.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
---

Version 2:
	* Fixed commit message.

 utilities/checkpatch.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Aaron Conole Oct. 10, 2017, 2 p.m. | #1
Ilya Maximets <i.maximets@samsung.com> writes:

> Lines should be counted for each file separately.
>
> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
> ---

Looks good to me.  Thanks, Ilya!

Acked-by: Aaron Conole <aconole@redhat.com>

> Version 2:
> 	* Fixed commit message.
>
>  utilities/checkpatch.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
> index 185ddaf..33feb6b 100755
> --- a/utilities/checkpatch.py
> +++ b/utilities/checkpatch.py
> @@ -64,10 +64,11 @@ def print_warning(message):
>  
>  
>  def reset_counters():
> -    global __errors, __warnings
> +    global __errors, __warnings, total_line
>  
>      __errors = 0
>      __warnings = 0
> +    total_line = 0
>  
>  
>  # These are keywords whose names are normally followed by a space and
Ben Pfaff Oct. 10, 2017, 2:55 p.m. | #2
On Tue, Oct 10, 2017 at 10:00:02AM -0400, Aaron Conole wrote:
> Ilya Maximets <i.maximets@samsung.com> writes:
> 
> > Lines should be counted for each file separately.
> >
> > Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
> > ---
> 
> Looks good to me.  Thanks, Ilya!
> 
> Acked-by: Aaron Conole <aconole@redhat.com>

Applied, thanks Aaron and Ilya!

Patch

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index 185ddaf..33feb6b 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -64,10 +64,11 @@  def print_warning(message):
 
 
 def reset_counters():
-    global __errors, __warnings
+    global __errors, __warnings, total_line
 
     __errors = 0
     __warnings = 0
+    total_line = 0
 
 
 # These are keywords whose names are normally followed by a space and