public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: update checkpatch.pl to version 0.19
       [not found] <200806061922.m56JMJuq025990@hera.kernel.org>
@ 2008-06-06 23:30 ` Greg KH
  2008-06-07  6:02   ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2008-06-06 23:30 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: Linux Kernel Mailing List, linux-usb

On Fri, Jun 06, 2008 at 07:22:25PM +0000, Linux Kernel Mailing List wrote:
> @@ -1920,23 +2004,16 @@ sub process {
>  				WARN("kfree(NULL) is safe this check is probabally not required\n" . $hereprev);
>  			}
>  		}
> -# check for needless usb_free_urb() checks
> -		if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
> -			my $expr = $1;
> -			if ($line =~ /\busb_free_urb\(\Q$expr\E\);/) {
> -				WARN("usb_free_urb(NULL) is safe this check is probabally not required\n" . $hereprev);
> -			}
> -		}
>  

I'm curious as to why this check was removed.  Any specific reason?  It
was valid from what I can tell.

thanks,

greg k-h

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

* Re: update checkpatch.pl to version 0.19
  2008-06-06 23:30 ` update checkpatch.pl to version 0.19 Greg KH
@ 2008-06-07  6:02   ` Andrew Morton
  2008-06-07 17:34     ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2008-06-07  6:02 UTC (permalink / raw)
  To: Greg KH; +Cc: Andy Whitcroft, Linux Kernel Mailing List, linux-usb

On Fri, 6 Jun 2008 16:30:37 -0700 Greg KH <greg@kroah.com> wrote:

> On Fri, Jun 06, 2008 at 07:22:25PM +0000, Linux Kernel Mailing List wrote:
> > @@ -1920,23 +2004,16 @@ sub process {
> >  				WARN("kfree(NULL) is safe this check is probabally not required\n" . $hereprev);
> >  			}
> >  		}
> > -# check for needless usb_free_urb() checks
> > -		if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
> > -			my $expr = $1;
> > -			if ($line =~ /\busb_free_urb\(\Q$expr\E\);/) {
> > -				WARN("usb_free_urb(NULL) is safe this check is probabally not required\n" . $hereprev);
> > -			}
> > -		}
> >  
> 
> I'm curious as to why this check was removed.  Any specific reason?  It
> was valid from what I can tell.

Because of the spelling?

If so, let's be consistent:

--- a/scripts/checkpatch.pl~a
+++ a/scripts/checkpatch.pl
@@ -1997,14 +1997,6 @@ sub process {
 				$herecurr);
 		}
 
-# check for needless kfree() checks
-		if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
-			my $expr = $1;
-			if ($line =~ /\bkfree\(\Q$expr\E\);/) {
-				WARN("kfree(NULL) is safe this check is probabally not required\n" . $hereprev);
-			}
-		}
-
 # warn about #ifdefs in C files
 #		if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {
 #			print "#ifdef in C files should be avoided\n";
_


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

* Re: update checkpatch.pl to version 0.19
  2008-06-07  6:02   ` Andrew Morton
@ 2008-06-07 17:34     ` Greg KH
  2008-06-09  8:33       ` Andy Whitcroft
  0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2008-06-07 17:34 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Andy Whitcroft, Linux Kernel Mailing List, linux-usb

On Fri, Jun 06, 2008 at 11:02:39PM -0700, Andrew Morton wrote:
> On Fri, 6 Jun 2008 16:30:37 -0700 Greg KH <greg@kroah.com> wrote:
> 
> > On Fri, Jun 06, 2008 at 07:22:25PM +0000, Linux Kernel Mailing List wrote:
> > > @@ -1920,23 +2004,16 @@ sub process {
> > >  				WARN("kfree(NULL) is safe this check is probabally not required\n" . $hereprev);
> > >  			}
> > >  		}
> > > -# check for needless usb_free_urb() checks
> > > -		if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
> > > -			my $expr = $1;
> > > -			if ($line =~ /\busb_free_urb\(\Q$expr\E\);/) {
> > > -				WARN("usb_free_urb(NULL) is safe this check is probabally not required\n" . $hereprev);
> > > -			}
> > > -		}
> > >  
> > 
> > I'm curious as to why this check was removed.  Any specific reason?  It
> > was valid from what I can tell.
> 
> Because of the spelling?
> 
> If so, let's be consistent:
> 
> --- a/scripts/checkpatch.pl~a
> +++ a/scripts/checkpatch.pl
> @@ -1997,14 +1997,6 @@ sub process {
>  				$herecurr);
>  		}
>  
> -# check for needless kfree() checks
> -		if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
> -			my $expr = $1;
> -			if ($line =~ /\bkfree\(\Q$expr\E\);/) {
> -				WARN("kfree(NULL) is safe this check is probabally not required\n" . $hereprev);
> -			}
> -		}
> -

