public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* error from checkpatch.pl version 0.10
@ 2007-09-20 12:56 Tetsuo Handa
  2007-09-20 13:49 ` Satyam Sharma
  0 siblings, 1 reply; 5+ messages in thread
From: Tetsuo Handa @ 2007-09-20 12:56 UTC (permalink / raw)
  To: linux-kernel

Hello.

I checked my patch using checkpatch.pl version 0.10
and I got the following error.

  ERROR: need consistent spacing around '*' (ctx:WxV)
  #2334: FILE: security/tomoyo/common.c:2306:
  +static unsigned int tmy_poll(struct file *file, poll_table *wait)
                                                              ^

What action should I take?
Ignore this error because "poll_table" is used everywhere?
Replace "poll_table" with "struct poll_table_struct" according to
definition of "poll_table"?

  typedef struct poll_table_struct {
          poll_queue_proc qproc;
  } poll_table;

Regards.

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

* Re: error from checkpatch.pl version 0.10
  2007-09-20 12:56 error from checkpatch.pl version 0.10 Tetsuo Handa
@ 2007-09-20 13:49 ` Satyam Sharma
  2007-09-20 14:30   ` Tetsuo Handa
  2007-09-20 15:53   ` Andy Whitcroft
  0 siblings, 2 replies; 5+ messages in thread
From: Satyam Sharma @ 2007-09-20 13:49 UTC (permalink / raw)
  To: Tetsuo Handa; +Cc: Linux Kernel Mailing List, Andy Whitcroft



On Thu, 20 Sep 2007, Tetsuo Handa wrote:
> 
> I checked my patch using checkpatch.pl version 0.10
> and I got the following error.
> 
>   ERROR: need consistent spacing around '*' (ctx:WxV)
>   #2334: FILE: security/tomoyo/common.c:2306:
>   +static unsigned int tmy_poll(struct file *file, poll_table *wait)
>                                                               ^

Looks like a checkpatch.pl bug to me -- that was nothing to warn about.


> What action should I take?
> Ignore this error because "poll_table" is used everywhere?
> Replace "poll_table" with "struct poll_table_struct" according to
> definition of "poll_table"?

Yeah, this would be better to do anyway (and rename poll_table_struct
to just poll_table).

>   typedef struct poll_table_struct {
>           poll_queue_proc qproc;
>   } poll_table;

So:

	struct poll_table {
		poll_queue_proc qproc;
	};

In general the kernel's codingstyle consensus is to avoid adding typedefs.

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

* Re: error from checkpatch.pl version 0.10
  2007-09-20 13:49 ` Satyam Sharma
@ 2007-09-20 14:30   ` Tetsuo Handa
  2007-09-20 15:53   ` Andy Whitcroft
  1 sibling, 0 replies; 5+ messages in thread
From: Tetsuo Handa @ 2007-09-20 14:30 UTC (permalink / raw)
  To: satyam; +Cc: linux-kernel, apw

Hello.

Satyam Sharma wrote:
> Looks like a checkpatch.pl bug to me -- that was nothing to warn about.
I see. I'll wait for next version.

> 	struct poll_table {
> 		poll_queue_proc qproc;
> 	};
poll_table is defined in include/linux/poll.h .
To change this, we have to do "sed -i -e 's:poll_table:struct poll_table:g'"
against all in-tree files atomically.
Also there would be many out-of-tree files using poll_table.
I think it's too difficult to change.

Thank you.

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

* Re: error from checkpatch.pl version 0.10
  2007-09-20 13:49 ` Satyam Sharma
  2007-09-20 14:30   ` Tetsuo Handa
@ 2007-09-20 15:53   ` Andy Whitcroft
  2007-09-21 13:09     ` Jan Engelhardt
  1 sibling, 1 reply; 5+ messages in thread
From: Andy Whitcroft @ 2007-09-20 15:53 UTC (permalink / raw)
  To: Satyam Sharma; +Cc: Tetsuo Handa, Linux Kernel Mailing List

On Thu, Sep 20, 2007 at 07:19:59PM +0530, Satyam Sharma wrote:
> 
> 
> On Thu, 20 Sep 2007, Tetsuo Handa wrote:
> > 
> > I checked my patch using checkpatch.pl version 0.10
> > and I got the following error.
> > 
> >   ERROR: need consistent spacing around '*' (ctx:WxV)
> >   #2334: FILE: security/tomoyo/common.c:2306:
> >   +static unsigned int tmy_poll(struct file *file, poll_table *wait)
> >                                                               ^
> 
> Looks like a checkpatch.pl bug to me -- that was nothing to warn about.

Hmm yeah this is a false positive, its hard to detect correctly.  Some
fool decided to use * as both a unary and binary operator and made life
very hard indeed.  Most kernel defined types end _t to aid recognition.
This one does no.  I may special case it.  Either way ignore its
moaning!

> > What action should I take?
> > Ignore this error because "poll_table" is used everywhere?
> > Replace "poll_table" with "struct poll_table_struct" according to
> > definition of "poll_table"?
> 
> Yeah, this would be better to do anyway (and rename poll_table_struct
> to just poll_table).
> 
> >   typedef struct poll_table_struct {
> >           poll_queue_proc qproc;
> >   } poll_table;
> 
> So:
> 
> 	struct poll_table {
> 		poll_queue_proc qproc;
> 	};
> 
> In general the kernel's codingstyle consensus is to avoid adding typedefs.

-apw

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

* Re: error from checkpatch.pl version 0.10
  2007-09-20 15:53   ` Andy Whitcroft
@ 2007-09-21 13:09     ` Jan Engelhardt
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Engelhardt @ 2007-09-21 13:09 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: Satyam Sharma, Tetsuo Handa, Linux Kernel Mailing List


On Sep 20 2007 16:53, Andy Whitcroft wrote:
>> >   ERROR: need consistent spacing around '*' (ctx:WxV)
>> >   #2334: FILE: security/tomoyo/common.c:2306:
>> >   +static unsigned int tmy_poll(struct file *file, poll_table *wait)
>> >                                                               ^
>> 
>> Looks like a checkpatch.pl bug to me -- that was nothing to warn about.
>
>Hmm yeah this is a false positive, its hard to detect correctly.  Some
>fool decided to use * as both a unary and binary operator and made life
>very hard indeed.

The C parser has no problem with it :p
It is simple: there cannot be a binary * operator in the argument list.

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

end of thread, other threads:[~2007-09-21 13:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-20 12:56 error from checkpatch.pl version 0.10 Tetsuo Handa
2007-09-20 13:49 ` Satyam Sharma
2007-09-20 14:30   ` Tetsuo Handa
2007-09-20 15:53   ` Andy Whitcroft
2007-09-21 13:09     ` Jan Engelhardt

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