Re: [v4l-dvb-maintainer] [PATCH 3/3] V4L: cinergyT2, remove bad usage of ERESTARTSYS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Manu Abraham schrieb:
Mauro Carvalho Chehab wrote:
Em Qua, 2007-10-10 Ã s 11:59 -0400, Alan Cox escreveu:
On Wed, Oct 10, 2007 at 12:35:41PM -0300, Mauro Carvalho Chehab wrote:
Em Qua, 2007-10-10 Ã s 00:18 -0400, Michael Krufky escreveu:
Is this illegal as per kernel codingstyle?
Yes, it is. CodingStyle states:
No.. "Illegal" means prohibited by law. Its merely wrong 8)

The proper fix is just to replace the offended code by this:

if (error)
	goto error;
Lots of code uses

	if ((err = foo()) < 0)

so I would'y worry too much. The split one however clearer and also
Yes, this is not a severe CodingStyle violation. Still, the above code
is better than the used one.

Since, on your example, it is clear that the programmer wanted to test
if the value is less than zero.
The code:

	if ( (err=foo()) )

should also indicate an operator mistake of using =, instead of ==.

Probably, source code analyzers like Coverity will complain about the

If not violating CodingStyle, I would rather prefer to code this as:
if ( !(err=foo() ) or, even better, using:
	if ( (err=foo()) != 0)

clearly indicating that it is tested if the value is not zero.

Even being a quite simple issue, I would prefer if Jiri can fix it.

When you have only some few lines of code you can write

 err = foo()
 if (err) {
  do whatever
doesn't matter ..

But when you have hell a lot of code, checking error's what you mention is insane.


if ((err = foo()) expr ) is better.


hi manu,

it's not worth discussing this in a way like
"i know something from the past and that was a different solution".

if you look to other parts in that thread like

you will see that they came also to a kind of different solution,
NOT to use the 1-liner for assignment statements.

it's more like a religious/personal discussion how to struct/indent/format code.
and, to state my position for clear,

if kernel coding style document isnt updated to allow the constructions
of code that caused this discussion, we dont have to discuss but follow the rules.

anything else on this topic (coding style and it's sense) is to be discussed on kernel ml.

my 2ct

v4l-dvb-maintainer mailing list
[email protected]

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at
Please read the FAQ at

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux