linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [checkpatch] - Confusion
@ 2013-06-10  5:51 PINTU KUMAR
  2013-06-10  5:58 ` anish singh
  0 siblings, 1 reply; 6+ messages in thread
From: PINTU KUMAR @ 2013-06-10  5:51 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org, linux-mm@kvack.org

Hi,

I wanted to submit my first patch.
But I have some confusion about the /scripts/checkpatch.pl errors.

After correcting some checkpatch errors, when I run checkpatch.pl, it showed me 0 errors.
But when I create patches are git format-patch, it is showing me 1 error.

If I fix error in patch, it showed me back again in files.

Now, I am confused which error to fix while submitting patches, the file or the patch errors.

Please provide your opinion.

File: mm/page_alloc.c
Previous file errors:
total: 16 errors, 110 warnings, 6255 lines checked

After fixing errors:
total: 0 errors, 105 warnings, 6255 lines checked


And, after running on patch:
ERROR: need consistent spacing around '*' (ctx:WxV)
#153: FILE: mm/page_alloc.c:5476:
+int min_free_kbytes_sysctl_handler(ctl_table *table, int write,




- Pintu

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [checkpatch] - Confusion
  2013-06-10  5:51 [checkpatch] - Confusion PINTU KUMAR
@ 2013-06-10  5:58 ` anish singh
  2013-06-10 18:49   ` PINTU KUMAR
  0 siblings, 1 reply; 6+ messages in thread
From: anish singh @ 2013-06-10  5:58 UTC (permalink / raw)
  To: PINTU KUMAR; +Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org

On Mon, Jun 10, 2013 at 11:21 AM, PINTU KUMAR <pintu_agarwal@yahoo.com> wrote:
> Hi,
>
> I wanted to submit my first patch.
> But I have some confusion about the /scripts/checkpatch.pl errors.
>
> After correcting some checkpatch errors, when I run checkpatch.pl, it showed me 0 errors.
> But when I create patches are git format-patch, it is showing me 1 error.
did  you run the checkpatch.pl on the file which gets created
after git format-patch?
If yes, then I think it is not necessary.You can use git-am to apply
your own patch on a undisturbed file and if it applies properly then
you are good to go i.e. you can send your patch.
>
> If I fix error in patch, it showed me back again in files.
>
> Now, I am confused which error to fix while submitting patches, the file or the patch errors.
>
> Please provide your opinion.
>
> File: mm/page_alloc.c
> Previous file errors:
> total: 16 errors, 110 warnings, 6255 lines checked
>
> After fixing errors:
> total: 0 errors, 105 warnings, 6255 lines checked
>
>
> And, after running on patch:
> ERROR: need consistent spacing around '*' (ctx:WxV)
> #153: FILE: mm/page_alloc.c:5476:
> +int min_free_kbytes_sysctl_handler(ctl_table *table, int write,
>
>
>
>
> - Pintu
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [checkpatch] - Confusion
  2013-06-10  5:58 ` anish singh
@ 2013-06-10 18:49   ` PINTU KUMAR
  2013-06-12  0:54     ` Sören Brinkmann
  0 siblings, 1 reply; 6+ messages in thread
From: PINTU KUMAR @ 2013-06-10 18:49 UTC (permalink / raw)
  To: anish singh; +Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org

>________________________________
> From: anish singh <anish198519851985@gmail.com>
>To: PINTU KUMAR <pintu_agarwal@yahoo.com> 
>Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>; "linux-mm@kvack.org" <linux-mm@kvack.org> 
>Sent: Sunday, 9 June 2013 10:58 PM
>Subject: Re: [checkpatch] - Confusion
> 
>
>On Mon, Jun 10, 2013 at 11:21 AM, PINTU KUMAR <pintu_agarwal@yahoo.com> wrote:
>> Hi,
>>
>> I wanted to submit my first patch.
>> But I have some confusion about the /scripts/checkpatch.pl errors.
>>
>> After correcting some checkpatch errors, when I run checkpatch.pl, it showed me 0 errors.
>> But when I create patches are git format-patch, it is showing me 1 error.
>did  you run the checkpatch.pl on the file which gets created
>after git format-patch?
>If yes, then I think it is not necessary.You can use git-am to apply
>your own patch on a undisturbed file and if it applies properly then
>you are good to go i.e. you can send your patch.

