netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] checkpatch.pl: Fix warnings on code comments
@ 2013-01-27 11:35 Jeff Kirsher
  2013-01-27 17:11 ` [PATCH] checkpatch.pl: Fix warnings on (networking specific) " Joe Perches
  2013-01-27 23:59 ` [PATCH] checkpatch.pl: Fix warnings on " David Miller
  0 siblings, 2 replies; 8+ messages in thread
From: Jeff Kirsher @ 2013-01-27 11:35 UTC (permalink / raw)
  To: apw; +Cc: Jeff Kirsher, linux-kernel, davem, netdev

The following commit:
commit 058806007450489bb8f457b275e5cb5c946320c1
Author: Joe Perches <joe@perches.com>
Date:   Thu Oct 4 17:13:35 2012 -0700

checkpatch: check networking specific block comment style

Produces warnings on code comments which follow the Linux coding style
guide.  While the desired code comment style for networking my differ
from the rest of the kernel, both styles should be permitted.

This patch reverts a portion of the commit to allow multi-line code
comments to use either style.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
---
 scripts/checkpatch.pl | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 4d2c7df..d3ffec5 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1878,13 +1878,6 @@ sub process {
 		}
 
 		if ($realfile =~ m@^(drivers/net/|net/)@ &&
-		    $rawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
-		    $prevrawline =~ /^\+[ \t]*$/) {
-			WARN("NETWORKING_BLOCK_COMMENT_STYLE",
-			     "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);
-		}
-
-		if ($realfile =~ m@^(drivers/net/|net/)@ &&
 		    $rawline !~ m@^\+[ \t]*\*/[ \t]*$@ &&	#trailing */
 		    $rawline !~ m@^\+.*/\*.*\*/[ \t]*$@ &&	#inline /*...*/
 		    $rawline !~ m@^\+.*\*{2,}/[ \t]*$@ &&	#trailing **/
-- 
1.7.11.7

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

* Re: [PATCH] checkpatch.pl: Fix warnings on (networking specific) code comments
  2013-01-27 11:35 [PATCH] checkpatch.pl: Fix warnings on code comments Jeff Kirsher
@ 2013-01-27 17:11 ` Joe Perches
  2013-01-27 23:59 ` [PATCH] checkpatch.pl: Fix warnings on " David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: Joe Perches @ 2013-01-27 17:11 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: apw, linux-kernel, davem, netdev, Andrew Morton

On Sun, 2013-01-27 at 03:35 -0800, Jeff Kirsher wrote:
> This patch reverts a portion of the commit to allow multi-line code
> comments to use either style.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -1878,13 +1878,6 @@ sub process {
>  		}
>  
>  		if ($realfile =~ m@^(drivers/net/|net/)@ &&
> -		    $rawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
> -		    $prevrawline =~ /^\+[ \t]*$/) {
> -			WARN("NETWORKING_BLOCK_COMMENT_STYLE",
> -			     "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);
> -		}
> -
> -		if ($realfile =~ m@^(drivers/net/|net/)@ &&
>  		    $rawline !~ m@^\+[ \t]*\*/[ \t]*$@ &&	#trailing */
>  		    $rawline !~ m@^\+.*/\*.*\*/[ \t]*$@ &&	#inline /*...*/
>  		    $rawline !~ m@^\+.*\*{2,}/[ \t]*$@ &&	#trailing **/

Shrug.

Ignore things you don't agree with.

David has written many, many emails
requesting changes for this specific
comment style.

I think you and Intel should use
--ignore=NETWORKING_BLOCK_COMMENT_STYLE
to avoid seeing this if you don't agree
with it.

I also think expectations that everyone
will agree with every checkpatch bleat
are unrealistic.

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

* Re: [PATCH] checkpatch.pl: Fix warnings on code comments
  2013-01-27 11:35 [PATCH] checkpatch.pl: Fix warnings on code comments Jeff Kirsher
  2013-01-27 17:11 ` [PATCH] checkpatch.pl: Fix warnings on (networking specific) " Joe Perches
@ 2013-01-27 23:59 ` David Miller
  2013-01-28  2:56   ` Jeff Kirsher
  1 sibling, 1 reply; 8+ messages in thread
From: David Miller @ 2013-01-27 23:59 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: apw, linux-kernel, netdev

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Sun, 27 Jan 2013 03:35:39 -0800

> Produces warnings on code comments which follow the Linux coding style
> guide.  While the desired code comment style for networking my differ
> from the rest of the kernel, both styles should be permitted.

I was actually going to mention to you guys that I've been lackadasical
about enforcing the comment style I want with the Intel drivers.

That was a mistake, I should have enforced it strictly, as I do for
the other drivers and the core networking code, from the beginning.

And it's clearly a mistake if you feel the need to take out the very
checkpatch working that's meant to enforce this comment style in all
of the networking drivers and core.

Do not revert this, follow it's advice instead.

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

* Re: [PATCH] checkpatch.pl: Fix warnings on code comments
  2013-01-27 23:59 ` [PATCH] checkpatch.pl: Fix warnings on " David Miller
@ 2013-01-28  2:56   ` Jeff Kirsher
  2013-01-28  3:07     ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Kirsher @ 2013-01-28  2:56 UTC (permalink / raw)
  To: David Miller; +Cc: apw, linux-kernel, netdev

[-- Attachment #1: Type: text/plain, Size: 1259 bytes --]

On Sun, 2013-01-27 at 18:59 -0500, David Miller wrote:
> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Date: Sun, 27 Jan 2013 03:35:39 -0800
> 
> > Produces warnings on code comments which follow the Linux coding style
> > guide.  While the desired code comment style for networking my differ
> > from the rest of the kernel, both styles should be permitted.
> 
> I was actually going to mention to you guys that I've been lackadasical
> about enforcing the comment style I want with the Intel drivers.
> 
> That was a mistake, I should have enforced it strictly, as I do for
> the other drivers and the core networking code, from the beginning.
> 
> And it's clearly a mistake if you feel the need to take out the very
> checkpatch working that's meant to enforce this comment style in all
> of the networking drivers and core.
> 
> Do not revert this, follow it's advice instead.

Ok, I am fine with that.  I just had not seen any emails/responses that
this was direction you wanted to go.

So will you be fine with cleanup patches which go through and convert
all the existing code comments to the desired format?  If so, I will get
started on patches to cleanup,convert the Intel drivers to the desired
code comment style.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] checkpatch.pl: Fix warnings on code comments
  2013-01-28  2:56   ` Jeff Kirsher
@ 2013-01-28  3:07     ` David Miller
  2013-01-28 17:17       ` Allan, Bruce W
  0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2013-01-28  3:07 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: apw, linux-kernel, netdev

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Sun, 27 Jan 2013 18:56:45 -0800

> So will you be fine with cleanup patches which go through and
> convert all the existing code comments to the desired format?

Sure.

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

* RE: [PATCH] checkpatch.pl: Fix warnings on code comments
  2013-01-28  3:07     ` David Miller
@ 2013-01-28 17:17       ` Allan, Bruce W
  2013-01-28 17:30         ` Joe Perches
  0 siblings, 1 reply; 8+ messages in thread
From: Allan, Bruce W @ 2013-01-28 17:17 UTC (permalink / raw)
  To: David Miller, Kirsher, Jeffrey T
  Cc: apw@canonical.com, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org

> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-
> owner@vger.kernel.org] On Behalf Of David Miller
> Sent: Sunday, January 27, 2013 7:07 PM
> To: Kirsher, Jeffrey T
> Cc: apw@canonical.com; linux-kernel@vger.kernel.org;
> netdev@vger.kernel.org
> Subject: Re: [PATCH] checkpatch.pl: Fix warnings on code comments
> 
> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Date: Sun, 27 Jan 2013 18:56:45 -0800
> 
> > So will you be fine with cleanup patches which go through and
> > convert all the existing code comments to the desired format?
> 
> Sure.

Not all Intel drivers...e1000e already conforms to the comment style :-)

Bruce.

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

* Re: [PATCH] checkpatch.pl: Fix warnings on code comments
  2013-01-28 17:17       ` Allan, Bruce W
@ 2013-01-28 17:30         ` Joe Perches
  2013-01-28 20:56           ` Jeff Kirsher
  0 siblings, 1 reply; 8+ messages in thread
From: Joe Perches @ 2013-01-28 17:30 UTC (permalink / raw)
  To: Allan, Bruce W
  Cc: David Miller, Kirsher, Jeffrey T, apw@canonical.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org

On Mon, 2013-01-28 at 17:17 +0000, Allan, Bruce W wrote:
> David Miller Sent: Sunday, January 27, 2013 7:07 PM
> > From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > > So will you be fine with cleanup patches which go through and
> > > convert all the existing code comments to the desired format?
> > Sure.
> Not all Intel drivers...e1000e already conforms to the comment style :-)

In case anyone cares, here's a perl regex
to do network comment style conversion.

	$text =~ s@/\*[ \t]*\n[ \t]*\*@/*@g;
	$text =~ s@/\*([ \t]*)([^\n]+)\n[ \t]*\*/@/\*$1$2 \*/@g;

(assumes the entire file is in $text)

It creates a ~220KB diff for drivers/net/ethernet/intel/
that I won't post.

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

* Re: [PATCH] checkpatch.pl: Fix warnings on code comments
  2013-01-28 17:30         ` Joe Perches
@ 2013-01-28 20:56           ` Jeff Kirsher
  0 siblings, 0 replies; 8+ messages in thread
From: Jeff Kirsher @ 2013-01-28 20:56 UTC (permalink / raw)
  To: Joe Perches
  Cc: Allan, Bruce W, David Miller, apw@canonical.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 937 bytes --]

On Mon, 2013-01-28 at 09:30 -0800, Joe Perches wrote:
> On Mon, 2013-01-28 at 17:17 +0000, Allan, Bruce W wrote:
> > David Miller Sent: Sunday, January 27, 2013 7:07 PM
> > > From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > > > So will you be fine with cleanup patches which go through and
> > > > convert all the existing code comments to the desired format?
> > > Sure.
> > Not all Intel drivers...e1000e already conforms to the comment style :-)
> 
> In case anyone cares, here's a perl regex
> to do network comment style conversion.
> 
>         $text =~ s@/\*[ \t]*\n[ \t]*\*@/*@g;
>         $text =~ s@/\*([ \t]*)([^\n]+)\n[ \t]*\*/@/\*$1$2 \*/@g;
> 
> (assumes the entire file is in $text)
> 
> It creates a ~220KB diff for drivers/net/ethernet/intel/
> that I won't post.
> 

Thanks Joe, I will get patches to take care of the Intel drivers (minus
e1000e since Bruce has already completed that work).

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2013-01-28 20:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-27 11:35 [PATCH] checkpatch.pl: Fix warnings on code comments Jeff Kirsher
2013-01-27 17:11 ` [PATCH] checkpatch.pl: Fix warnings on (networking specific) " Joe Perches
2013-01-27 23:59 ` [PATCH] checkpatch.pl: Fix warnings on " David Miller
2013-01-28  2:56   ` Jeff Kirsher
2013-01-28  3:07     ` David Miller
2013-01-28 17:17       ` Allan, Bruce W
2013-01-28 17:30         ` Joe Perches
2013-01-28 20:56           ` Jeff Kirsher

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