From: Andy Whitcroft <apw@canonical.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>, Roland McGrath <roland@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [FOR REVIEW, PATCH 2/2] introduce "struct wait_opts" to simplify do_wait() pathes
Date: Mon, 11 May 2009 11:53:54 +0100 [thread overview]
Message-ID: <20090511105354.GB30651@shadowen.org> (raw)
In-Reply-To: <20090509161506.GA8150@redhat.com>
On Sat, May 09, 2009 at 06:15:06PM +0200, Oleg Nesterov wrote:
> (add Andy)
>
> On 05/07, Ingo Molnar wrote:
> >
> > * Oleg Nesterov <oleg@redhat.com> wrote:
> >
> > > On 05/06, Ingo Molnar wrote:
> > > >
> > > > One small nit with the definition above: when using vertical spacing
> > > > (which really looks nice) we tend to put the asterix to the type
> > > > itself, not to the variable. I.e.:
> > > >
> > > > enum pid_type wtype;
> > > > struct pid * wpid;
> > > > int wflags;
My expectation would normally be that this would be written more as:
enum pid_type wtype;
struct pid *wpid;
int wflags;
(more explanation below)
> > > >
> > > > ( This is done to separate the field name from the type - the
> > > > pointer nature of the field is part of the type, not part of the
> > > > name. )
> > >
> > > Indeed, I like this more too. But checkpatch.pl disagrees!
> >
> > That's probably a checkpatch bug mistaking * for multiplication -
> > ignore checkpatch in that case and please report it to Andy
> > Withcroft as well as well.
This is a C'ism. The pointerness is not part of the type in C, where as
it is in C++. In C a char * is a pointer to the type char (classically
written as "char *var"). In C++ char * is of type pointer to char
(classically written as "char* var").
> No, this is not a bug. From scripts/checkpatch.pl
>
> 1667 # Should not end with a space.
> 1668 $to =~ s/\s+$//;
>
> checkpatch explicitely dislikes "type * name". I think this is
> not really right, but I won't insist. Perhaps it is better to
> allow tabs before name at least, because this likely means the
> code really tries ro look good.
So yes the current behaviour is as designed. We are aiming for a
consistent style not necessarily one any of us actually wholy agrees
with. If the right people think this deserves relaxing we can revisit
that decision.
> Btw, can't resist,
>
> while ($to =~ s/\*\s+\*/\*\*/) {
> }
>
> I think this can be simplified to
>
> $to =~ s/(?<=\*)\s+//g;
Heh quite possibly. But the first is enough like line noise for me!
The latter is primarily scary.
> Oleg.
Thanks.
-apw
next prev parent reply other threads:[~2009-05-11 10:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-06 5:33 Oleg Nesterov
2009-05-06 7:27 ` Ingo Molnar
2009-05-07 6:41 ` Oleg Nesterov
2009-05-07 7:54 ` Ingo Molnar
2009-05-09 16:15 ` Oleg Nesterov
2009-05-11 10:53 ` Andy Whitcroft [this message]
2009-05-11 12:43 ` Ingo Molnar
2009-05-06 20:09 ` Roland McGrath
2009-05-07 6:45 ` Oleg Nesterov
2009-05-07 7:20 ` Roland McGrath
2009-05-07 7:40 ` Oleg Nesterov
2009-05-07 7:49 ` Roland McGrath
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=20090511105354.GB30651@shadowen.org \
--to=apw@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@redhat.com \
--cc=roland@redhat.com \
/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
all inboxes | Powered by JetHome®