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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mauro Carvalho Chehab
Date: Wednesday, October 10, 2007 - 9:17 am

Em Qua, 2007-10-10 às 11:59 -0400, Alan Cox escreveu:

LOL


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
above.

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.

-- 
Cheers,
Mauro

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 3/3] V4L: cinergyT2, remove bad usage of ERESTA ..., Mauro Carvalho Chehab, (Tue Oct 9, 6:21 pm)
Re: [v4l-dvb-maintainer] [PATCH 3/3] V4L: cinergyT2, remov ..., Mauro Carvalho Chehab, (Wed Oct 10, 8:35 am)
Re: [v4l-dvb-maintainer] [PATCH 3/3] V4L: cinergyT2, remov ..., Mauro Carvalho Chehab, (Wed Oct 10, 9:17 am)