mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Michael Krufky <mkrufky@linuxtv.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
	Jiri Slaby <jirislaby@gmail.com>,
	video4linux-list@redhat.com, daniel@qanu.de,
	linux-kernel@vger.kernel.org, holger@qanu.de,
	v4l-dvb maintainer list <v4l-dvb-maintainer@linuxtv.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [v4l-dvb-maintainer] [PATCH 3/3] V4L: cinergyT2, remove bad usage of ERESTARTSYS
Date: Thu, 11 Oct 2007 21:29:21 -0700	[thread overview]
Message-ID: <20071011212921.f97c8423.randy.dunlap@oracle.com> (raw)
In-Reply-To: <470C5294.8060502@linuxtv.org>

On Wed, 10 Oct 2007 00:18:28 -0400 Michael Krufky wrote:

> Mauro Carvalho Chehab wrote:
> > Hi Jiri,
> >
> > Em Seg, 2007-10-08 às 13:41 +0100, Jiri Slaby escreveu:
> >   
> >> cinergyT2, remove bad usage of ERESTARTSYS
> >>
> >> test of cinergyt2->disconnect_pending doesn't ensure pending signal and so
> >> ERESTARTSYS would reach userspace, which is not permitted. Change it to
> >> EAGAIN
> >>
> >>     
> >
> > checkpatch.pl is complaining about your changeset:
> >
> > do not use assignment in if condition
> > #82: FILE: drivers/media/dvb/cinergyT2/cinergyT2.c:492:
> > +     if ((err = mutex_lock_interruptible(&cinergyt2->wq_sem)))
> >
> > do not use assignment in if condition
> > #86: FILE: drivers/media/dvb/cinergyT2/cinergyT2.c:495:
> > +     if ((err = mutex_lock_interruptible(&cinergyt2->sem)))
> >
> > do not use assignment in if condition
> > #133: FILE: drivers/media/dvb/cinergyT2/cinergyT2.c:1036:
> > +     if ((err = mutex_lock_interruptible(&cinergyt2->wq_sem)))
> >
> > do not use assignment in if condition
> > #137: FILE: drivers/media/dvb/cinergyT2/cinergyT2.c:1039:
> > +     if ((err = mutex_lock_interruptible(&cinergyt2->sem)))
> 
> Is this illegal as per kernel codingstyle?  I could understand if we may
> want to avoid this sort of thing for the sake of code readability, but
> this seems 100% proper to me, especially considering that we're simply
> trying to catch an error return code.

Anyway, it's not strictly from CodingStyle.  The closest that
CodingStyle has to say about it IMO is this:

"Don't put multiple assignments on a single line either.  Kernel coding style
is super simple.  Avoid tricky expressions."

Also, Andrew Morton and Christoph Hellwig push for splitting up
the if-assignment lines, so it's a trend over the past few
(probably) years.  It's not real new.


> One of the things that I really enjoy about the c programming language
> is the fact that you can string many operations together into a single
> statement through the use of logic.  I hate the thought of a patch being
> nacked because of the above.  :-/

so you like the challenge of reading obfuscated code?

At any rate, it's rare that a patch is nacked only due to coding style,
unless it's blatant and occurs many times (like throughout the entire
source file).


> If this is indeed kernel codingstyle, then IMHO, we should let it slide
> for catching error return codes.

Nope.

---
~Randy

  parent reply	other threads:[~2007-10-12  4:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-08 12:33 [PATCH 1/3] V4L: w9968cf, " Jiri Slaby
2007-10-08 12:34 ` [PATCH 2/3] V4L: zc0301, " Jiri Slaby
2007-10-10  0:18   ` Luca Risolia
2007-10-08 12:34 ` [PATCH 3/3] V4L: cinergyT2, " Jiri Slaby
2007-10-10  1:21   ` Mauro Carvalho Chehab
2007-10-10  4:18     ` [v4l-dvb-maintainer] " Michael Krufky
2007-10-10 15:35       ` Mauro Carvalho Chehab
2007-10-10 15:59         ` Alan Cox
2007-10-10 16:17           ` Mauro Carvalho Chehab
2007-10-10 16:40             ` Manu Abraham
2007-10-10 16:53               ` Marcel Siegert
2007-10-10 17:05                 ` Manu Abraham
2007-10-10 18:04                   ` Marcel Siegert
2007-10-12  4:29       ` Randy Dunlap [this message]
2007-10-10  0:18 ` [PATCH 1/3] V4L: w9968cf, " Luca Risolia
2007-10-14 14:28 ` [PATCH 1/1 try 2] V4L: cinergyT2, " Jiri Slaby

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=20071011212921.f97c8423.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=daniel@qanu.de \
    --cc=holger@qanu.de \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=mkrufky@linuxtv.org \
    --cc=v4l-dvb-maintainer@linuxtv.org \
    --cc=video4linux-list@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

Powered by JetHome