Yes, first I ran checkpatch directly on the file(mm/page_alloc.c) and fixed all the errors.
It showed me (0) errors.
Then I created a patch using _git format-patch_ and ran checkpatch again on the created patch.
But now it is showing me 1 error.
According to me this error is false positive (irrelevant), because I did not change anything related to the error and also the similar change already exists somewhere else too.
Do you mean, shall I go ahead and submit the patch with this 1 error??
ERROR: need consistent spacing around '*' (ctx:WxV)

#153: FILE: mm/page_alloc.c:5476:
+int min_free_kbytes_sysctl_handler(ctl_table *table, int write,



>>
>> If I fix error in patch, it showed me back again in files.
>>
>> Now, I am confused which error to fix while submitting patches, the file or the patch errors.
>>
>> Please provide your opinion.
>>
>> File: mm/page_alloc.c
>> Previous file errors:
>> total: 16 errors, 110 warnings, 6255 lines checked
>>
>> After fixing errors:
>> total: 0 errors, 105 warnings, 6255 lines checked
>>
>>
>> And, after running on patch:
>> ERROR: need consistent spacing around '*' (ctx:WxV)
>> #153: FILE: mm/page_alloc.c:5476:
>> +int min_free_kbytes_sysctl_handler(ctl_table *table, int write,
>>
>>
>>
>>
>> - Pintu
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>
>--
>To unsubscribe, send a message with 'unsubscribe linux-mm' in
>the body to majordomo@kvack.org.  For more info on Linux MM,
>see: http://www.linux-mm.org/ .
>Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>
>
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [checkpatch] - Confusion
  2013-06-10 18:49   ` PINTU KUMAR
@ 2013-06-12  0:54     ` Sören Brinkmann
  2013-06-12  4:15       ` Joe Perches
  0 siblings, 1 reply; 6+ messages in thread
From: Sören Brinkmann @ 2013-06-12  0:54 UTC (permalink / raw)
  To: PINTU KUMAR, Andy Whitcroft, Joe Perches
  Cc: anish singh, linux-kernel@vger.kernel.org, linux-mm@kvack.org

Hi Pintu,

On Mon, Jun 10, 2013 at 11:49:00AM -0700, PINTU KUMAR wrote:
> >________________________________
> > From: anish singh <anish198519851985@gmail.com>
> >To: PINTU KUMAR <pintu_agarwal@yahoo.com> 
> >Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>; "linux-mm@kvack.org" <linux-mm@kvack.org> 
> >Sent: Sunday, 9 June 2013 10:58 PM
> >Subject: Re: [checkpatch] - Confusion
> > 
> >
> >On Mon, Jun 10, 2013 at 11:21 AM, PINTU KUMAR <pintu_agarwal@yahoo.com> wrote:
> >> Hi,
> >>
> >> I wanted to submit my first patch.
> >> But I have some confusion about the /scripts/checkpatch.pl errors.
> >>
> >> After correcting some checkpatch errors, when I run checkpatch.pl, it showed me 0 errors.
> >> But when I create patches are git format-patch, it is showing me 1 error.
> >did  you run the checkpatch.pl on the file which gets created
> >after git format-patch?
> >If yes, then I think it is not necessary.You can use git-am to apply
> >your own patch on a undisturbed file and if it applies properly then
> >you are good to go i.e. you can send your patch.
> 
> Yes, first I ran checkpatch directly on the file(mm/page_alloc.c) and fixed all the errors.
> It showed me (0) errors.
> Then I created a patch using _git format-patch_ and ran checkpatch again on the created patch.
> But now it is showing me 1 error.
> According to me this error is false positive (irrelevant), because I did not change anything related to the error and also the similar change already exists somewhere else too.
> Do you mean, shall I go ahead and submit the patch with this 1 error??
> ERROR: need consistent spacing around '*' (ctx:WxV)
> 
> #153: FILE: mm/page_alloc.c:5476:
> +int min_free_kbytes_sysctl_handler(ctl_table *table, int write,
Rather a shot into the dark, but it looks like checkpatch is
misinterpreting 'ctl_table' as an arithmetic operand instead of a type.
I don't know how checkpatch learns about types created by typedefs, but
my guess is, that this line
	typedef struct ctl_table ctl_table; (include/linux/sysctl.h)
is not correctly picked up by checkpatch.
So, I assume this actually is a false positive.

	Sören


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [checkpatch] - Confusion
  2013-06-12  0:54     ` Sören Brinkmann
@ 2013-06-12  4:15       ` Joe Perches
  2013-06-12  4:48         ` Joe Perches
  0 siblings, 1 reply; 6+ messages in thread
From: Joe Perches @ 2013-06-12  4:15 UTC (permalink / raw)
  To: Sören Brinkmann
  Cc: PINTU KUMAR, Andy Whitcroft, anish singh,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org

On Tue, 2013-06-11 at 17:54 -0700, Soren Brinkmann wrote:
> Hi Pintu,
> 
> On Mon, Jun 10, 2013 at 11:49:00AM -0700, PINTU KUMAR wrote:
> > >________________________________
> > > From: anish singh <anish198519851985@gmail.com>
> > >To: PINTU KUMAR <pintu_agarwal@yahoo.com> 
> > >Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>; "linux-mm@kvack.org" <linux-mm@kvack.org> 
> > >Sent: Sunday, 9 June 2013 10:58 PM
> > >Subject: Re: [checkpatch] - Confusion
> > > 
> > >
> > >On Mon, Jun 10, 2013 at 11:21 AM, PINTU KUMAR <pintu_agarwal@yahoo.com> wrote:
> > >> Hi,
> > >>
> > >> I wanted to submit my first patch.
> > >> But I have some confusion about the /scripts/checkpatch.pl errors.
> > >>
> > >> After correcting some checkpatch errors, when I run checkpatch.pl, it showed me 0 errors.
> > >> But when I create patches are git format-patch, it is showing me 1 error.
> > >did  you run the checkpatch.pl on the file which gets created
> > >after git format-patch?
> > >If yes, then I think it is not necessary.You can use git-am to apply
> > >your own patch on a undisturbed file and if it applies properly then
> > >you are good to go i.e. you can send your patch.
> > 
> > Yes, first I ran checkpatch directly on the file(mm/page_alloc.c) and fixed all the errors.
> > It showed me (0) errors.
> > Then I created a patch using _git format-patch_ and ran checkpatch again on the created patch.
> > But now it is showing me 1 error.
> > According to me this error is false positive (irrelevant), because I did not change anything related to the error and also the similar change already exists somewhere else too.
> > Do you mean, shall I go ahead and submit the patch with this 1 error??
> > ERROR: need consistent spacing around '*' (ctx:WxV)
> > 
> > #153: FILE: mm/page_alloc.c:5476:
> > +int min_free_kbytes_sysctl_handler(ctl_table *table, int write,
> Rather a shot into the dark, but it looks like checkpatch is
> misinterpreting 'ctl_table' as an arithmetic operand instead of a type.
> I don't know how checkpatch learns about types created by typedefs, but
> my guess is, that this line
> 	typedef struct ctl_table ctl_table; (include/linux/sysctl.h)
> is not correctly picked up by checkpatch.

checkpatch isn't a c compiler.
It assumes any <foo>_t is a typedef.

> So, I assume this actually is a false positive.

Yup.

Maybe this would work?
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b954de5..e673bec 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -264,7 +264,7 @@ our $UTF8	= qr{
 
 our $typeTypedefs = qr{(?x:
 	(?:__)?(?:u|s|be|le)(?:8|16|32|64)|
-	atomic_t
+	atomic_t|ctl_table
 )};
 
 our $logFunctions = qr{(?x:


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [checkpatch] - Confusion
  2013-06-12  4:15       ` Joe Perches
@ 2013-06-12  4:48         ` Joe Perches
  0 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2013-06-12  4:48 UTC (permalink / raw)
  To: Sören Brinkmann
  Cc: PINTU KUMAR, Andy Whitcroft, anish singh,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org

On Tue, 2013-06-11 at 21:15 -0700, Joe Perches wrote:

> > 	typedef struct ctl_table ctl_table; (include/linux/sysctl.h)
> > is not correctly picked up by checkpatch.
> 
> checkpatch isn't a c compiler.
> It assumes any <foo>_t is a typedef.
> 
> > So, I assume this actually is a false positive.
> 
> Yup.

Another option is to use "struct ctl_table" instead of bare ctl_table.


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2013-06-12  4:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-10  5:51 [checkpatch] - Confusion PINTU KUMAR
2013-06-10  5:58 ` anish singh
2013-06-10 18:49   ` PINTU KUMAR
2013-06-12  0:54     ` Sören Brinkmann
2013-06-12  4:15       ` Joe Perches
2013-06-12  4:48         ` Joe Perches

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