That's the proverbial baby with the bathwater problem here, we can fix
spelling mistakes pretty easily :)

I'd prefer the original check to be put back, and the kfree(NULL) check
to remain as well, as it too is valid.

But I would like to find out first from Andy why this was removed.  Odds
are he wasn't keeping up with the changes upstream from his local copy,
which also might have caused other things to be removed over time :(

thanks,

greg k-h

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

* Re: update checkpatch.pl to version 0.19
  2008-06-07 17:34     ` Greg KH
@ 2008-06-09  8:33       ` Andy Whitcroft
  2008-06-09 11:09         ` David Woodhouse
  2008-06-09 15:56         ` Roland Dreier
  0 siblings, 2 replies; 8+ messages in thread
From: Andy Whitcroft @ 2008-06-09  8:33 UTC (permalink / raw)
  To: Greg KH; +Cc: Andrew Morton, Linux Kernel Mailing List, linux-usb

On Sat, Jun 07, 2008 at 10:34:36AM -0700, Greg KH wrote:
> On Fri, Jun 06, 2008 at 11:02:39PM -0700, Andrew Morton wrote:
> > On Fri, 6 Jun 2008 16:30:37 -0700 Greg KH <greg@kroah.com> wrote:
> > 
> > > On Fri, Jun 06, 2008 at 07:22:25PM +0000, Linux Kernel Mailing List wrote:
> > > > @@ -1920,23 +2004,16 @@ sub process {
> > > >  				WARN("kfree(NULL) is safe this check is probabally not required\n" . $hereprev);
> > > >  			}
> > > >  		}
> > > > -# check for needless usb_free_urb() checks
> > > > -		if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
> > > > -			my $expr = $1;
> > > > -			if ($line =~ /\busb_free_urb\(\Q$expr\E\);/) {
> > > > -				WARN("usb_free_urb(NULL) is safe this check is probabally not required\n" . $hereprev);
> > > > -			}
> > > > -		}
> > > >  
> > > 
> > > I'm curious as to why this check was removed.  Any specific reason?  It
> > > was valid from what I can tell.
> > 
> > Because of the spelling?
> > 
> > If so, let's be consistent:
> > 
> > --- a/scripts/checkpatch.pl~a
> > +++ a/scripts/checkpatch.pl
> > @@ -1997,14 +1997,6 @@ sub process {
> >  				$herecurr);
> >  		}
> >  
> > -# check for needless kfree() checks
> > -		if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
> > -			my $expr = $1;
> > -			if ($line =~ /\bkfree\(\Q$expr\E\);/) {
> > -				WARN("kfree(NULL) is safe this check is probabally not required\n" . $hereprev);
> > -			}
> > -		}
> > -
> 
> That's the proverbial baby with the bathwater problem here, we can fix
> spelling mistakes pretty easily :)
> 
> I'd prefer the original check to be put back, and the kfree(NULL) check
> to remain as well, as it too is valid.
> 
> But I would like to find out first from Andy why this was removed.  Odds
> are he wasn't keeping up with the changes upstream from his local copy,
> which also might have caused other things to be removed over time :(

That look to be my fault.  Lost something that got merged by some other
route.  I really need a workable solution to the tests problem so I can
work with real per change deltas.

I do try and check things are not removed erroneously.  Seems I did a
poor job on that one tho.  The delta was pretty heafty as I remember, so
I missed it.

The issue I have is I have a comprehensive test suite which is kept in
lock step with checkpatch itself, all in my own tree.  Now that is just
noise for mainline.  What I want to be able to do is keep that in lock
step with developments in my tree, but not merge it upstream.  So far
I've not found a workable solution with git for that.

Anyhow I will sort out where that check has gone and reinstate it.
Perhaps for the next release I will move to pushing Andrew as a set of
patches, not a delta that would stop this occuring again.

-apw

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

* Re: update checkpatch.pl to version 0.19
  2008-06-09  8:33       ` Andy Whitcroft
@ 2008-06-09 11:09         ` David Woodhouse
  2008-06-09 22:58           ` Greg KH
  2008-06-09 15:56         ` Roland Dreier
  1 sibling, 1 reply; 8+ messages in thread
From: David Woodhouse @ 2008-06-09 11:09 UTC (permalink / raw)
  To: Andy Whitcroft
  Cc: Greg KH, Andrew Morton, Linux Kernel Mailing List, linux-usb

On Mon, 2008-06-09 at 09:33 +0100, Andy Whitcroft wrote:
> The issue I have is I have a comprehensive test suite which is kept in
> lock step with checkpatch itself, all in my own tree.  Now that is
> just noise for mainline.  What I want to be able to do is keep that in
> lock step with developments in my tree, but not merge it upstream.  So
> far I've not found a workable solution with git for that.

Why not make a tree which automatically tracks Linus' tree but only
includes checkpatch.pl. Then pull from that into your own tree before
you push your changes back.

-- 
dwmw2


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

* Re: update checkpatch.pl to version 0.19
  2008-06-09  8:33       ` Andy Whitcroft
  2008-06-09 11:09         ` David Woodhouse
@ 2008-06-09 15:56         ` Roland Dreier
  1 sibling, 0 replies; 8+ messages in thread
From: Roland Dreier @ 2008-06-09 15:56 UTC (permalink / raw)
  To: Andy Whitcroft
  Cc: Greg KH, Andrew Morton, Linux Kernel Mailing List, linux-usb

 > The issue I have is I have a comprehensive test suite which is kept in
 > lock step with checkpatch itself, all in my own tree.  Now that is just
 > noise for mainline.  What I want to be able to do is keep that in lock
 > step with developments in my tree, but not merge it upstream.  So far
 > I've not found a workable solution with git for that.

>From my naive point of view: why wouldn't we want a test suite upstream,
if one is already written?

 - R.

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

* Re: update checkpatch.pl to version 0.19
  2008-06-09 11:09         ` David Woodhouse
@ 2008-06-09 22:58           ` Greg KH
  2008-06-11  8:49             ` Andy Whitcroft
  0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2008-06-09 22:58 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Andy Whitcroft, Andrew Morton, Linux Kernel Mailing List,
	linux-usb

On Mon, Jun 09, 2008 at 12:09:41PM +0100, David Woodhouse wrote:
> On Mon, 2008-06-09 at 09:33 +0100, Andy Whitcroft wrote:
> > The issue I have is I have a comprehensive test suite which is kept in
> > lock step with checkpatch itself, all in my own tree.  Now that is
> > just noise for mainline.  What I want to be able to do is keep that in
> > lock step with developments in my tree, but not merge it upstream.  So
> > far I've not found a workable solution with git for that.
> 
> Why not make a tree which automatically tracks Linus' tree but only
> includes checkpatch.pl. Then pull from that into your own tree before
> you push your changes back.

Or just use quilt.  Or git.  Or something that takes into account that
your file will change in the mainline tree.

Keeping code outside the kernel tree and then blindly doing a diff to
generate a patch for submission is never considered a good idea, and
causes real problems, as seen here.

thanks,

greg k-h

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

* Re: update checkpatch.pl to version 0.19
  2008-06-09 22:58           ` Greg KH
@ 2008-06-11  8:49             ` Andy Whitcroft
  0 siblings, 0 replies; 8+ messages in thread
From: Andy Whitcroft @ 2008-06-11  8:49 UTC (permalink / raw)
  To: Greg KH
  Cc: David Woodhouse, Andrew Morton, Linux Kernel Mailing List,
	linux-usb

On Mon, Jun 09, 2008 at 03:58:43PM -0700, Greg KH wrote:
> On Mon, Jun 09, 2008 at 12:09:41PM +0100, David Woodhouse wrote:
> > On Mon, 2008-06-09 at 09:33 +0100, Andy Whitcroft wrote:
> > > The issue I have is I have a comprehensive test suite which is kept in
> > > lock step with checkpatch itself, all in my own tree.  Now that is
> > > just noise for mainline.  What I want to be able to do is keep that in
> > > lock step with developments in my tree, but not merge it upstream.  So
> > > far I've not found a workable solution with git for that.
> > 
> > Why not make a tree which automatically tracks Linus' tree but only
> > includes checkpatch.pl. Then pull from that into your own tree before
> > you push your changes back.
> 
> Or just use quilt.  Or git.  Or something that takes into account that
> your file will change in the mainline tree.
> 
> Keeping code outside the kernel tree and then blindly doing a diff to
> generate a patch for submission is never considered a good idea, and
> causes real problems, as seen here.

Indeed, and I am using git.  It is the fact that the surrounding test
suite is not submitted that means I need to work in a separate tree.  I
have since this incident looked back over the history and yours was the
only change that did not come through me and so the problem has been
restricted to that one change.

But to prevent it occuring again I have rejigged my tree so that I can
simply maintain a real git branch for just the checkpatch changes, in
parallel to the version with the tests.  This then allows me to merge
mainline and handle things correctly.

-apw

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

end of thread, other threads:[~2008-06-11  8:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200806061922.m56JMJuq025990@hera.kernel.org>
2008-06-06 23:30 ` update checkpatch.pl to version 0.19 Greg KH
2008-06-07  6:02   ` Andrew Morton
2008-06-07 17:34     ` Greg KH
2008-06-09  8:33       ` Andy Whitcroft
2008-06-09 11:09         ` David Woodhouse
2008-06-09 22:58           ` Greg KH
2008-06-11  8:49             ` Andy Whitcroft
2008-06-09 15:56         ` Roland Dreier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox