public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Németh Márton" <nm127@freemail.hu>
To: Andy Whitcroft <apw@shadowen.org>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Joel Schopp <jschopp@austin.ibm.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: confusing checkpatch.pl messages
Date: Tue, 06 Jan 2009 21:57:36 +0100	[thread overview]
Message-ID: <4963C5C0.2080304@freemail.hu> (raw)

[-- 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,
};


             reply	other threads:[~2009-01-06 20:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-06 20:57 Németh Márton [this message]
2009-01-07  0:41 ` confusing checkpatch.pl messages Robert Hancock
2009-01-08  0:23 ` Andy Whitcroft

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4963C5C0.2080304@freemail.hu \
    --to=nm127@freemail.hu \
    --cc=apw@shadowen.org \
    --cc=jschopp@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox