public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* confusing checkpatch.pl messages
@ 2009-01-06 20:57 Németh Márton
  2009-01-07  0:41 ` Robert Hancock
  2009-01-08  0:23 ` Andy Whitcroft
  0 siblings, 2 replies; 3+ messages in thread
From: Németh Márton @ 2009-01-06 20:57 UTC (permalink / raw)
  To: Andy Whitcroft, Randy Dunlap, Joel Schopp; +Cc: LKML

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

Hi,

I run the checkpatch.pl against the attache file and it reported some
confusing warning and error messages. The attached file has an obsoleted
syntax:

>From "info gcc", Chapter 5.21 "Designated Initializers":
>  In a structure initializer, specify the name of a field to initialize
> with `.FIELDNAME =' before the element value.  For example, given the
> following structure,
>
>      struct point { int x, y; };
>
> the following initialization
>
>      struct point p = { .y = yvalue, .x = xvalue };
>
> is equivalent to
>
>      struct point p = { xvalue, yvalue };
>
>  Another syntax which has the same meaning, obsolete since GCC 2.5, is
> `FIELDNAME:', as shown here:
>
>     struct point p = { y: yvalue, x: xvalue };

However, the checkpatch.pl speaks about labels, which are incorrect, I think:
> $ /usr/src/linux/scripts/checkpatch.pl --file test.c
> WARNING: labels should not be indented
> #5: FILE: test.c:5:
> +       open: test_open,
>
> ERROR: spaces required around that ':' (ctx:VxW)
> #6: FILE: test.c:6:
> +       release: test_close,
>                ^
>
> WARNING: labels should not be indented
> #6: FILE: test.c:6:
> +       release: test_close,
>
> ERROR: spaces required around that ':' (ctx:VxW)
> #7: FILE: test.c:7:
> +       ioctl: test_ioctl,
>              ^
>
> WARNING: labels should not be indented
> #7: FILE: test.c:7:
> +       ioctl: test_ioctl,
>
> total: 2 errors, 3 warnings, 9 lines checked
>
> test.c has style problems, please review.  If any of these errors
> are false positives report them to the maintainer, see
> CHECKPATCH in MAINTAINERS.

Regards,

	Márton Németh

[-- Attachment #2: test.c --]
[-- Type: text/x-csrc, Size: 140 bytes --]


#include <linux/blkdev.h>

static struct block_device_operations bdops = {
	open: test_open,
	release: test_close,
	ioctl: test_ioctl,
};


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

* Re: confusing checkpatch.pl messages
  2009-01-06 20:57 confusing checkpatch.pl messages Németh Márton
@ 2009-01-07  0:41 ` Robert Hancock
  2009-01-08  0:23 ` Andy Whitcroft
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Hancock @ 2009-01-07  0:41 UTC (permalink / raw)
  To: Németh Márton; +Cc: Andy Whitcroft, Randy Dunlap, Joel Schopp, LKML

Németh Márton wrote:
> Hi,
> 
> I run the checkpatch.pl against the attache file and it reported some
> confusing warning and error messages. The attached file has an obsoleted
> syntax:
> 
> From "info gcc", Chapter 5.21 "Designated Initializers":
>>  In a structure initializer, specify the name of a field to initialize
>> with `.FIELDNAME =' before the element value.  For example, given the
>> following structure,
>>
>>      struct point { int x, y; };
>>
>> the following initialization
>>
>>      struct point p = { .y = yvalue, .x = xvalue };
>>
>> is equivalent to
>>
>>      struct point p = { xvalue, yvalue };
>>
>>  Another syntax which has the same meaning, obsolete since GCC 2.5, is
>> `FIELDNAME:', as shown here:
>>
>>     struct point p = { y: yvalue, x: xvalue };
> 
> However, the checkpatch.pl speaks about labels, which are incorrect, I think:
>> $ /usr/src/linux/scripts/checkpatch.pl --file test.c
>> WARNING: labels should not be indented
>> #5: FILE: test.c:5:
>> +       open: test_open,

Well, the warning message is wrong, that part is presumably a bug. It's 
right to complain, though, as that obsolete syntax shouldn't be used.

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

* Re: confusing checkpatch.pl messages
  2009-01-06 20:57 confusing checkpatch.pl messages Németh Márton
  2009-01-07  0:41 ` Robert Hancock
@ 2009-01-08  0:23 ` Andy Whitcroft
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Whitcroft @ 2009-01-08  0:23 UTC (permalink / raw)
  To: Németh Márton; +Cc: LKML

On Tue, Jan 06, 2009 at 09:57:36PM +0100, Németh Márton wrote:
> Hi,
> 
> I run the checkpatch.pl against the attache file and it reported some
> confusing warning and error messages. The attached file has an obsoleted
> syntax:
[...]
> >     struct point p = { y: yvalue, x: xvalue };
> 
> However, the checkpatch.pl speaks about labels, which are incorrect, I think:

Yeah that is the wrong error for sure.  Will see if I can stop it doing
that and emit something more sensible.

-apw

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

end of thread, other threads:[~2009-01-08  0:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-06 20:57 confusing checkpatch.pl messages Németh Márton
2009-01-07  0:41 ` Robert Hancock
2009-01-08  0:23 ` Andy Whitcroft

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